    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE Safe               #-}
    module Lukko.Internal.Types where

    import Control.Exception (Exception)
    import Data.Typeable     (Typeable)

    -- | Exception thrown by 'hLock' on non-Windows platforms that don't support
    -- @flock@.
    data FileLockingNotSupported = FileLockingNotSupported
      deriving (Typeable, 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)

    instance Exception FileLockingNotSupported

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

    -- | Potentially availble lock methods.
    data FileLockingMethod
        = MethodOFD      -- ^ open file descriptor locking
        | MethodFLock    -- ^ BSD @flock@
        | MethodWindows  -- ^ Windows locking
        | MethodNoOp     -- ^ No-Op (throws 'FileLockingNotSupported')
      deriving (Typeable, FileLockingMethod -> FileLockingMethod -> Bool
    (FileLockingMethod -> FileLockingMethod -> Bool)
    -> (FileLockingMethod -> FileLockingMethod -> Bool)
    -> Eq FileLockingMethod
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: FileLockingMethod -> FileLockingMethod -> Bool
    == :: FileLockingMethod -> FileLockingMethod -> Bool
    $c/= :: FileLockingMethod -> FileLockingMethod -> Bool
    /= :: FileLockingMethod -> FileLockingMethod -> Bool
    Eq, Eq FileLockingMethod
    Eq FileLockingMethod
    -> (FileLockingMethod -> FileLockingMethod -> Ordering)
    -> (FileLockingMethod -> FileLockingMethod -> Bool)
    -> (FileLockingMethod -> FileLockingMethod -> Bool)
    -> (FileLockingMethod -> FileLockingMethod -> Bool)
    -> (FileLockingMethod -> FileLockingMethod -> Bool)
    -> (FileLockingMethod -> FileLockingMethod -> FileLockingMethod)
    -> (FileLockingMethod -> FileLockingMethod -> FileLockingMethod)
    -> Ord FileLockingMethod
    FileLockingMethod -> FileLockingMethod -> Bool
    FileLockingMethod -> FileLockingMethod -> Ordering
    FileLockingMethod -> FileLockingMethod -> FileLockingMethod
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: FileLockingMethod -> FileLockingMethod -> Ordering
    compare :: FileLockingMethod -> FileLockingMethod -> Ordering
    $c< :: FileLockingMethod -> FileLockingMethod -> Bool
    < :: FileLockingMethod -> FileLockingMethod -> Bool
    $c<= :: FileLockingMethod -> FileLockingMethod -> Bool
    <= :: FileLockingMethod -> FileLockingMethod -> Bool
    $c> :: FileLockingMethod -> FileLockingMethod -> Bool
    > :: FileLockingMethod -> FileLockingMethod -> Bool
    $c>= :: FileLockingMethod -> FileLockingMethod -> Bool
    >= :: FileLockingMethod -> FileLockingMethod -> Bool
    $cmax :: FileLockingMethod -> FileLockingMethod -> FileLockingMethod
    max :: FileLockingMethod -> FileLockingMethod -> FileLockingMethod
    $cmin :: FileLockingMethod -> FileLockingMethod -> FileLockingMethod
    min :: FileLockingMethod -> FileLockingMethod -> FileLockingMethod
    Ord, Int -> FileLockingMethod
    FileLockingMethod -> Int
    FileLockingMethod -> [FileLockingMethod]
    FileLockingMethod -> FileLockingMethod
    FileLockingMethod -> FileLockingMethod -> [FileLockingMethod]
    FileLockingMethod
    -> FileLockingMethod -> FileLockingMethod -> [FileLockingMethod]
    (FileLockingMethod -> FileLockingMethod)
    -> (FileLockingMethod -> FileLockingMethod)
    -> (Int -> FileLockingMethod)
    -> (FileLockingMethod -> Int)
    -> (FileLockingMethod -> [FileLockingMethod])
    -> (FileLockingMethod -> FileLockingMethod -> [FileLockingMethod])
    -> (FileLockingMethod -> FileLockingMethod -> [FileLockingMethod])
    -> (FileLockingMethod
        -> FileLockingMethod -> FileLockingMethod -> [FileLockingMethod])
    -> Enum FileLockingMethod
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: FileLockingMethod -> FileLockingMethod
    succ :: FileLockingMethod -> FileLockingMethod
    $cpred :: FileLockingMethod -> FileLockingMethod
    pred :: FileLockingMethod -> FileLockingMethod
    $ctoEnum :: Int -> FileLockingMethod
    toEnum :: Int -> FileLockingMethod
    $cfromEnum :: FileLockingMethod -> Int
    fromEnum :: FileLockingMethod -> Int
    $cenumFrom :: FileLockingMethod -> [FileLockingMethod]
    enumFrom :: FileLockingMethod -> [FileLockingMethod]
    $cenumFromThen :: FileLockingMethod -> FileLockingMethod -> [FileLockingMethod]
    enumFromThen :: FileLockingMethod -> FileLockingMethod -> [FileLockingMethod]
    $cenumFromTo :: FileLockingMethod -> FileLockingMethod -> [FileLockingMethod]
    enumFromTo :: FileLockingMethod -> FileLockingMethod -> [FileLockingMethod]
    $cenumFromThenTo :: FileLockingMethod
    -> FileLockingMethod -> FileLockingMethod -> [FileLockingMethod]
    enumFromThenTo :: FileLockingMethod
    -> FileLockingMethod -> FileLockingMethod -> [FileLockingMethod]
    Enum, FileLockingMethod
    FileLockingMethod -> FileLockingMethod -> Bounded FileLockingMethod
    forall a. a -> a -> Bounded a
    $cminBound :: FileLockingMethod
    minBound :: FileLockingMethod
    $cmaxBound :: FileLockingMethod
    maxBound :: FileLockingMethod
    Bounded, Int -> FileLockingMethod -> ShowS
    [FileLockingMethod] -> ShowS
    FileLockingMethod -> String
    (Int -> FileLockingMethod -> ShowS)
    -> (FileLockingMethod -> String)
    -> ([FileLockingMethod] -> ShowS)
    -> Show FileLockingMethod
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> FileLockingMethod -> ShowS
    showsPrec :: Int -> FileLockingMethod -> ShowS
    $cshow :: FileLockingMethod -> String
    show :: FileLockingMethod -> String
    $cshowList :: [FileLockingMethod] -> ShowS
    showList :: [FileLockingMethod] -> ShowS
    Show)