    {-# LANGUAGE NoImplicitPrelude #-}

    -- | Things common to all file locking implementations.
    module GHC.IO.Handle.Lock.Common
      ( FileLockingNotSupported(..)
      , LockMode(..)
      ) where

    import GHC.Exception
    import GHC.Show

    -- | Exception thrown by 'hLock' on non-Windows platforms that don't support
    -- 'flock'.
    data FileLockingNotSupported = FileLockingNotSupported
      deriving Int -> FileLockingNotSupported -> ShowS
    [FileLockingNotSupported] -> ShowS
    FileLockingNotSupported -> String
    (Int -> FileLockingNotSupported -> ShowS)
    -> (FileLockingNotSupported -> String)
    -> ([FileLockingNotSupported] -> ShowS)
    -> Show FileLockingNotSupported
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> FileLockingNotSupported -> ShowS
    showsPrec :: Int -> FileLockingNotSupported -> ShowS
    $cshow :: FileLockingNotSupported -> String
    show :: FileLockingNotSupported -> String
    $cshowList :: [FileLockingNotSupported] -> ShowS
    showList :: [FileLockingNotSupported] -> ShowS
    Show -- ^ @since 4.10.0.0

    -- ^ @since 4.10.0.0
    instance Exception FileLockingNotSupported

    -- | Indicates a mode in which a file should be locked.
    data LockMode = SharedLock | ExclusiveLock