{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}

module Distribution.Types.ForeignLibOption(
    ForeignLibOption(..)
) where

import Prelude ()
import Distribution.Compat.Prelude

import Distribution.Pretty
import Distribution.Parsec

import qualified Distribution.Compat.CharParsing as P
import qualified Text.PrettyPrint as Disp

data ForeignLibOption =
     -- | Merge in all dependent libraries (i.e., use
     -- @ghc -shared -static@ rather than just record
     -- the dependencies, ala @ghc -shared -dynamic@).
     -- This option is compulsory on Windows and unsupported
     -- on other platforms.
     ForeignLibStandalone
    deriving ((forall x. ForeignLibOption -> Rep ForeignLibOption x)
-> (forall x. Rep ForeignLibOption x -> ForeignLibOption)
-> Generic ForeignLibOption
forall x. Rep ForeignLibOption x -> ForeignLibOption
forall x. ForeignLibOption -> Rep ForeignLibOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ForeignLibOption x -> ForeignLibOption
$cfrom :: forall x. ForeignLibOption -> Rep ForeignLibOption x
Generic, Int -> ForeignLibOption -> ShowS
[ForeignLibOption] -> ShowS
ForeignLibOption -> String
(Int -> ForeignLibOption -> ShowS)
-> (ForeignLibOption -> String)
-> ([ForeignLibOption] -> ShowS)
-> Show ForeignLibOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ForeignLibOption] -> ShowS
$cshowList :: [ForeignLibOption] -> ShowS
show :: ForeignLibOption -> String
$cshow :: ForeignLibOption -> String
showsPrec :: Int -> ForeignLibOption -> ShowS
$cshowsPrec :: Int -> ForeignLibOption -> ShowS
Show, ReadPrec [ForeignLibOption]
ReadPrec ForeignLibOption
Int -> ReadS ForeignLibOption
ReadS [ForeignLibOption]
(Int -> ReadS ForeignLibOption)
-> ReadS [ForeignLibOption]
-> ReadPrec ForeignLibOption
-> ReadPrec [ForeignLibOption]
-> Read ForeignLibOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ForeignLibOption]
$creadListPrec :: ReadPrec [ForeignLibOption]
readPrec :: ReadPrec ForeignLibOption
$creadPrec :: ReadPrec ForeignLibOption
readList :: ReadS [ForeignLibOption]
$creadList :: ReadS [ForeignLibOption]
readsPrec :: Int -> ReadS ForeignLibOption
$creadsPrec :: Int -> ReadS ForeignLibOption
Read, ForeignLibOption -> ForeignLibOption -> Bool
(ForeignLibOption -> ForeignLibOption -> Bool)
-> (ForeignLibOption -> ForeignLibOption -> Bool)
-> Eq ForeignLibOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ForeignLibOption -> ForeignLibOption -> Bool
$c/= :: ForeignLibOption -> ForeignLibOption -> Bool
== :: ForeignLibOption -> ForeignLibOption -> Bool
$c== :: ForeignLibOption -> ForeignLibOption -> Bool
Eq, Typeable, Typeable ForeignLibOption
DataType
Constr
Typeable ForeignLibOption
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ForeignLibOption -> c ForeignLibOption)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ForeignLibOption)
-> (ForeignLibOption -> Constr)
-> (ForeignLibOption -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ForeignLibOption))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ForeignLibOption))
-> ((forall b. Data b => b -> b)
    -> ForeignLibOption -> ForeignLibOption)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ForeignLibOption -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ForeignLibOption -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ForeignLibOption -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ForeignLibOption -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ForeignLibOption -> m ForeignLibOption)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ForeignLibOption -> m ForeignLibOption)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ForeignLibOption -> m ForeignLibOption)
-> Data ForeignLibOption
ForeignLibOption -> DataType
ForeignLibOption -> Constr
(forall b. Data b => b -> b)
-> ForeignLibOption -> ForeignLibOption
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignLibOption -> c ForeignLibOption
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignLibOption
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ForeignLibOption -> u
forall u. (forall d. Data d => d -> u) -> ForeignLibOption -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignLibOption -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignLibOption -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ForeignLibOption -> m ForeignLibOption
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ForeignLibOption -> m ForeignLibOption
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignLibOption
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignLibOption -> c ForeignLibOption
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForeignLibOption)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignLibOption)
$cForeignLibStandalone :: Constr
$tForeignLibOption :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> ForeignLibOption -> m ForeignLibOption
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ForeignLibOption -> m ForeignLibOption
gmapMp :: (forall d. Data d => d -> m d)
-> ForeignLibOption -> m ForeignLibOption
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ForeignLibOption -> m ForeignLibOption
gmapM :: (forall d. Data d => d -> m d)
-> ForeignLibOption -> m ForeignLibOption
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ForeignLibOption -> m ForeignLibOption
gmapQi :: Int -> (forall d. Data d => d -> u) -> ForeignLibOption -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ForeignLibOption -> u
gmapQ :: (forall d. Data d => d -> u) -> ForeignLibOption -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ForeignLibOption -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignLibOption -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignLibOption -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignLibOption -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForeignLibOption -> r
gmapT :: (forall b. Data b => b -> b)
-> ForeignLibOption -> ForeignLibOption
$cgmapT :: (forall b. Data b => b -> b)
-> ForeignLibOption -> ForeignLibOption
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignLibOption)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForeignLibOption)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ForeignLibOption)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForeignLibOption)
dataTypeOf :: ForeignLibOption -> DataType
$cdataTypeOf :: ForeignLibOption -> DataType
toConstr :: ForeignLibOption -> Constr
$ctoConstr :: ForeignLibOption -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignLibOption
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForeignLibOption
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignLibOption -> c ForeignLibOption
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForeignLibOption -> c ForeignLibOption
$cp1Data :: Typeable ForeignLibOption
Data)

instance Pretty ForeignLibOption where
  pretty :: ForeignLibOption -> Doc
pretty ForeignLibOption
ForeignLibStandalone = String -> Doc
Disp.text String
"standalone"

instance Parsec ForeignLibOption where
  parsec :: m ForeignLibOption
parsec = do
    String
name <- (Char -> Bool) -> m String
forall (m :: * -> *). CharParsing m => (Char -> Bool) -> m String
P.munch1 (\Char
c -> Char -> Bool
isAlphaNum Char
c Bool -> Bool -> Bool
|| Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'-')
    case String
name of
      String
"standalone" -> ForeignLibOption -> m ForeignLibOption
forall (m :: * -> *) a. Monad m => a -> m a
return ForeignLibOption
ForeignLibStandalone
      String
_            -> String -> m ForeignLibOption
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"unrecognized foreign-library option"

instance Binary ForeignLibOption
instance Structured ForeignLibOption
instance NFData ForeignLibOption where rnf :: ForeignLibOption -> ()
rnf = ForeignLibOption -> ()
forall a. (Generic a, GNFData (Rep a)) => a -> ()
genericRnf