{-# LANGUAGE DeriveDataTypeable #-}
module Language.C.Syntax.Constants (
escapeChar, unescapeChar, unescapeString,
Flags(..), noFlags, setFlag, clearFlag, testFlag,
cChar, cChar_w, cChars, CChar(..), getCChar, getCCharAsInt, isWideChar, showCharConst,
CIntFlag(..), CIntRepr(..), cInteger, CInteger(..), getCInteger,readCInteger,
cFloat, CFloat(..), readCFloat,
cString, cString_w, CString(..), getCString, showStringLit, concatCStrings,
ClangCVersion(..), readClangCVersion,
)
where
import Data.Bits
import Data.Char
import Numeric (showOct, showHex, readHex, readOct, readDec)
import Data.Generics hiding (Generic)
import GHC.Generics (Generic, Generic1)
import Control.DeepSeq (NFData)
data CChar = CChar
!Char
!Bool
| CChars
[Char]
!Bool
deriving (CChar -> CChar -> Bool
(CChar -> CChar -> Bool) -> (CChar -> CChar -> Bool) -> Eq CChar
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CChar -> CChar -> Bool
$c/= :: CChar -> CChar -> Bool
== :: CChar -> CChar -> Bool
$c== :: 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
min :: CChar -> CChar -> CChar
$cmin :: CChar -> CChar -> CChar
max :: CChar -> CChar -> CChar
$cmax :: CChar -> CChar -> CChar
>= :: CChar -> CChar -> Bool
$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
compare :: CChar -> CChar -> Ordering
$ccompare :: CChar -> CChar -> Ordering
$cp1Ord :: Eq CChar
Ord,Typeable CChar
DataType
Constr
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 -> DataType
CChar -> Constr
(forall b. Data b => b -> b) -> CChar -> CChar
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CChar -> c CChar
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cCChars :: Constr
$cCChar :: Constr
$tCChar :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> CChar -> m CChar
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CChar -> m CChar
gmapQi :: Int -> (forall d. Data d => d -> u) -> CChar -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CChar -> u
gmapQ :: (forall d. Data d => d -> u) -> CChar -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CChar -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CChar -> r
gmapT :: (forall b. Data b => b -> b) -> CChar -> CChar
$cgmapT :: (forall b. Data b => b -> b) -> CChar -> CChar
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CChar)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CChar)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CChar)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CChar)
dataTypeOf :: CChar -> DataType
$cdataTypeOf :: CChar -> DataType
toConstr :: CChar -> Constr
$ctoConstr :: CChar -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CChar
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CChar
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CChar -> c CChar
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CChar -> c CChar
$cp1Data :: Typeable CChar
Data,Typeable,(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
$cto :: forall x. Rep CChar x -> CChar
$cfrom :: forall x. CChar -> Rep CChar x
Generic)
instance Show CChar where
showsPrec :: Int -> CChar -> ShowS
showsPrec _ (CChar c :: Char
c wideflag :: 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 _ (CChars cs :: String
cs wideflag :: 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 :: Char -> ShowS
showCharConst :: Char -> ShowS
showCharConst c :: 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 flag :: Bool
flag = if Bool
flag then String -> ShowS
showString "L" else ShowS
forall a. a -> a
id
getCChar :: CChar -> String
getCChar :: CChar -> String
getCChar (CChar c :: Char
c _) = [Char
c]
getCChar (CChars cs :: String
cs _) = String
cs
getCCharAsInt :: CChar -> Integer
getCCharAsInt :: CChar -> Integer
getCCharAsInt (CChar c :: Char
c _) = 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 _cs :: String
_cs _) = String -> Integer
forall a. HasCallStack => String -> a
error "integer value of multi-character character constants is implementation defined"
isWideChar :: CChar -> Bool
isWideChar :: CChar -> Bool
isWideChar (CChar _ wideFlag :: Bool
wideFlag) = Bool
wideFlag
isWideChar (CChars _ wideFlag :: Bool
wideFlag) = Bool
wideFlag
cChar :: Char -> CChar
cChar :: Char -> CChar
cChar c :: Char
c = Char -> Bool -> CChar
CChar Char
c Bool
False
cChar_w :: Char -> CChar
cChar_w :: Char -> CChar
cChar_w c :: Char
c = Char -> Bool -> CChar
CChar Char
c Bool
True
cChars :: String -> Bool -> CChar
cChars :: String -> Bool -> CChar
cChars = String -> Bool -> CChar
CChars
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
/= :: CIntRepr -> CIntRepr -> Bool
$c/= :: CIntRepr -> CIntRepr -> Bool
== :: CIntRepr -> CIntRepr -> Bool
$c== :: 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
min :: CIntRepr -> CIntRepr -> CIntRepr
$cmin :: CIntRepr -> CIntRepr -> CIntRepr
max :: CIntRepr -> CIntRepr -> CIntRepr
$cmax :: CIntRepr -> CIntRepr -> CIntRepr
>= :: CIntRepr -> CIntRepr -> Bool
$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
compare :: CIntRepr -> CIntRepr -> Ordering
$ccompare :: CIntRepr -> CIntRepr -> Ordering
$cp1Ord :: Eq 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
enumFromThenTo :: CIntRepr -> CIntRepr -> CIntRepr -> [CIntRepr]
$cenumFromThenTo :: CIntRepr -> CIntRepr -> CIntRepr -> [CIntRepr]
enumFromTo :: CIntRepr -> CIntRepr -> [CIntRepr]
$cenumFromTo :: CIntRepr -> CIntRepr -> [CIntRepr]
enumFromThen :: CIntRepr -> CIntRepr -> [CIntRepr]
$cenumFromThen :: CIntRepr -> CIntRepr -> [CIntRepr]
enumFrom :: CIntRepr -> [CIntRepr]
$cenumFrom :: CIntRepr -> [CIntRepr]
fromEnum :: CIntRepr -> Int
$cfromEnum :: CIntRepr -> Int
toEnum :: Int -> CIntRepr
$ctoEnum :: Int -> CIntRepr
pred :: CIntRepr -> CIntRepr
$cpred :: CIntRepr -> CIntRepr
succ :: CIntRepr -> CIntRepr
$csucc :: CIntRepr -> CIntRepr
Enum,CIntRepr
CIntRepr -> CIntRepr -> Bounded CIntRepr
forall a. a -> a -> Bounded a
maxBound :: CIntRepr
$cmaxBound :: CIntRepr
minBound :: CIntRepr
$cminBound :: CIntRepr
Bounded,Typeable CIntRepr
DataType
Constr
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 -> DataType
CIntRepr -> Constr
(forall b. Data b => b -> b) -> CIntRepr -> CIntRepr
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CIntRepr -> c CIntRepr
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cOctalRepr :: Constr
$cHexRepr :: Constr
$cDecRepr :: Constr
$tCIntRepr :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CIntRepr -> m CIntRepr
gmapQi :: Int -> (forall d. Data d => d -> u) -> CIntRepr -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CIntRepr -> u
gmapQ :: (forall d. Data d => d -> u) -> CIntRepr -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CIntRepr -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CIntRepr -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CIntRepr -> r
gmapT :: (forall b. Data b => b -> b) -> CIntRepr -> CIntRepr
$cgmapT :: (forall b. Data b => b -> b) -> CIntRepr -> CIntRepr
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntRepr)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntRepr)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CIntRepr)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CIntRepr)
dataTypeOf :: CIntRepr -> DataType
$cdataTypeOf :: CIntRepr -> DataType
toConstr :: CIntRepr -> Constr
$ctoConstr :: CIntRepr -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CIntRepr
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CIntRepr
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CIntRepr -> c CIntRepr
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CIntRepr -> c CIntRepr
$cp1Data :: Typeable CIntRepr
Data,Typeable,(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
$cto :: forall x. Rep CIntRepr x -> CIntRepr
$cfrom :: forall x. CIntRepr -> Rep CIntRepr x
Generic)
instance NFData CIntRepr
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
/= :: CIntFlag -> CIntFlag -> Bool
$c/= :: CIntFlag -> CIntFlag -> Bool
== :: CIntFlag -> CIntFlag -> Bool
$c== :: 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
min :: CIntFlag -> CIntFlag -> CIntFlag
$cmin :: CIntFlag -> CIntFlag -> CIntFlag
max :: CIntFlag -> CIntFlag -> CIntFlag
$cmax :: CIntFlag -> CIntFlag -> CIntFlag
>= :: CIntFlag -> CIntFlag -> Bool
$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
compare :: CIntFlag -> CIntFlag -> Ordering
$ccompare :: CIntFlag -> CIntFlag -> Ordering
$cp1Ord :: Eq 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
enumFromThenTo :: CIntFlag -> CIntFlag -> CIntFlag -> [CIntFlag]
$cenumFromThenTo :: CIntFlag -> CIntFlag -> CIntFlag -> [CIntFlag]
enumFromTo :: CIntFlag -> CIntFlag -> [CIntFlag]
$cenumFromTo :: CIntFlag -> CIntFlag -> [CIntFlag]
enumFromThen :: CIntFlag -> CIntFlag -> [CIntFlag]
$cenumFromThen :: CIntFlag -> CIntFlag -> [CIntFlag]
enumFrom :: CIntFlag -> [CIntFlag]
$cenumFrom :: CIntFlag -> [CIntFlag]
fromEnum :: CIntFlag -> Int
$cfromEnum :: CIntFlag -> Int
toEnum :: Int -> CIntFlag
$ctoEnum :: Int -> CIntFlag
pred :: CIntFlag -> CIntFlag
$cpred :: CIntFlag -> CIntFlag
succ :: CIntFlag -> CIntFlag
$csucc :: CIntFlag -> CIntFlag
Enum,CIntFlag
CIntFlag -> CIntFlag -> Bounded CIntFlag
forall a. a -> a -> Bounded a
maxBound :: CIntFlag
$cmaxBound :: CIntFlag
minBound :: CIntFlag
$cminBound :: CIntFlag
Bounded,Typeable CIntFlag
DataType
Constr
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 -> DataType
CIntFlag -> Constr
(forall b. Data b => b -> b) -> CIntFlag -> CIntFlag
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CIntFlag -> c CIntFlag
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cFlagImag :: Constr
$cFlagLongLong :: Constr
$cFlagLong :: Constr
$cFlagUnsigned :: Constr
$tCIntFlag :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CIntFlag -> m CIntFlag
gmapQi :: Int -> (forall d. Data d => d -> u) -> CIntFlag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CIntFlag -> u
gmapQ :: (forall d. Data d => d -> u) -> CIntFlag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CIntFlag -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CIntFlag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CIntFlag -> r
gmapT :: (forall b. Data b => b -> b) -> CIntFlag -> CIntFlag
$cgmapT :: (forall b. Data b => b -> b) -> CIntFlag -> CIntFlag
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntFlag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CIntFlag)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CIntFlag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CIntFlag)
dataTypeOf :: CIntFlag -> DataType
$cdataTypeOf :: CIntFlag -> DataType
toConstr :: CIntFlag -> Constr
$ctoConstr :: CIntFlag -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CIntFlag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CIntFlag
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CIntFlag -> c CIntFlag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CIntFlag -> c CIntFlag
$cp1Data :: Typeable CIntFlag
Data,Typeable,(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
$cto :: forall x. Rep CIntFlag x -> CIntFlag
$cfrom :: forall x. CIntFlag -> Rep CIntFlag x
Generic)
instance Show CIntFlag where
show :: CIntFlag -> String
show FlagUnsigned = "u"
show FlagLong = "L"
show FlagLongLong = "LL"
show FlagImag = "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)
deriving (CInteger -> CInteger -> Bool
(CInteger -> CInteger -> Bool)
-> (CInteger -> CInteger -> Bool) -> Eq CInteger
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CInteger -> CInteger -> Bool
$c/= :: CInteger -> CInteger -> Bool
== :: CInteger -> CInteger -> Bool
$c== :: 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
min :: CInteger -> CInteger -> CInteger
$cmin :: CInteger -> CInteger -> CInteger
max :: CInteger -> CInteger -> CInteger
$cmax :: CInteger -> CInteger -> CInteger
>= :: CInteger -> CInteger -> Bool
$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
compare :: CInteger -> CInteger -> Ordering
$ccompare :: CInteger -> CInteger -> Ordering
$cp1Ord :: Eq CInteger
Ord,Typeable CInteger
DataType
Constr
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 -> DataType
CInteger -> Constr
(forall b. Data b => b -> b) -> CInteger -> CInteger
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CInteger -> c CInteger
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cCInteger :: Constr
$tCInteger :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> CInteger -> m CInteger
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CInteger -> m CInteger
gmapQi :: Int -> (forall d. Data d => d -> u) -> CInteger -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CInteger -> u
gmapQ :: (forall d. Data d => d -> u) -> CInteger -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CInteger -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CInteger -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CInteger -> r
gmapT :: (forall b. Data b => b -> b) -> CInteger -> CInteger
$cgmapT :: (forall b. Data b => b -> b) -> CInteger -> CInteger
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CInteger)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CInteger)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CInteger)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CInteger)
dataTypeOf :: CInteger -> DataType
$cdataTypeOf :: CInteger -> DataType
toConstr :: CInteger -> Constr
$ctoConstr :: CInteger -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CInteger
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CInteger
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CInteger -> c CInteger
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CInteger -> c CInteger
$cp1Data :: Typeable CInteger
Data,Typeable,(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
$cto :: forall x. Rep CInteger x -> CInteger
$cfrom :: forall x. CInteger -> Rep CInteger x
Generic)
instance Show CInteger where
showsPrec :: Int -> CInteger -> ShowS
showsPrec _ (CInteger ig :: Integer
ig repr :: CIntRepr
repr flags :: 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 f :: 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 num :: a
num = case CIntRepr
repr of DecRepr -> a -> ShowS
forall a. Show a => a -> ShowS
shows a
num
OctalRepr -> String -> ShowS
showString "0" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showOct a
num
HexRepr -> String -> ShowS
showString "0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex a
num
instance NFData CInteger
readCInteger :: CIntRepr -> String -> Either String CInteger
readCInteger :: CIntRepr -> String -> Either String CInteger
readCInteger repr :: CIntRepr
repr str :: String
str =
case ReadS Integer
readNum String
str of
[(n :: Integer
n,suffix :: String
suffix)] -> Integer -> String -> Either String CInteger
mkCInt Integer
n String
suffix
parseFailed :: [(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
$ "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 DecRepr -> ReadS Integer
forall a. (Eq a, Num a) => ReadS a
readDec; HexRepr -> ReadS Integer
forall a. (Eq a, Num a) => ReadS a
readHex; OctalRepr -> ReadS Integer
forall a. (Eq a, Num a) => ReadS a
readOct
mkCInt :: Integer -> String -> Either String CInteger
mkCInt n :: Integer
n suffix :: 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 :: Flags CIntFlag
flags [] = Flags CIntFlag -> Either String (Flags CIntFlag)
forall a b. b -> Either a b
Right Flags CIntFlag
flags
parseFlags flags :: Flags CIntFlag
flags ('l':'l':fs :: 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 :: Flags CIntFlag
flags ('L':'L':fs :: 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 :: Flags CIntFlag
flags (f :: Char
f:fs :: String
fs) =
let go1 :: CIntFlag -> Either String (Flags CIntFlag)
go1 flag :: 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
'l' -> CIntFlag -> Either String (Flags CIntFlag)
go1 CIntFlag
FlagLong ; 'L' -> CIntFlag -> Either String (Flags CIntFlag)
go1 CIntFlag
FlagLong
'u' -> CIntFlag -> Either String (Flags CIntFlag)
go1 CIntFlag
FlagUnsigned ; 'U' -> CIntFlag -> Either String (Flags CIntFlag)
go1 CIntFlag
FlagUnsigned
'i' -> CIntFlag -> Either String (Flags CIntFlag)
go1 CIntFlag
FlagImag ; 'I' -> CIntFlag -> Either String (Flags CIntFlag)
go1 CIntFlag
FlagImag; 'j' -> CIntFlag -> Either String (Flags CIntFlag)
go1 CIntFlag
FlagImag; 'J' -> CIntFlag -> Either String (Flags CIntFlag)
go1 CIntFlag
FlagImag
_ -> 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
$ "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 i :: Integer
i _ _) = Integer
i
cInteger :: Integer -> CInteger
cInteger :: Integer -> CInteger
cInteger i :: Integer
i = Integer -> CIntRepr -> Flags CIntFlag -> CInteger
CInteger Integer
i CIntRepr
DecRepr Flags CIntFlag
forall f. Flags f
noFlags
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
/= :: CFloat -> CFloat -> Bool
$c/= :: CFloat -> CFloat -> Bool
== :: CFloat -> CFloat -> Bool
$c== :: 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
min :: CFloat -> CFloat -> CFloat
$cmin :: CFloat -> CFloat -> CFloat
max :: CFloat -> CFloat -> CFloat
$cmax :: CFloat -> CFloat -> CFloat
>= :: CFloat -> CFloat -> Bool
$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
compare :: CFloat -> CFloat -> Ordering
$ccompare :: CFloat -> CFloat -> Ordering
$cp1Ord :: Eq CFloat
Ord,Typeable CFloat
DataType
Constr
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 -> DataType
CFloat -> Constr
(forall b. Data b => b -> b) -> CFloat -> CFloat
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CFloat -> c CFloat
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cCFloat :: Constr
$tCFloat :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> CFloat -> m CFloat
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CFloat -> m CFloat
gmapQi :: Int -> (forall d. Data d => d -> u) -> CFloat -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CFloat -> u
gmapQ :: (forall d. Data d => d -> u) -> CFloat -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CFloat -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CFloat -> r
gmapT :: (forall b. Data b => b -> b) -> CFloat -> CFloat
$cgmapT :: (forall b. Data b => b -> b) -> CFloat -> CFloat
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CFloat)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CFloat)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CFloat)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CFloat)
dataTypeOf :: CFloat -> DataType
$cdataTypeOf :: CFloat -> DataType
toConstr :: CFloat -> Constr
$ctoConstr :: CFloat -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CFloat
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CFloat
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CFloat -> c CFloat
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CFloat -> c CFloat
$cp1Data :: Typeable CFloat
Data,Typeable,(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
$cto :: forall x. Rep CFloat x -> CFloat
$cfrom :: forall x. CFloat -> Rep CFloat x
Generic)
instance Show CFloat where
showsPrec :: Int -> CFloat -> ShowS
showsPrec _ (CFloat internal :: 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
readCFloat :: String -> CFloat
readCFloat :: String -> CFloat
readCFloat = String -> CFloat
CFloat
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
/= :: ClangCVersion -> ClangCVersion -> Bool
$c/= :: ClangCVersion -> ClangCVersion -> Bool
== :: ClangCVersion -> ClangCVersion -> Bool
$c== :: 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
min :: ClangCVersion -> ClangCVersion -> ClangCVersion
$cmin :: ClangCVersion -> ClangCVersion -> ClangCVersion
max :: ClangCVersion -> ClangCVersion -> ClangCVersion
$cmax :: ClangCVersion -> ClangCVersion -> ClangCVersion
>= :: ClangCVersion -> ClangCVersion -> Bool
$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
compare :: ClangCVersion -> ClangCVersion -> Ordering
$ccompare :: ClangCVersion -> ClangCVersion -> Ordering
$cp1Ord :: Eq ClangCVersion
Ord,Typeable ClangCVersion
DataType
Constr
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 -> DataType
ClangCVersion -> Constr
(forall b. Data b => b -> b) -> ClangCVersion -> ClangCVersion
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ClangCVersion -> c ClangCVersion
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cClangCVersion :: Constr
$tClangCVersion :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ClangCVersion -> m ClangCVersion
gmapQi :: Int -> (forall d. Data d => d -> u) -> ClangCVersion -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ClangCVersion -> u
gmapQ :: (forall d. Data d => d -> u) -> ClangCVersion -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ClangCVersion -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ClangCVersion -> r
gmapT :: (forall b. Data b => b -> b) -> ClangCVersion -> ClangCVersion
$cgmapT :: (forall b. Data b => b -> b) -> ClangCVersion -> ClangCVersion
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ClangCVersion)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ClangCVersion)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ClangCVersion)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ClangCVersion)
dataTypeOf :: ClangCVersion -> DataType
$cdataTypeOf :: ClangCVersion -> DataType
toConstr :: ClangCVersion -> Constr
$ctoConstr :: ClangCVersion -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ClangCVersion
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ClangCVersion
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ClangCVersion -> c ClangCVersion
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ClangCVersion -> c ClangCVersion
$cp1Data :: Typeable ClangCVersion
Data,Typeable)
instance Show ClangCVersion where
showsPrec :: Int -> ClangCVersion -> ShowS
showsPrec _ (ClangCVersion internal :: String
internal) = String -> ShowS
showString String
internal
readClangCVersion :: String -> ClangCVersion
readClangCVersion :: String -> ClangCVersion
readClangCVersion = String -> ClangCVersion
ClangCVersion
data CString = CString
String
Bool
deriving (CString -> CString -> Bool
(CString -> CString -> Bool)
-> (CString -> CString -> Bool) -> Eq CString
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CString -> CString -> Bool
$c/= :: CString -> CString -> Bool
== :: CString -> CString -> Bool
$c== :: 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
min :: CString -> CString -> CString
$cmin :: CString -> CString -> CString
max :: CString -> CString -> CString
$cmax :: CString -> CString -> CString
>= :: CString -> CString -> Bool
$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
compare :: CString -> CString -> Ordering
$ccompare :: CString -> CString -> Ordering
$cp1Ord :: Eq CString
Ord,Typeable CString
DataType
Constr
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 -> DataType
CString -> Constr
(forall b. Data b => b -> b) -> CString -> CString
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CString -> c CString
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c 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)
$cCString :: Constr
$tCString :: DataType
gmapMo :: (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
gmapMp :: (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
gmapM :: (forall d. Data d => d -> m d) -> CString -> m CString
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CString -> m CString
gmapQi :: Int -> (forall d. Data d => d -> u) -> CString -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CString -> u
gmapQ :: (forall d. Data d => d -> u) -> CString -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CString -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CString -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CString -> r
gmapT :: (forall b. Data b => b -> b) -> CString -> CString
$cgmapT :: (forall b. Data b => b -> b) -> CString -> CString
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CString)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CString)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CString)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CString)
dataTypeOf :: CString -> DataType
$cdataTypeOf :: CString -> DataType
toConstr :: CString -> Constr
$ctoConstr :: CString -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CString
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CString
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CString -> c CString
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CString -> c CString
$cp1Data :: Typeable CString
Data,Typeable, (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
$cto :: forall x. Rep CString x -> CString
$cfrom :: forall x. CString -> Rep CString x
Generic)
instance Show CString where
showsPrec :: Int -> CString -> ShowS
showsPrec _ (CString str :: String
str wideflag :: 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
cString :: String -> CString
cString :: String -> CString
cString str :: String
str = String -> Bool -> CString
CString String
str Bool
False
cString_w :: String -> CString
cString_w :: String -> CString
cString_w str :: String
str = String -> Bool -> CString
CString String
str Bool
True
getCString :: CString -> String
getCString :: CString -> String
getCString (CString str :: String
str _) = String
str
isWideString :: CString -> Bool
isWideString :: CString -> Bool
isWideString (CString _ wideflag :: Bool
wideflag) = Bool
wideflag
concatCStrings :: [CString] -> CString
concatCStrings :: [CString] -> CString
concatCStrings cs :: [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)
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 c :: Char
c | Char -> Bool
isSChar Char
c = Char -> String
forall (m :: * -> *) a. Monad m => a -> m a
return Char
c
| Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== '"' = "\\\""
| Bool
otherwise = Char -> String
escapeChar Char
c
isAsciiSourceChar :: Char -> Bool
isAsciiSourceChar :: Char -> Bool
isAsciiSourceChar c :: Char
c = Char -> Bool
isAscii Char
c Bool -> Bool -> Bool
&& Char -> Bool
isPrint Char
c
isCChar :: Char -> Bool
isCChar :: Char -> Bool
isCChar '\\' = Bool
False
isCChar '\'' = Bool
False
isCChar '\n' = Bool
False
isCChar c :: Char
c = Char -> Bool
isAsciiSourceChar Char
c
escapeCChar :: Char -> String
escapeCChar :: Char -> String
escapeCChar '\'' = "\\'"
escapeCChar c :: Char
c | Char -> Bool
isCChar Char
c = [Char
c]
| Bool
otherwise = Char -> String
escapeChar Char
c
isSChar :: Char -> Bool
isSChar :: Char -> Bool
isSChar '\\' = Bool
False
isSChar '\"' = Bool
False
isSChar '\n' = Bool
False
isSChar c :: Char
c = Char -> Bool
isAsciiSourceChar Char
c
showOct' :: Int -> String
showOct' :: Int -> String
showOct' i :: Int
i = Int -> Char -> String
forall a. Int -> a -> [a]
replicate (3 Int -> Int -> Int
forall a. Num a => a -> a -> a
- String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
s) '0' String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
where s :: String
s = Int -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showOct Int
i ""
escapeChar :: Char -> String
escapeChar :: Char -> String
escapeChar '\\' = "\\\\"
escapeChar '\a' = "\\a"
escapeChar '\b' = "\\b"
escapeChar '\f' = "\\f"
escapeChar '\n' = "\\n"
escapeChar '\r' = "\\r"
escapeChar '\t' = "\\t"
escapeChar '\v' = "\\v"
escapeChar c :: Char
c | (Char -> Int
ord Char
c) Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< 512 = '\\' Char -> ShowS
forall a. a -> [a] -> [a]
: Int -> String
showOct' (Char -> Int
ord Char
c)
| Bool
otherwise = '\\' Char -> ShowS
forall a. a -> [a] -> [a]
: 'x' Char -> ShowS
forall a. a -> [a] -> [a]
: Int -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex (Char -> Int
ord Char
c) ""
unescapeChar :: String -> (Char, String)
unescapeChar :: String -> (Char, String)
unescapeChar ('\\':c :: Char
c:cs :: String
cs) = case Char
c of
'n' -> ('\n', String
cs)
't' -> ('\t', String
cs)
'v' -> ('\v', String
cs)
'b' -> ('\b', String
cs)
'r' -> ('\r', String
cs)
'f' -> ('\f', String
cs)
'a' -> ('\a', String
cs)
'e' -> ('\ESC', String
cs)
'E' -> ('\ESC', String
cs)
'\\' -> ('\\', String
cs)
'?' -> ('?', String
cs)
'\'' -> ('\'', String
cs)
'"' -> ('"', String
cs)
'x' -> case String -> [(Int, String)] -> (Int, String)
forall a. String -> [a] -> a
head' "bad escape sequence" (ReadS Int
forall a. (Eq a, Num a) => ReadS a
readHex String
cs) of
(i :: Int
i, cs' :: String
cs') -> (Int -> Char
forall a. Enum a => Int -> a
toEnum Int
i, String
cs')
_ -> case String -> [(Int, String)] -> (Int, String)
forall a. String -> [a] -> a
head' "bad escape sequence" (ReadS Int
readOct' (Char
cChar -> ShowS
forall a. a -> [a] -> [a]
:String
cs)) of
(i :: Int
i, cs' :: String
cs') -> (Int -> Char
forall a. Enum a => Int -> a
toEnum Int
i, String
cs')
unescapeChar (c :: Char
c :cs :: 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
$ "unescape char: empty string"
readOct' :: ReadS Int
readOct' :: ReadS Int
readOct' s :: String
s = ((Int, String) -> (Int, String))
-> [(Int, String)] -> [(Int, String)]
forall a b. (a -> b) -> [a] -> [b]
map (\(i :: Int
i, cs :: 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 3 String
s
rest :: String
rest = Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
octStr) String
s
unescapeString :: String -> String
unescapeString :: ShowS
unescapeString [] = []
unescapeString cs :: String
cs = case String -> (Char, String)
unescapeChar String
cs of
(c :: Char
c, cs' :: String
cs') -> Char
c Char -> ShowS
forall a. a -> [a] -> [a]
: ShowS
unescapeString String
cs'
sQuote :: String -> ShowS
sQuote :: String -> ShowS
sQuote s :: String
s t :: String
t = "'" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s String -> ShowS
forall a. [a] -> [a] -> [a]
++ "'" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
t
dQuote :: String -> ShowS
dQuote :: String -> ShowS
dQuote s :: String
s t :: String
t = ('"' Char -> ShowS
forall a. a -> [a] -> [a]
: String
s) String -> ShowS
forall a. [a] -> [a] -> [a]
++ "\"" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
t
head' :: String -> [a] -> a
head' :: String -> [a] -> a
head' err :: String
err [] = String -> a
forall a. HasCallStack => String -> a
error String
err
head' _ (x :: a
x:_) = a
x
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
/= :: 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
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
min :: Flags f -> Flags f -> Flags f
$cmin :: forall f. Flags f -> Flags f -> Flags f
max :: Flags f -> Flags f -> Flags f
$cmax :: forall f. Flags f -> Flags f -> Flags f
>= :: 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
$c< :: forall f. Flags f -> Flags f -> Bool
compare :: Flags f -> Flags f -> Ordering
$ccompare :: forall f. Flags f -> Flags f -> Ordering
$cp1Ord :: forall f. Eq (Flags f)
Ord,Typeable (Flags f)
DataType
Constr
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 -> DataType
Flags f -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Flags f))
(forall b. Data b => b -> b) -> Flags f -> Flags f
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Flags f -> c (Flags f)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Flags f)
forall f. Data f => Typeable (Flags f)
forall f. Data f => Flags f -> DataType
forall f. Data f => Flags f -> Constr
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))
$cFlags :: Constr
$tFlags :: DataType
gmapMo :: (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)
gmapMp :: (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)
gmapM :: (forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
$cgmapM :: forall f (m :: * -> *).
(Data f, Monad m) =>
(forall d. Data d => d -> m d) -> Flags f -> m (Flags f)
gmapQi :: Int -> (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
gmapQ :: (forall d. Data d => d -> u) -> Flags f -> [u]
$cgmapQ :: forall f u.
Data f =>
(forall d. Data d => d -> u) -> Flags f -> [u]
gmapQr :: (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
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Flags f -> r
$cgmapQl :: forall f r r'.
Data f =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Flags f -> r
gmapT :: (forall b. Data b => b -> b) -> Flags f -> Flags f
$cgmapT :: forall f.
Data f =>
(forall b. Data b => b -> b) -> Flags f -> Flags f
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> 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))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Flags f))
$cdataCast1 :: forall f (t :: * -> *) (c :: * -> *).
(Data f, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Flags f))
dataTypeOf :: Flags f -> DataType
$cdataTypeOf :: forall f. Data f => Flags f -> DataType
toConstr :: Flags f -> Constr
$ctoConstr :: forall f. Data f => Flags f -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> 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)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Flags f -> 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)
$cp1Data :: forall f. Data f => Typeable (Flags f)
Data,Typeable,(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
$cto :: forall f x. Rep (Flags f) x -> Flags f
$cfrom :: forall f x. Flags f -> Rep (Flags f) x
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
$cto1 :: forall a. Rep1 Flags a -> Flags a
$cfrom1 :: forall a. Flags a -> Rep1 Flags a
Generic1)
instance NFData (Flags f)
noFlags :: Flags f
noFlags :: Flags f
noFlags = Integer -> Flags f
forall f. Integer -> Flags f
Flags 0
setFlag :: (Enum f) => f -> Flags f -> Flags f
setFlag :: f -> Flags f -> Flags f
setFlag flag :: f
flag (Flags k :: 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 :: f -> Flags f -> Flags f
clearFlag flag :: f
flag (Flags k :: 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 :: f -> Flags f -> Bool
testFlag flag :: f
flag (Flags k :: 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