    {-# LANGUAGE DeriveDataTypeable #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module      :  Language.C.Syntax.Constants
    -- Copyright   :  (c) 2007..2008 Duncan Coutts, Benedikt Huber
    -- License     :  BSD-style
    -- Maintainer  : benedikt.huber@gmail.com
    -- Stability   : experimental
    -- Portability : ghc
    --
    -- This module provides support for representing, checking and exporting c
    -- constants, i.e. integral, float, character and string constants.
    -----------------------------------------------------------------------------
    module Language.C.Syntax.Constants (
      -- * Utilities
      escapeChar, unescapeChar, unescapeString,
      Flags(..), noFlags, setFlag, clearFlag, testFlag,
      -- * C char constants (and multi-character character constants)
      cChar, cChar_w, cChars, CChar(..), getCChar, getCCharAsInt, isWideChar, showCharConst,
      -- * C integral constants
      CIntFlag(..), CIntRepr(..), cInteger, CInteger(..), getCInteger,readCInteger,
      -- * C floating point constants
      cFloat,  CFloat(..), readCFloat,
      -- * C string literals
      cString, cString_w, CString(..), getCString, showStringLit, concatCStrings,
      -- * Clang C version literals
      ClangCVersion(..), readClangCVersion,
    )
    where
    import Data.Bits
    import Data.Char
    import Numeric (showOct, showHex, readHex, readOct, readDec)
    import Data.Data (Data)
    import GHC.Generics (Generic, Generic1)
    import Control.DeepSeq (NFData)

    -- | C char constants (abstract)
    data CChar = CChar
                  !Char
                  !Bool  -- wide flag
               | CChars
                  [Char] -- multi-character character constant
                  !Bool   -- wide flag
               deriving (CChar -> CChar -> Bool
    (CChar -> CChar -> Bool) -> (CChar -> CChar -> Bool) -> Eq CChar
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CChar -> CChar -> Bool
    == :: CChar -> CChar -> Bool
    $c/= :: CChar -> CChar -> Bool
    /= :: CChar -> CChar -> Bool
    Eq,Eq CChar
    Eq CChar =>
    (CChar -> CChar -> Ordering)
    -> (CChar -> CChar -> Bool)
    -> (CChar -> CChar -> Bool)
    -> (CChar -> CChar -> Bool)
    -> (CChar -> CChar -> Bool)
    -> (CChar -> CChar -> CChar)
    -> (CChar -> CChar -> CChar)
    -> Ord CChar
    CChar -> CChar -> Bool
    CChar -> CChar -> Ordering
    CChar -> CChar -> CChar
    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 :: CChar -> CChar -> Ordering
    compare :: CChar -> CChar -> Ordering
    $c< :: CChar -> CChar -> Bool
    < :: CChar -> CChar -> Bool
    $c<= :: CChar -> CChar -> Bool
    <= :: CChar -> CChar -> Bool
    $c> :: CChar -> CChar -> Bool
    > :: CChar -> CChar -> Bool
    $c>= :: CChar -> CChar -> Bool
    >= :: CChar -> CChar -> Bool
    $cmax :: CChar -> CChar -> CChar
    max :: CChar -> CChar -> CChar
    $cmin :: CChar -> CChar -> CChar
    min :: CChar -> CChar -> CChar
    Ord,Typeable CChar
    Typeable CChar =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> CChar -> c CChar)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c CChar)
    -> (CChar -> Constr)
    -> (CChar -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c CChar))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CChar))
    -> ((forall b. Data b => b -> b) -> CChar -> CChar)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r)
    -> (forall u. (forall d. Data d => d -> u) -> CChar -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> CChar -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> CChar -> m CChar)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CChar -> m CChar)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CChar -> m CChar)
    -> Data CChar
    CChar -> Constr
    CChar -> DataType
    (forall b. Data b => b -> b) -> CChar -> CChar
    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) -> CChar -> u
    forall u. (forall d. Data d => d -> u) -> CChar -> [u]
    forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r
    forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CChar -> m CChar
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CChar -> m CChar
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CChar
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CChar -> c CChar
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CChar)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CChar)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CChar -> c CChar
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CChar -> c CChar
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CChar
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CChar
    $ctoConstr :: CChar -> Constr
    toConstr :: CChar -> Constr
    $cdataTypeOf :: CChar -> DataType
    dataTypeOf :: CChar -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CChar)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CChar)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CChar)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CChar)
    $cgmapT :: (forall b. Data b => b -> b) -> CChar -> CChar
    gmapT :: (forall b. Data b => b -> b) -> CChar -> CChar
    $cgmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r
    gmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r
    gmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> CChar -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> CChar -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CChar -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CChar -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CChar -> m CChar
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CChar -> m CChar
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CChar -> m CChar
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CChar -> m CChar
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CChar -> m CChar
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CChar -> m CChar
    Data,(forall x. CChar -> Rep CChar x)
    -> (forall x. Rep CChar x -> CChar) -> Generic CChar
    forall x. Rep CChar x -> CChar
    forall x. CChar -> Rep CChar x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. CChar -> Rep CChar x
    from :: forall x. CChar -> Rep CChar x
    $cto :: forall x. Rep CChar x -> CChar
    to :: forall x. Rep CChar x -> CChar
    Generic)

    instance Show CChar where
        showsPrec :: Int -> CChar -> ShowS
    showsPrec Int
    _ (CChar Char
    c Bool
    wideflag)   = Bool -> ShowS
    _showWideFlag Bool
    wideflag ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> ShowS
    showCharConst Char
    c
        showsPrec Int
    _ (CChars String
    cs Bool
    wideflag) = Bool -> ShowS
    _showWideFlag Bool
    wideflag ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> ShowS
    sQuote ((Char -> String) -> ShowS
    forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
    concatMap Char -> String
    escapeCChar String
    cs)

    instance NFData CChar

    -- | @showCharConst c@ prepends _a_ String representing the C char constant corresponding to @c@.
    -- If necessary uses octal or hexadecimal escape sequences.
    showCharConst :: Char -> ShowS
    showCharConst :: Char -> ShowS
    showCharConst Char
    c = String -> ShowS
    sQuote (String -> ShowS) -> String -> ShowS
    forall a b. (a -> b) -> a -> b
    $ Char -> String
    escapeCChar Char
    c

    _showWideFlag :: Bool -> ShowS
    _showWideFlag :: Bool -> ShowS
    _showWideFlag Bool
    flag = if Bool
    flag then String -> ShowS
    showString String
    "L" else ShowS
    forall a. a -> a
    id

    -- | get the haskell representation of a char constant
    getCChar :: CChar -> String
    getCChar :: CChar -> String
    getCChar (CChar  Char
    c Bool
    _)   = [Char
    c]
    getCChar (CChars  String
    cs Bool
    _) = String
    cs

    -- | get integer value of a C char constant
    -- undefined result for multi-char char constants
    getCCharAsInt :: CChar -> Integer
    getCCharAsInt :: CChar -> Integer
    getCCharAsInt (CChar Char
    c Bool
    _) = Int -> Integer
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Char -> Int
    forall a. Enum a => a -> Int
    fromEnum Char
    c)
    getCCharAsInt (CChars String
    _cs Bool
    _) = String -> Integer
    forall a. HasCallStack => String -> a
    error String
    "integer value of multi-character character constants is implementation defined"

    -- | return @true@ if the character constant is /wide/.
    isWideChar :: CChar -> Bool
    isWideChar :: CChar -> Bool
    isWideChar (CChar Char
    _ Bool
    wideFlag) = Bool
    wideFlag
    isWideChar (CChars String
    _ Bool
    wideFlag) = Bool
    wideFlag

    -- | construct a character constant from a haskell 'Char'
    -- Use 'cchar_w' if you want a wide character constant.
    cChar :: Char -> CChar
    cChar :: Char -> CChar
    cChar Char
    c = Char -> Bool -> CChar
    CChar Char
    c Bool
    False

    -- | construct a wide chararacter constant
    cChar_w :: Char -> CChar
    cChar_w :: Char -> CChar
    cChar_w Char
    c = Char -> Bool -> CChar
    CChar Char
    c Bool
    True

    -- | create a multi-character character constant
    cChars :: String -> Bool -> CChar
    cChars :: String -> Bool -> CChar
    cChars = String -> Bool -> CChar
    CChars

    -- | datatype for memorizing the representation of an integer
    data CIntRepr = DecRepr | HexRepr | OctalRepr
      deriving (CIntRepr -> CIntRepr -> Bool
    (CIntRepr -> CIntRepr -> Bool)
    -> (CIntRepr -> CIntRepr -> Bool) -> Eq CIntRepr
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CIntRepr -> CIntRepr -> Bool
    == :: CIntRepr -> CIntRepr -> Bool
    $c/= :: CIntRepr -> CIntRepr -> Bool
    /= :: CIntRepr -> CIntRepr -> Bool
    Eq,Eq CIntRepr
    Eq CIntRepr =>
    (CIntRepr -> CIntRepr -> Ordering)
    -> (CIntRepr -> CIntRepr -> Bool)
    -> (CIntRepr -> CIntRepr -> Bool)
    -> (CIntRepr -> CIntRepr -> Bool)
    -> (CIntRepr -> CIntRepr -> Bool)
    -> (CIntRepr -> CIntRepr -> CIntRepr)
    -> (CIntRepr -> CIntRepr -> CIntRepr)
    -> Ord CIntRepr
    CIntRepr -> CIntRepr -> Bool
    CIntRepr -> CIntRepr -> Ordering
    CIntRepr -> CIntRepr -> CIntRepr
    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 :: CIntRepr -> CIntRepr -> Ordering
    compare :: CIntRepr -> CIntRepr -> Ordering
    $c< :: CIntRepr -> CIntRepr -> Bool
    < :: CIntRepr -> CIntRepr -> Bool
    $c<= :: CIntRepr -> CIntRepr -> Bool
    <= :: CIntRepr -> CIntRepr -> Bool
    $c> :: CIntRepr -> CIntRepr -> Bool
    > :: CIntRepr -> CIntRepr -> Bool
    $c>= :: CIntRepr -> CIntRepr -> Bool
    >= :: CIntRepr -> CIntRepr -> Bool
    $cmax :: CIntRepr -> CIntRepr -> CIntRepr
    max :: CIntRepr -> CIntRepr -> CIntRepr
    $cmin :: CIntRepr -> CIntRepr -> CIntRepr
    min :: CIntRepr -> CIntRepr -> CIntRepr
    Ord,Int -> CIntRepr
    CIntRepr -> Int
    CIntRepr -> [CIntRepr]
    CIntRepr -> CIntRepr
    CIntRepr -> CIntRepr -> [CIntRepr]
    CIntRepr -> CIntRepr -> CIntRepr -> [CIntRepr]
    (CIntRepr -> CIntRepr)
    -> (CIntRepr -> CIntRepr)
    -> (Int -> CIntRepr)
    -> (CIntRepr -> Int)
    -> (CIntRepr -> [CIntRepr])
    -> (CIntRepr -> CIntRepr -> [CIntRepr])
    -> (CIntRepr -> CIntRepr -> [CIntRepr])
    -> (CIntRepr -> CIntRepr -> CIntRepr -> [CIntRepr])
    -> Enum CIntRepr
    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 :: CIntRepr -> CIntRepr
    succ :: CIntRepr -> CIntRepr
    $cpred :: CIntRepr -> CIntRepr
    pred :: CIntRepr -> CIntRepr
    $ctoEnum :: Int -> CIntRepr
    toEnum :: Int -> CIntRepr
    $cfromEnum :: CIntRepr -> Int
    fromEnum :: CIntRepr -> Int
    $cenumFrom :: CIntRepr -> [CIntRepr]
    enumFrom :: CIntRepr -> [CIntRepr]
    $cenumFromThen :: CIntRepr -> CIntRepr -> [CIntRepr]
    enumFromThen :: CIntRepr -> CIntRepr -> [CIntRepr]
    $cenumFromTo :: CIntRepr -> CIntRepr -> [CIntRepr]
    enumFromTo :: CIntRepr -> CIntRepr -> [CIntRepr]
    $cenumFromThenTo :: CIntRepr -> CIntRepr -> CIntRepr -> [CIntRepr]
    enumFromThenTo :: CIntRepr -> CIntRepr -> CIntRepr -> [CIntRepr]
    Enum,CIntRepr
    CIntRepr -> CIntRepr -> Bounded CIntRepr
    forall a. a -> a -> Bounded a
    $cminBound :: CIntRepr
    minBound :: CIntRepr
    $cmaxBound :: CIntRepr
    maxBound :: CIntRepr
    Bounded,Typeable CIntRepr
    Typeable CIntRepr =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> CIntRepr -> c CIntRepr)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c CIntRepr)
    -> (CIntRepr -> Constr)
    -> (CIntRepr -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c CIntRepr))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntRepr))
    -> ((forall b. Data b => b -> b) -> CIntRepr -> CIntRepr)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r)
    -> (forall u. (forall d. Data d => d -> u) -> CIntRepr -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> CIntRepr -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr)
    -> Data CIntRepr
    CIntRepr -> Constr
    CIntRepr -> DataType
    (forall b. Data b => b -> b) -> CIntRepr -> CIntRepr
    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) -> CIntRepr -> u
    forall u. (forall d. Data d => d -> u) -> CIntRepr -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CIntRepr
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CIntRepr -> c CIntRepr
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CIntRepr)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntRepr)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CIntRepr -> c CIntRepr
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CIntRepr -> c CIntRepr
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CIntRepr
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CIntRepr
    $ctoConstr :: CIntRepr -> Constr
    toConstr :: CIntRepr -> Constr
    $cdataTypeOf :: CIntRepr -> DataType
    dataTypeOf :: CIntRepr -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CIntRepr)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CIntRepr)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntRepr)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntRepr)
    $cgmapT :: (forall b. Data b => b -> b) -> CIntRepr -> CIntRepr
    gmapT :: (forall b. Data b => b -> b) -> CIntRepr -> CIntRepr
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntRepr -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> CIntRepr -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> CIntRepr -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CIntRepr -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CIntRepr -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
    Data,(forall x. CIntRepr -> Rep CIntRepr x)
    -> (forall x. Rep CIntRepr x -> CIntRepr) -> Generic CIntRepr
    forall x. Rep CIntRepr x -> CIntRepr
    forall x. CIntRepr -> Rep CIntRepr x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. CIntRepr -> Rep CIntRepr x
    from :: forall x. CIntRepr -> Rep CIntRepr x
    $cto :: forall x. Rep CIntRepr x -> CIntRepr
    to :: forall x. Rep CIntRepr x -> CIntRepr
    Generic)

    instance NFData CIntRepr

    -- | datatype representing type flags for integers
    data CIntFlag = FlagUnsigned | FlagLong | FlagLongLong | FlagImag
      deriving (CIntFlag -> CIntFlag -> Bool
    (CIntFlag -> CIntFlag -> Bool)
    -> (CIntFlag -> CIntFlag -> Bool) -> Eq CIntFlag
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CIntFlag -> CIntFlag -> Bool
    == :: CIntFlag -> CIntFlag -> Bool
    $c/= :: CIntFlag -> CIntFlag -> Bool
    /= :: CIntFlag -> CIntFlag -> Bool
    Eq,Eq CIntFlag
    Eq CIntFlag =>
    (CIntFlag -> CIntFlag -> Ordering)
    -> (CIntFlag -> CIntFlag -> Bool)
    -> (CIntFlag -> CIntFlag -> Bool)
    -> (CIntFlag -> CIntFlag -> Bool)
    -> (CIntFlag -> CIntFlag -> Bool)
    -> (CIntFlag -> CIntFlag -> CIntFlag)
    -> (CIntFlag -> CIntFlag -> CIntFlag)
    -> Ord CIntFlag
    CIntFlag -> CIntFlag -> Bool
    CIntFlag -> CIntFlag -> Ordering
    CIntFlag -> CIntFlag -> CIntFlag
    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 :: CIntFlag -> CIntFlag -> Ordering
    compare :: CIntFlag -> CIntFlag -> Ordering
    $c< :: CIntFlag -> CIntFlag -> Bool
    < :: CIntFlag -> CIntFlag -> Bool
    $c<= :: CIntFlag -> CIntFlag -> Bool
    <= :: CIntFlag -> CIntFlag -> Bool
    $c> :: CIntFlag -> CIntFlag -> Bool
    > :: CIntFlag -> CIntFlag -> Bool
    $c>= :: CIntFlag -> CIntFlag -> Bool
    >= :: CIntFlag -> CIntFlag -> Bool
    $cmax :: CIntFlag -> CIntFlag -> CIntFlag
    max :: CIntFlag -> CIntFlag -> CIntFlag
    $cmin :: CIntFlag -> CIntFlag -> CIntFlag
    min :: CIntFlag -> CIntFlag -> CIntFlag
    Ord,Int -> CIntFlag
    CIntFlag -> Int
    CIntFlag -> [CIntFlag]
    CIntFlag -> CIntFlag
    CIntFlag -> CIntFlag -> [CIntFlag]
    CIntFlag -> CIntFlag -> CIntFlag -> [CIntFlag]
    (CIntFlag -> CIntFlag)
    -> (CIntFlag -> CIntFlag)
    -> (Int -> CIntFlag)
    -> (CIntFlag -> Int)
    -> (CIntFlag -> [CIntFlag])
    -> (CIntFlag -> CIntFlag -> [CIntFlag])
    -> (CIntFlag -> CIntFlag -> [CIntFlag])
    -> (CIntFlag -> CIntFlag -> CIntFlag -> [CIntFlag])
    -> Enum CIntFlag
    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 :: CIntFlag -> CIntFlag
    succ :: CIntFlag -> CIntFlag
    $cpred :: CIntFlag -> CIntFlag
    pred :: CIntFlag -> CIntFlag
    $ctoEnum :: Int -> CIntFlag
    toEnum :: Int -> CIntFlag
    $cfromEnum :: CIntFlag -> Int
    fromEnum :: CIntFlag -> Int
    $cenumFrom :: CIntFlag -> [CIntFlag]
    enumFrom :: CIntFlag -> [CIntFlag]
    $cenumFromThen :: CIntFlag -> CIntFlag -> [CIntFlag]
    enumFromThen :: CIntFlag -> CIntFlag -> [CIntFlag]
    $cenumFromTo :: CIntFlag -> CIntFlag -> [CIntFlag]
    enumFromTo :: CIntFlag -> CIntFlag -> [CIntFlag]
    $cenumFromThenTo :: CIntFlag -> CIntFlag -> CIntFlag -> [CIntFlag]
    enumFromThenTo :: CIntFlag -> CIntFlag -> CIntFlag -> [CIntFlag]
    Enum,CIntFlag
    CIntFlag -> CIntFlag -> Bounded CIntFlag
    forall a. a -> a -> Bounded a
    $cminBound :: CIntFlag
    minBound :: CIntFlag
    $cmaxBound :: CIntFlag
    maxBound :: CIntFlag
    Bounded,Typeable CIntFlag
    Typeable CIntFlag =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> CIntFlag -> c CIntFlag)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c CIntFlag)
    -> (CIntFlag -> Constr)
    -> (CIntFlag -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c CIntFlag))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntFlag))
    -> ((forall b. Data b => b -> b) -> CIntFlag -> CIntFlag)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r)
    -> (forall u. (forall d. Data d => d -> u) -> CIntFlag -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> CIntFlag -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag)
    -> Data CIntFlag
    CIntFlag -> Constr
    CIntFlag -> DataType
    (forall b. Data b => b -> b) -> CIntFlag -> CIntFlag
    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) -> CIntFlag -> u
    forall u. (forall d. Data d => d -> u) -> CIntFlag -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CIntFlag
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CIntFlag -> c CIntFlag
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CIntFlag)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntFlag)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CIntFlag -> c CIntFlag
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CIntFlag -> c CIntFlag
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CIntFlag
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CIntFlag
    $ctoConstr :: CIntFlag -> Constr
    toConstr :: CIntFlag -> Constr
    $cdataTypeOf :: CIntFlag -> DataType
    dataTypeOf :: CIntFlag -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CIntFlag)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CIntFlag)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntFlag)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntFlag)
    $cgmapT :: (forall b. Data b => b -> b) -> CIntFlag -> CIntFlag
    gmapT :: (forall b. Data b => b -> b) -> CIntFlag -> CIntFlag
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CIntFlag -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> CIntFlag -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> CIntFlag -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CIntFlag -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CIntFlag -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
    Data,(forall x. CIntFlag -> Rep CIntFlag x)
    -> (forall x. Rep CIntFlag x -> CIntFlag) -> Generic CIntFlag
    forall x. Rep CIntFlag x -> CIntFlag
    forall x. CIntFlag -> Rep CIntFlag x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. CIntFlag -> Rep CIntFlag x
    from :: forall x. CIntFlag -> Rep CIntFlag x
    $cto :: forall x. Rep CIntFlag x -> CIntFlag
    to :: forall x. Rep CIntFlag x -> CIntFlag
    Generic)
    instance Show CIntFlag where
        show :: CIntFlag -> String
    show CIntFlag
    FlagUnsigned = String
    "u"
        show CIntFlag
    FlagLong = String
    "L"
        show CIntFlag
    FlagLongLong = String
    "LL"
        show CIntFlag
    FlagImag = String
    "i"
    instance NFData CIntFlag

    {-# SPECIALIZE setFlag :: CIntFlag -> Flags CIntFlag -> Flags CIntFlag #-}
    {-# SPECIALIZE clearFlag :: CIntFlag -> Flags CIntFlag -> Flags CIntFlag #-}
    {-# SPECIALIZE testFlag :: CIntFlag -> Flags CIntFlag -> Bool #-}

    data CInteger = CInteger
                     !Integer
                     !CIntRepr
                     !(Flags CIntFlag)  -- integer flags
                     deriving (CInteger -> CInteger -> Bool
    (CInteger -> CInteger -> Bool)
    -> (CInteger -> CInteger -> Bool) -> Eq CInteger
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CInteger -> CInteger -> Bool
    == :: CInteger -> CInteger -> Bool
    $c/= :: CInteger -> CInteger -> Bool
    /= :: CInteger -> CInteger -> Bool
    Eq,Eq CInteger
    Eq CInteger =>
    (CInteger -> CInteger -> Ordering)
    -> (CInteger -> CInteger -> Bool)
    -> (CInteger -> CInteger -> Bool)
    -> (CInteger -> CInteger -> Bool)
    -> (CInteger -> CInteger -> Bool)
    -> (CInteger -> CInteger -> CInteger)
    -> (CInteger -> CInteger -> CInteger)
    -> Ord CInteger
    CInteger -> CInteger -> Bool
    CInteger -> CInteger -> Ordering
    CInteger -> CInteger -> CInteger
    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 :: CInteger -> CInteger -> Ordering
    compare :: CInteger -> CInteger -> Ordering
    $c< :: CInteger -> CInteger -> Bool
    < :: CInteger -> CInteger -> Bool
    $c<= :: CInteger -> CInteger -> Bool
    <= :: CInteger -> CInteger -> Bool
    $c> :: CInteger -> CInteger -> Bool
    > :: CInteger -> CInteger -> Bool
    $c>= :: CInteger -> CInteger -> Bool
    >= :: CInteger -> CInteger -> Bool
    $cmax :: CInteger -> CInteger -> CInteger
    max :: CInteger -> CInteger -> CInteger
    $cmin :: CInteger -> CInteger -> CInteger
    min :: CInteger -> CInteger -> CInteger
    Ord,Typeable CInteger
    Typeable CInteger =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> CInteger -> c CInteger)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c CInteger)
    -> (CInteger -> Constr)
    -> (CInteger -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c CInteger))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CInteger))
    -> ((forall b. Data b => b -> b) -> CInteger -> CInteger)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> CInteger -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> CInteger -> r)
    -> (forall u. (forall d. Data d => d -> u) -> CInteger -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> CInteger -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> CInteger -> m CInteger)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CInteger -> m CInteger)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CInteger -> m CInteger)
    -> Data CInteger
    CInteger -> Constr
    CInteger -> DataType
    (forall b. Data b => b -> b) -> CInteger -> CInteger
    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) -> CInteger -> u
    forall u. (forall d. Data d => d -> u) -> CInteger -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CInteger -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CInteger -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CInteger -> m CInteger
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CInteger -> m CInteger
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CInteger
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CInteger -> c CInteger
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CInteger)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CInteger)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CInteger -> c CInteger
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CInteger -> c CInteger
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CInteger
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CInteger
    $ctoConstr :: CInteger -> Constr
    toConstr :: CInteger -> Constr
    $cdataTypeOf :: CInteger -> DataType
    dataTypeOf :: CInteger -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CInteger)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CInteger)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CInteger)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CInteger)
    $cgmapT :: (forall b. Data b => b -> b) -> CInteger -> CInteger
    gmapT :: (forall b. Data b => b -> b) -> CInteger -> CInteger
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CInteger -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CInteger -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CInteger -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CInteger -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> CInteger -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> CInteger -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CInteger -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CInteger -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CInteger -> m CInteger
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CInteger -> m CInteger
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CInteger -> m CInteger
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CInteger -> m CInteger
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CInteger -> m CInteger
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CInteger -> m CInteger
    Data,(forall x. CInteger -> Rep CInteger x)
    -> (forall x. Rep CInteger x -> CInteger) -> Generic CInteger
    forall x. Rep CInteger x -> CInteger
    forall x. CInteger -> Rep CInteger x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. CInteger -> Rep CInteger x
    from :: forall x. CInteger -> Rep CInteger x
    $cto :: forall x. Rep CInteger x -> CInteger
    to :: forall x. Rep CInteger x -> CInteger
    Generic)
    instance Show CInteger where
        showsPrec :: Int -> CInteger -> ShowS
    showsPrec Int
    _ (CInteger Integer
    ig CIntRepr
    repr Flags CIntFlag
    flags) = Integer -> ShowS
    forall {a}. (Show a, Integral a) => a -> ShowS
    showInt Integer
    ig ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> ShowS
    showString ((CIntFlag -> String) -> [CIntFlag] -> String
    forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
    concatMap CIntFlag -> String
    showIFlag [CIntFlag
    FlagUnsigned .. ]) where
            showIFlag :: CIntFlag -> String
    showIFlag CIntFlag
    f = if CIntFlag -> Flags CIntFlag -> Bool
    forall f. Enum f => f -> Flags f -> Bool
    testFlag CIntFlag
    f Flags CIntFlag
    flags then CIntFlag -> String
    forall a. Show a => a -> String
    show CIntFlag
    f else []
            showInt :: a -> ShowS
    showInt a
    num = case CIntRepr
    repr of CIntRepr
    DecRepr -> a -> ShowS
    forall a. Show a => a -> ShowS
    shows a
    num
                                       CIntRepr
    OctalRepr -> String -> ShowS
    showString String
    "0" ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> ShowS
    forall a. Integral a => a -> ShowS
    showOct a
    num
                                       CIntRepr
    HexRepr -> String -> ShowS
    showString String
    "0x" ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> ShowS
    forall a. Integral a => a -> ShowS
    showHex a
    num
    instance NFData CInteger

    -- To be used in the lexer
    -- Note that the flag lexer won't scale
    readCInteger :: CIntRepr -> String -> Either String CInteger
    readCInteger :: CIntRepr -> String -> Either String CInteger
    readCInteger CIntRepr
    repr String
    str =
      case ReadS Integer
    readNum String
    str of
        [(Integer
    n,String
    suffix)] -> Integer -> String -> Either String CInteger
    mkCInt Integer
    n String
    suffix
        [(Integer, String)]
    parseFailed  -> String -> Either String CInteger
    forall a b. a -> Either a b
    Left (String -> Either String CInteger)
    -> String -> Either String CInteger
    forall a b. (a -> b) -> a -> b
    $ String
    "Bad Integer literal: "String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++[(Integer, String)] -> String
    forall a. Show a => a -> String
    show [(Integer, String)]
    parseFailed
      where
        readNum :: ReadS Integer
    readNum = case CIntRepr
    repr of CIntRepr
    DecRepr -> ReadS Integer
    forall a. (Eq a, Num a) => ReadS a
    readDec; CIntRepr
    HexRepr -> ReadS Integer
    forall a. (Eq a, Num a) => ReadS a
    readHex; CIntRepr
    OctalRepr -> ReadS Integer
    forall a. (Eq a, Num a) => ReadS a
    readOct
        mkCInt :: Integer -> String -> Either String CInteger
    mkCInt Integer
    n String
    suffix = (String -> Either String CInteger)
    -> (Flags CIntFlag -> Either String CInteger)
    -> Either String (Flags CIntFlag)
    -> Either String CInteger
    forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
    either String -> Either String CInteger
    forall a b. a -> Either a b
    Left (CInteger -> Either String CInteger
    forall a b. b -> Either a b
    Right (CInteger -> Either String CInteger)
    -> (Flags CIntFlag -> CInteger)
    -> Flags CIntFlag
    -> Either String CInteger
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Integer -> CIntRepr -> Flags CIntFlag -> CInteger
    CInteger Integer
    n CIntRepr
    repr)  (Either String (Flags CIntFlag) -> Either String CInteger)
    -> Either String (Flags CIntFlag) -> Either String CInteger
    forall a b. (a -> b) -> a -> b
    $ String -> Either String (Flags CIntFlag)
    readSuffix String
    suffix
        readSuffix :: String -> Either String (Flags CIntFlag)
    readSuffix = Flags CIntFlag -> String -> Either String (Flags CIntFlag)
    parseFlags Flags CIntFlag
    forall f. Flags f
    noFlags
        parseFlags :: Flags CIntFlag -> String -> Either String (Flags CIntFlag)
    parseFlags Flags CIntFlag
    flags [] = Flags CIntFlag -> Either String (Flags CIntFlag)
    forall a b. b -> Either a b
    Right Flags CIntFlag
    flags
        parseFlags Flags CIntFlag
    flags (Char
    'l':Char
    'l':String
    fs) = Flags CIntFlag -> String -> Either String (Flags CIntFlag)
    parseFlags (CIntFlag -> Flags CIntFlag -> Flags CIntFlag
    forall f. Enum f => f -> Flags f -> Flags f
    setFlag CIntFlag
    FlagLongLong Flags CIntFlag
    flags) String
    fs
        parseFlags Flags CIntFlag
    flags (Char
    'L':Char
    'L':String
    fs) = Flags CIntFlag -> String -> Either String (Flags CIntFlag)
    parseFlags (CIntFlag -> Flags CIntFlag -> Flags CIntFlag
    forall f. Enum f => f -> Flags f -> Flags f
    setFlag CIntFlag
    FlagLongLong Flags CIntFlag
    flags) String
    fs
        parseFlags Flags CIntFlag
    flags (Char
    f:String
    fs) =
          let go1 :: CIntFlag -> Either String (Flags CIntFlag)
    go1 CIntFlag
    flag = Flags CIntFlag -> String -> Either String (Flags CIntFlag)
    parseFlags (CIntFlag -> Flags CIntFlag -> Flags CIntFlag
    forall f. Enum f => f -> Flags f -> Flags f
    setFlag CIntFlag
    flag Flags CIntFlag
    flags) String
    fs in
          case Char
    f of
            Char
    'l' -> CIntFlag -> Either String (Flags CIntFlag)
    go1 CIntFlag
    FlagLong ; Char
    'L' -> CIntFlag -> Either String (Flags CIntFlag)
    go1 CIntFlag
    FlagLong
            Char
    'u' -> CIntFlag -> Either String (Flags CIntFlag)
    go1 CIntFlag
    FlagUnsigned ; Char
    'U' -> CIntFlag -> Either String (Flags CIntFlag)
    go1 CIntFlag
    FlagUnsigned
            Char
    'i' -> CIntFlag -> Either String (Flags CIntFlag)
    go1 CIntFlag
    FlagImag ; Char
    'I' -> CIntFlag -> Either String (Flags CIntFlag)
    go1 CIntFlag
    FlagImag; Char
    'j' -> CIntFlag -> Either String (Flags CIntFlag)
    go1 CIntFlag
    FlagImag; Char
    'J' -> CIntFlag -> Either String (Flags CIntFlag)
    go1 CIntFlag
    FlagImag
            Char
    _ -> String -> Either String (Flags CIntFlag)
    forall a b. a -> Either a b
    Left (String -> Either String (Flags CIntFlag))
    -> String -> Either String (Flags CIntFlag)
    forall a b. (a -> b) -> a -> b
    $ String
    "Unexpected flag " String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Char -> String
    forall a. Show a => a -> String
    show Char
    f

    getCInteger :: CInteger -> Integer
    getCInteger :: CInteger -> Integer
    getCInteger (CInteger Integer
    i CIntRepr
    _ Flags CIntFlag
    _) = Integer
    i

    -- | construct a integer constant (without type flags) from a haskell integer
    cInteger :: Integer -> CInteger
    cInteger :: Integer -> CInteger
    cInteger Integer
    i = Integer -> CIntRepr -> Flags CIntFlag -> CInteger
    CInteger Integer
    i CIntRepr
    DecRepr Flags CIntFlag
    forall f. Flags f
    noFlags

    -- | Floats (represented as strings)
    data CFloat = CFloat
                   !String
                   deriving (CFloat -> CFloat -> Bool
    (CFloat -> CFloat -> Bool)
    -> (CFloat -> CFloat -> Bool) -> Eq CFloat
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CFloat -> CFloat -> Bool
    == :: CFloat -> CFloat -> Bool
    $c/= :: CFloat -> CFloat -> Bool
    /= :: CFloat -> CFloat -> Bool
    Eq,Eq CFloat
    Eq CFloat =>
    (CFloat -> CFloat -> Ordering)
    -> (CFloat -> CFloat -> Bool)
    -> (CFloat -> CFloat -> Bool)
    -> (CFloat -> CFloat -> Bool)
    -> (CFloat -> CFloat -> Bool)
    -> (CFloat -> CFloat -> CFloat)
    -> (CFloat -> CFloat -> CFloat)
    -> Ord CFloat
    CFloat -> CFloat -> Bool
    CFloat -> CFloat -> Ordering
    CFloat -> CFloat -> CFloat
    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 :: CFloat -> CFloat -> Ordering
    compare :: CFloat -> CFloat -> Ordering
    $c< :: CFloat -> CFloat -> Bool
    < :: CFloat -> CFloat -> Bool
    $c<= :: CFloat -> CFloat -> Bool
    <= :: CFloat -> CFloat -> Bool
    $c> :: CFloat -> CFloat -> Bool
    > :: CFloat -> CFloat -> Bool
    $c>= :: CFloat -> CFloat -> Bool
    >= :: CFloat -> CFloat -> Bool
    $cmax :: CFloat -> CFloat -> CFloat
    max :: CFloat -> CFloat -> CFloat
    $cmin :: CFloat -> CFloat -> CFloat
    min :: CFloat -> CFloat -> CFloat
    Ord,Typeable CFloat
    Typeable CFloat =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> CFloat -> c CFloat)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c CFloat)
    -> (CFloat -> Constr)
    -> (CFloat -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c CFloat))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CFloat))
    -> ((forall b. Data b => b -> b) -> CFloat -> CFloat)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> CFloat -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> CFloat -> r)
    -> (forall u. (forall d. Data d => d -> u) -> CFloat -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> CFloat -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> CFloat -> m CFloat)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CFloat -> m CFloat)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CFloat -> m CFloat)
    -> Data CFloat
    CFloat -> Constr
    CFloat -> DataType
    (forall b. Data b => b -> b) -> CFloat -> CFloat
    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) -> CFloat -> u
    forall u. (forall d. Data d => d -> u) -> CFloat -> [u]
    forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r
    forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CFloat -> m CFloat
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CFloat -> m CFloat
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CFloat
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CFloat -> c CFloat
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CFloat)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CFloat)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CFloat -> c CFloat
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CFloat -> c CFloat
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CFloat
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CFloat
    $ctoConstr :: CFloat -> Constr
    toConstr :: CFloat -> Constr
    $cdataTypeOf :: CFloat -> DataType
    dataTypeOf :: CFloat -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CFloat)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CFloat)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CFloat)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CFloat)
    $cgmapT :: (forall b. Data b => b -> b) -> CFloat -> CFloat
    gmapT :: (forall b. Data b => b -> b) -> CFloat -> CFloat
    $cgmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r
    gmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r
    gmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> CFloat -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> CFloat -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CFloat -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CFloat -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CFloat -> m CFloat
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CFloat -> m CFloat
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CFloat -> m CFloat
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CFloat -> m CFloat
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CFloat -> m CFloat
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CFloat -> m CFloat
    Data,(forall x. CFloat -> Rep CFloat x)
    -> (forall x. Rep CFloat x -> CFloat) -> Generic CFloat
    forall x. Rep CFloat x -> CFloat
    forall x. CFloat -> Rep CFloat x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. CFloat -> Rep CFloat x
    from :: forall x. CFloat -> Rep CFloat x
    $cto :: forall x. Rep CFloat x -> CFloat
    to :: forall x. Rep CFloat x -> CFloat
    Generic)
    instance Show CFloat where
      showsPrec :: Int -> CFloat -> ShowS
    showsPrec Int
    _ (CFloat String
    internal) = String -> ShowS
    showString String
    internal
    instance NFData CFloat

    cFloat :: Float -> CFloat
    cFloat :: Float -> CFloat
    cFloat = String -> CFloat
    CFloat (String -> CFloat) -> (Float -> String) -> Float -> CFloat
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Float -> String
    forall a. Show a => a -> String
    show

    -- dummy implementation
    readCFloat :: String -> CFloat
    readCFloat :: String -> CFloat
    readCFloat = String -> CFloat
    CFloat

    -- | Clang dotted version literal
    -- <https://clang.llvm.org/docs/AttributeReference.html#availability>
    data ClangCVersion = ClangCVersion
                         !String
                         deriving (ClangCVersion -> ClangCVersion -> Bool
    (ClangCVersion -> ClangCVersion -> Bool)
    -> (ClangCVersion -> ClangCVersion -> Bool) -> Eq ClangCVersion
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ClangCVersion -> ClangCVersion -> Bool
    == :: ClangCVersion -> ClangCVersion -> Bool
    $c/= :: ClangCVersion -> ClangCVersion -> Bool
    /= :: ClangCVersion -> ClangCVersion -> Bool
    Eq,Eq ClangCVersion
    Eq ClangCVersion =>
    (ClangCVersion -> ClangCVersion -> Ordering)
    -> (ClangCVersion -> ClangCVersion -> Bool)
    -> (ClangCVersion -> ClangCVersion -> Bool)
    -> (ClangCVersion -> ClangCVersion -> Bool)
    -> (ClangCVersion -> ClangCVersion -> Bool)
    -> (ClangCVersion -> ClangCVersion -> ClangCVersion)
    -> (ClangCVersion -> ClangCVersion -> ClangCVersion)
    -> Ord ClangCVersion
    ClangCVersion -> ClangCVersion -> Bool
    ClangCVersion -> ClangCVersion -> Ordering
    ClangCVersion -> ClangCVersion -> ClangCVersion
    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 :: ClangCVersion -> ClangCVersion -> Ordering
    compare :: ClangCVersion -> ClangCVersion -> Ordering
    $c< :: ClangCVersion -> ClangCVersion -> Bool
    < :: ClangCVersion -> ClangCVersion -> Bool
    $c<= :: ClangCVersion -> ClangCVersion -> Bool
    <= :: ClangCVersion -> ClangCVersion -> Bool
    $c> :: ClangCVersion -> ClangCVersion -> Bool
    > :: ClangCVersion -> ClangCVersion -> Bool
    $c>= :: ClangCVersion -> ClangCVersion -> Bool
    >= :: ClangCVersion -> ClangCVersion -> Bool
    $cmax :: ClangCVersion -> ClangCVersion -> ClangCVersion
    max :: ClangCVersion -> ClangCVersion -> ClangCVersion
    $cmin :: ClangCVersion -> ClangCVersion -> ClangCVersion
    min :: ClangCVersion -> ClangCVersion -> ClangCVersion
    Ord,Typeable ClangCVersion
    Typeable ClangCVersion =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> ClangCVersion -> c ClangCVersion)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c ClangCVersion)
    -> (ClangCVersion -> Constr)
    -> (ClangCVersion -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c ClangCVersion))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c ClangCVersion))
    -> ((forall b. Data b => b -> b) -> ClangCVersion -> ClangCVersion)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r)
    -> (forall u. (forall d. Data d => d -> u) -> ClangCVersion -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> ClangCVersion -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion)
    -> Data ClangCVersion
    ClangCVersion -> Constr
    ClangCVersion -> DataType
    (forall b. Data b => b -> b) -> ClangCVersion -> ClangCVersion
    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) -> ClangCVersion -> u
    forall u. (forall d. Data d => d -> u) -> ClangCVersion -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ClangCVersion
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ClangCVersion -> c ClangCVersion
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ClangCVersion)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ClangCVersion)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ClangCVersion -> c ClangCVersion
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ClangCVersion -> c ClangCVersion
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ClangCVersion
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ClangCVersion
    $ctoConstr :: ClangCVersion -> Constr
    toConstr :: ClangCVersion -> Constr
    $cdataTypeOf :: ClangCVersion -> DataType
    dataTypeOf :: ClangCVersion -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ClangCVersion)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ClangCVersion)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ClangCVersion)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ClangCVersion)
    $cgmapT :: (forall b. Data b => b -> b) -> ClangCVersion -> ClangCVersion
    gmapT :: (forall b. Data b => b -> b) -> ClangCVersion -> ClangCVersion
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> ClangCVersion -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> ClangCVersion -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ClangCVersion -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ClangCVersion -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
    Data)
    instance Show ClangCVersion where
      showsPrec :: Int -> ClangCVersion -> ShowS
    showsPrec Int
    _ (ClangCVersion String
    internal) = String -> ShowS
    showString String
    internal

    readClangCVersion :: String -> ClangCVersion
    readClangCVersion :: String -> ClangCVersion
    readClangCVersion = String -> ClangCVersion
    ClangCVersion

    -- | C String literals
    data CString = CString
                    String    -- characters
                    Bool      -- wide flag
                    deriving (CString -> CString -> Bool
    (CString -> CString -> Bool)
    -> (CString -> CString -> Bool) -> Eq CString
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CString -> CString -> Bool
    == :: CString -> CString -> Bool
    $c/= :: CString -> CString -> Bool
    /= :: CString -> CString -> Bool
    Eq,Eq CString
    Eq CString =>
    (CString -> CString -> Ordering)
    -> (CString -> CString -> Bool)
    -> (CString -> CString -> Bool)
    -> (CString -> CString -> Bool)
    -> (CString -> CString -> Bool)
    -> (CString -> CString -> CString)
    -> (CString -> CString -> CString)
    -> Ord CString
    CString -> CString -> Bool
    CString -> CString -> Ordering
    CString -> CString -> CString
    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 :: CString -> CString -> Ordering
    compare :: CString -> CString -> Ordering
    $c< :: CString -> CString -> Bool
    < :: CString -> CString -> Bool
    $c<= :: CString -> CString -> Bool
    <= :: CString -> CString -> Bool
    $c> :: CString -> CString -> Bool
    > :: CString -> CString -> Bool
    $c>= :: CString -> CString -> Bool
    >= :: CString -> CString -> Bool
    $cmax :: CString -> CString -> CString
    max :: CString -> CString -> CString
    $cmin :: CString -> CString -> CString
    min :: CString -> CString -> CString
    Ord,Typeable CString
    Typeable CString =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> CString -> c CString)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c CString)
    -> (CString -> Constr)
    -> (CString -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c CString))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CString))
    -> ((forall b. Data b => b -> b) -> CString -> CString)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> CString -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> CString -> r)
    -> (forall u. (forall d. Data d => d -> u) -> CString -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> CString -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> CString -> m CString)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CString -> m CString)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> CString -> m CString)
    -> Data CString
    CString -> Constr
    CString -> DataType
    (forall b. Data b => b -> b) -> CString -> CString
    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) -> CString -> u
    forall u. (forall d. Data d => d -> u) -> CString -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CString -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CString -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CString -> m CString
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CString -> m CString
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CString
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CString -> c CString
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CString)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CString)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CString -> c CString
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> CString -> c CString
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CString
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CString
    $ctoConstr :: CString -> Constr
    toConstr :: CString -> Constr
    $cdataTypeOf :: CString -> DataType
    dataTypeOf :: CString -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CString)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CString)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CString)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CString)
    $cgmapT :: (forall b. Data b => b -> b) -> CString -> CString
    gmapT :: (forall b. Data b => b -> b) -> CString -> CString
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CString -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CString -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CString -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CString -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> CString -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> CString -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CString -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CString -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CString -> m CString
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> CString -> m CString
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CString -> m CString
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CString -> m CString
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CString -> m CString
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> CString -> m CString
    Data, (forall x. CString -> Rep CString x)
    -> (forall x. Rep CString x -> CString) -> Generic CString
    forall x. Rep CString x -> CString
    forall x. CString -> Rep CString x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. CString -> Rep CString x
    from :: forall x. CString -> Rep CString x
    $cto :: forall x. Rep CString x -> CString
    to :: forall x. Rep CString x -> CString
    Generic)
    instance Show CString where
        showsPrec :: Int -> CString -> ShowS
    showsPrec Int
    _ (CString String
    str Bool
    wideflag) = Bool -> ShowS
    _showWideFlag Bool
    wideflag ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> ShowS
    showStringLit String
    str
    instance NFData CString

    -- construction
    cString :: String -> CString
    cString :: String -> CString
    cString String
    str = String -> Bool -> CString
    CString String
    str Bool
    False
    cString_w :: String -> CString
    cString_w :: String -> CString
    cString_w String
    str = String -> Bool -> CString
    CString String
    str Bool
    True

    -- selectors
    getCString :: CString -> String
    getCString :: CString -> String
    getCString (CString String
    str Bool
    _) = String
    str
    isWideString :: CString -> Bool
    isWideString :: CString -> Bool
    isWideString (CString String
    _ Bool
    wideflag) = Bool
    wideflag

    -- | concatenate a list of C string literals
    concatCStrings :: [CString] -> CString
    concatCStrings :: [CString] -> CString
    concatCStrings [CString]
    cs = String -> Bool -> CString
    CString ((CString -> String) -> [CString] -> String
    forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
    concatMap CString -> String
    getCString [CString]
    cs) ((CString -> Bool) -> [CString] -> Bool
    forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
    any CString -> Bool
    isWideString [CString]
    cs)

    -- | @showStringLiteral s@ prepends a String representing the C string literal corresponding to @s@.
    -- If necessary it uses octal or hexadecimal escape sequences.
    showStringLit :: String -> ShowS
    showStringLit :: String -> ShowS
    showStringLit = String -> ShowS
    dQuote (String -> ShowS) -> ShowS -> String -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Char -> String) -> ShowS
    forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
    concatMap Char -> String
    showStringChar
      where
      showStringChar :: Char -> String
    showStringChar Char
    c | Char -> Bool
    isSChar Char
    c = Char -> String
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return Char
    c
                         | Char
    c Char -> Char -> Bool
    forall a. Eq a => a -> a -> Bool
    == Char
    '"'  = String
    "\\\""
                         | Bool
    otherwise = Char -> String
    escapeChar Char
    c

    -- | @isAsciiSourceChar b@ returns @True@ if the given character is a character which
    --   may appear in a ASCII C source file and is printable.
    isAsciiSourceChar :: Char -> Bool
    isAsciiSourceChar :: Char -> Bool
    isAsciiSourceChar Char
    c = Char -> Bool
    isAscii Char
    c Bool -> Bool -> Bool
    && Char -> Bool
    isPrint Char
    c

    -- | @isCChar c@ returns true, if c is a source character which does not have to be escaped in
    --   C char constants (C99: 6.4.4.4)
    isCChar :: Char -> Bool
    isCChar :: Char -> Bool
    isCChar Char
    '\\' = Bool
    False
    isCChar Char
    '\'' = Bool
    False
    isCChar Char
    '\n' = Bool
    False
    isCChar Char
    c = Char -> Bool
    isAsciiSourceChar Char
    c

    -- | @escapeCChar c@ escapes c for use in a char constant
    escapeCChar :: Char -> String
    escapeCChar :: Char -> String
    escapeCChar Char
    '\'' = String
    "\\'"
    escapeCChar Char
    c | Char -> Bool
    isCChar Char
    c = [Char
    c]
                  | Bool
    otherwise = Char -> String
    escapeChar Char
    c

    -- | @isSChar c@ returns true if c is a source character which does not have to be escaped in C string
    --  literals (C99: 6.4.5)
    isSChar :: Char -> Bool
    isSChar :: Char -> Bool
    isSChar Char
    '\\' = Bool
    False
    isSChar Char
    '\"' = Bool
    False
    isSChar Char
    '\n' = Bool
    False
    isSChar Char
    c = Char -> Bool
    isAsciiSourceChar Char
    c

    showOct' :: Int -> String
    showOct' :: Int -> String
    showOct' Int
    i = Int -> Char -> String
    forall a. Int -> a -> [a]
    replicate (Int
    3 Int -> Int -> Int
    forall a. Num a => a -> a -> a
    - String -> Int
    forall a. [a] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length String
    s) Char
    '0' String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ String
    s
      where s :: String
    s = Int -> ShowS
    forall a. Integral a => a -> ShowS
    showOct Int
    i String
    ""

    escapeChar :: Char -> String
    escapeChar :: Char -> String
    escapeChar Char
    '\\' = String
    "\\\\"
    escapeChar Char
    '\a' = String
    "\\a"
    escapeChar Char
    '\b' = String
    "\\b"
    escapeChar Char
    '\f' = String
    "\\f"
    escapeChar Char
    '\n' = String
    "\\n"
    escapeChar Char
    '\r' = String
    "\\r"
    escapeChar Char
    '\t' = String
    "\\t"
    escapeChar Char
    '\v' = String
    "\\v"
    escapeChar Char
    c  | (Char -> Int
    ord Char
    c) Int -> Int -> Bool
    forall a. Ord a => a -> a -> Bool
    < Int
    512   = Char
    '\\' Char -> ShowS
    forall a. a -> [a] -> [a]
    : Int -> String
    showOct' (Char -> Int
    ord Char
    c)
                  | Bool
    otherwise       = Char
    '\\' Char -> ShowS
    forall a. a -> [a] -> [a]
    : Char
    'x'  Char -> ShowS
    forall a. a -> [a] -> [a]
    : Int -> ShowS
    forall a. Integral a => a -> ShowS
    showHex (Char -> Int
    ord Char
    c) String
    ""

    unescapeChar :: String -> (Char, String)
    unescapeChar :: String -> (Char, String)
    unescapeChar (Char
    '\\':Char
    c:String
    cs)  = case Char
    c of
           Char
    'n'  -> (Char
    '\n', String
    cs)
           Char
    't'  -> (Char
    '\t', String
    cs)
           Char
    'v'  -> (Char
    '\v', String
    cs)
           Char
    'b'  -> (Char
    '\b', String
    cs)
           Char
    'r'  -> (Char
    '\r', String
    cs)
           Char
    'f'  -> (Char
    '\f', String
    cs)
           Char
    'a'  -> (Char
    '\a', String
    cs)
           Char
    'e'  -> (Char
    '\ESC', String
    cs)  -- GNU extension
           Char
    'E'  -> (Char
    '\ESC', String
    cs)  -- GNU extension
           Char
    '\\' -> (Char
    '\\', String
    cs)
           Char
    '?'  -> (Char
    '?', String
    cs)
           Char
    '\'' -> (Char
    '\'', String
    cs)
           Char
    '"'  -> (Char
    '"', String
    cs)
           Char
    'x'  -> case String -> [(Int, String)] -> (Int, String)
    forall a. String -> [a] -> a
    head' String
    "bad escape sequence" (ReadS Int
    forall a. (Eq a, Num a) => ReadS a
    readHex String
    cs) of
                     (Int
    i, String
    cs') -> (Int -> Char
    forall a. Enum a => Int -> a
    toEnum Int
    i, String
    cs')
           Char
    _    -> case String -> [(Int, String)] -> (Int, String)
    forall a. String -> [a] -> a
    head' String
    "bad escape sequence" (ReadS Int
    readOct' (Char
    cChar -> ShowS
    forall a. a -> [a] -> [a]
    :String
    cs)) of
                     (Int
    i, String
    cs') -> (Int -> Char
    forall a. Enum a => Int -> a
    toEnum Int
    i, String
    cs')
    unescapeChar (Char
    c   :String
    cs)    = (Char
    c, String
    cs)
    unescapeChar []  = String -> (Char, String)
    forall a. HasCallStack => String -> a
    error (String -> (Char, String)) -> String -> (Char, String)
    forall a b. (a -> b) -> a -> b
    $ String
    "unescape char: empty string"

    readOct' :: ReadS Int
    readOct' :: ReadS Int
    readOct' String
    s = ((Int, String) -> (Int, String))
    -> [(Int, String)] -> [(Int, String)]
    forall a b. (a -> b) -> [a] -> [b]
    map (\(Int
    i, String
    cs) -> (Int
    i, String
    cs String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ String
    rest)) (ReadS Int
    forall a. (Eq a, Num a) => ReadS a
    readOct String
    octStr)
      where octStr :: String
    octStr = (Char -> Bool) -> ShowS
    forall a. (a -> Bool) -> [a] -> [a]
    takeWhile Char -> Bool
    isOctDigit ShowS -> ShowS
    forall a b. (a -> b) -> a -> b
    $ Int -> ShowS
    forall a. Int -> [a] -> [a]
    take Int
    3 String
    s
            rest :: String
    rest = Int -> ShowS
    forall a. Int -> [a] -> [a]
    drop (String -> Int
    forall a. [a] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length String
    octStr) String
    s

    unescapeString :: String -> String
    unescapeString :: ShowS
    unescapeString [] = []
    unescapeString String
    cs = case String -> (Char, String)
    unescapeChar String
    cs of
                            (Char
    c, String
    cs') -> Char
    c Char -> ShowS
    forall a. a -> [a] -> [a]
    : ShowS
    unescapeString String
    cs'

    -- helpers
    sQuote :: String -> ShowS
    sQuote :: String -> ShowS
    sQuote String
    s String
    t = String
    "'" String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ String
    s String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ String
    "'" String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ String
    t
    dQuote :: String -> ShowS
    dQuote :: String -> ShowS
    dQuote String
    s String
    t = (Char
    '"' Char -> ShowS
    forall a. a -> [a] -> [a]
    : String
    s) String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ String
    "\"" String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ String
    t
    head' :: String -> [a] -> a
    head' :: forall a. String -> [a] -> a
    head' String
    err []  = String -> a
    forall a. HasCallStack => String -> a
    error String
    err
    head' String
    _ (a
    x:[a]
    _) = a
    x

    -- TODO: Move to separate file ?
    newtype Flags f = Flags Integer deriving (Flags f -> Flags f -> Bool
    (Flags f -> Flags f -> Bool)
    -> (Flags f -> Flags f -> Bool) -> Eq (Flags f)
    forall f. Flags f -> Flags f -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall f. Flags f -> Flags f -> Bool
    == :: Flags f -> Flags f -> Bool
    $c/= :: forall f. Flags f -> Flags f -> Bool
    /= :: Flags f -> Flags f -> Bool
    Eq,Eq (Flags f)
    Eq (Flags f) =>
    (Flags f -> Flags f -> Ordering)
    -> (Flags f -> Flags f -> Bool)
    -> (Flags f -> Flags f -> Bool)
    -> (Flags f -> Flags f -> Bool)
    -> (Flags f -> Flags f -> Bool)
    -> (Flags f -> Flags f -> Flags f)
    -> (Flags f -> Flags f -> Flags f)
    -> Ord (Flags f)
    Flags f -> Flags f -> Bool
    Flags f -> Flags f -> Ordering
    Flags f -> Flags f -> Flags f
    forall f. Eq (Flags f)
    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
    forall f. Flags f -> Flags f -> Bool
    forall f. Flags f -> Flags f -> Ordering
    forall f. Flags f -> Flags f -> Flags f
    $ccompare :: forall f. Flags f -> Flags f -> Ordering
    compare :: Flags f -> Flags f -> Ordering
    $c< :: forall f. Flags f -> Flags f -> Bool
    < :: Flags f -> Flags f -> Bool
    $c<= :: forall f. Flags f -> Flags f -> Bool
    <= :: Flags f -> Flags f -> Bool
    $c> :: forall f. Flags f -> Flags f -> Bool
    > :: Flags f -> Flags f -> Bool
    $c>= :: forall f. Flags f -> Flags f -> Bool
    >= :: Flags f -> Flags f -> Bool
    $cmax :: forall f. Flags f -> Flags f -> Flags f
    max :: Flags f -> Flags f -> Flags f
    $cmin :: forall f. Flags f -> Flags f -> Flags f
    min :: Flags f -> Flags f -> Flags f
    Ord,Typeable (Flags f)
    Typeable (Flags f) =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Flags f -> c (Flags f))
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c (Flags f))
    -> (Flags f -> Constr)
    -> (Flags f -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c (Flags f)))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Flags f)))
    -> ((forall b. Data b => b -> b) -> Flags f -> Flags f)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> Flags f -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> Flags f -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Flags f -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> Flags f -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> Flags f -> m (Flags f))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Flags f -> m (Flags f))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Flags f -> m (Flags f))
    -> Data (Flags f)
    Flags f -> Constr
    Flags f -> DataType
    (forall b. Data b => b -> b) -> Flags f -> Flags f
    forall f. Data f => Typeable (Flags f)
    forall f. Data f => Flags f -> Constr
    forall f. Data f => Flags f -> DataType
    forall f.
    Data f =>
    (forall b. Data b => b -> b) -> Flags f -> Flags f
    forall f u.
    Data f =>
    Int -> (forall d. Data d => d -> u) -> Flags f -> u
    forall f u.
    Data f =>
    (forall d. Data d => d -> u) -> Flags f -> [u]
    forall f r r'.
    Data f =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Flags f -> r
    forall f r r'.
    Data f =>
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Flags f -> r
    forall f (m :: * -> *).
    (Data f, Monad m) =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    forall f (m :: * -> *).
    (Data f, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    forall f (c :: * -> *).
    Data f =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Flags f)
    forall f (c :: * -> *).
    Data f =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Flags f -> c (Flags f)
    forall f (t :: * -> *) (c :: * -> *).
    (Data f, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (Flags f))
    forall f (t :: * -> * -> *) (c :: * -> *).
    (Data f, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Flags f))
    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) -> Flags f -> u
    forall u. (forall d. Data d => d -> u) -> Flags f -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Flags f -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Flags f -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Flags f)
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Flags f -> c (Flags f)
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Flags f))
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Flags f))
    $cgfoldl :: forall f (c :: * -> *).
    Data f =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Flags f -> c (Flags f)
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Flags f -> c (Flags f)
    $cgunfold :: forall f (c :: * -> *).
    Data f =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Flags f)
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Flags f)
    $ctoConstr :: forall f. Data f => Flags f -> Constr
    toConstr :: Flags f -> Constr
    $cdataTypeOf :: forall f. Data f => Flags f -> DataType
    dataTypeOf :: Flags f -> DataType
    $cdataCast1 :: forall f (t :: * -> *) (c :: * -> *).
    (Data f, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (Flags f))
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Flags f))
    $cdataCast2 :: forall f (t :: * -> * -> *) (c :: * -> *).
    (Data f, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Flags f))
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Flags f))
    $cgmapT :: forall f.
    Data f =>
    (forall b. Data b => b -> b) -> Flags f -> Flags f
    gmapT :: (forall b. Data b => b -> b) -> Flags f -> Flags f
    $cgmapQl :: forall f r r'.
    Data f =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Flags f -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Flags f -> r
    $cgmapQr :: forall f r r'.
    Data f =>
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Flags f -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Flags f -> r
    $cgmapQ :: forall f u.
    Data f =>
    (forall d. Data d => d -> u) -> Flags f -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> Flags f -> [u]
    $cgmapQi :: forall f u.
    Data f =>
    Int -> (forall d. Data d => d -> u) -> Flags f -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Flags f -> u
    $cgmapM :: forall f (m :: * -> *).
    (Data f, Monad m) =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    $cgmapMp :: forall f (m :: * -> *).
    (Data f, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    $cgmapMo :: forall f (m :: * -> *).
    (Data f, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
    Data,(forall x. Flags f -> Rep (Flags f) x)
    -> (forall x. Rep (Flags f) x -> Flags f) -> Generic (Flags f)
    forall x. Rep (Flags f) x -> Flags f
    forall x. Flags f -> Rep (Flags f) x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    forall f x. Rep (Flags f) x -> Flags f
    forall f x. Flags f -> Rep (Flags f) x
    $cfrom :: forall f x. Flags f -> Rep (Flags f) x
    from :: forall x. Flags f -> Rep (Flags f) x
    $cto :: forall f x. Rep (Flags f) x -> Flags f
    to :: forall x. Rep (Flags f) x -> Flags f
    Generic,(forall a. Flags a -> Rep1 Flags a)
    -> (forall a. Rep1 Flags a -> Flags a) -> Generic1 Flags
    forall a. Rep1 Flags a -> Flags a
    forall a. Flags a -> Rep1 Flags a
    forall k (f :: k -> *).
    (forall (a :: k). f a -> Rep1 f a)
    -> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
    $cfrom1 :: forall a. Flags a -> Rep1 Flags a
    from1 :: forall a. Flags a -> Rep1 Flags a
    $cto1 :: forall a. Rep1 Flags a -> Flags a
    to1 :: forall a. Rep1 Flags a -> Flags a
    Generic1)
    instance NFData (Flags f)
    noFlags :: Flags f
    noFlags :: forall f. Flags f
    noFlags = Integer -> Flags f
    forall f. Integer -> Flags f
    Flags Integer
    0
    setFlag :: (Enum f) => f -> Flags f -> Flags f
    setFlag :: forall f. Enum f => f -> Flags f -> Flags f
    setFlag f
    flag (Flags Integer
    k)   = Integer -> Flags f
    forall f. Integer -> Flags f
    Flags(Integer -> Flags f) -> Integer -> Flags f
    forall a b. (a -> b) -> a -> b
    $ Integer
    k  Integer -> Int -> Integer
    forall a. Bits a => a -> Int -> a
    `setBit` f -> Int
    forall a. Enum a => a -> Int
    fromEnum f
    flag
    clearFlag :: (Enum f) => f -> Flags f -> Flags f
    clearFlag :: forall f. Enum f => f -> Flags f -> Flags f
    clearFlag f
    flag (Flags Integer
    k) = Integer -> Flags f
    forall f. Integer -> Flags f
    Flags(Integer -> Flags f) -> Integer -> Flags f
    forall a b. (a -> b) -> a -> b
    $ Integer
    k Integer -> Int -> Integer
    forall a. Bits a => a -> Int -> a
    `clearBit` f -> Int
    forall a. Enum a => a -> Int
    fromEnum f
    flag
    testFlag :: (Enum f) => f -> Flags f -> Bool
    testFlag :: forall f. Enum f => f -> Flags f -> Bool
    testFlag f
    flag (Flags Integer
    k)  = Integer
    k Integer -> Int -> Bool
    forall a. Bits a => a -> Int -> Bool
    `testBit` f -> Int
    forall a. Enum a => a -> Int
    fromEnum f
    flag