Safe Haskell | None |
---|---|
Language | Haskell98 |
Contains things needed by BNFC-meta language definitions and by the code generated from those. Typical users don't need to browse this module.
- data HappyStk a :: * -> * = HappyStk a (HappyStk a)
- utf8Encode :: Char -> [Word8]
- data Posn = Pn !Int !Int !Int
- type AlexInput = (Posn, Char, [Word8], String)
- alexGetByte :: AlexInput -> Maybe (Word8, AlexInput)
- ord :: Char -> Int
- listArray :: Ix i => (i, i) -> [e] -> Array i e
- (!) :: Ix i => Array i e -> i -> e
- data Array i e :: * -> * -> *
- printTree :: Print a => a -> String
- doc :: ShowS -> Doc
- concatD :: [Doc] -> Doc
- class Print a where
- prPrec :: Int -> Int -> Doc -> Doc
- newtype PrintPlain = MkPrintPlain String
- parseToQuoter :: (String -> ParseMonad BNFC_QQType) -> QuasiQuoter
- parseToMonQuoter :: (String -> ParseMonad BNFC_QQType) -> QuasiQuoter
- data ParseMonad a
- errq :: (String -> a) -> ParseMonad a -> Q a
- data Q a :: * -> *
- data BNFC_QQType
- appEPAll :: LocType -> String -> [BNFC_QQType] -> BNFC_QQType
- appEPAllL :: LocType -> [BNFC_QQType] -> BNFC_QQType
- fromString :: Literal a => LocType -> a -> BNFC_QQType
- fromLit :: Literal a => LocType -> a -> BNFC_QQType
- fromToken :: Literal a => LocType -> String -> a -> BNFC_QQType
- fromPositionToken :: LocType -> String -> ((Int, Int), String) -> BNFC_QQType
- class Lift t where
- type LocType = (String, String)
- class Literal a where
- class IsChar a where
- printAq :: Print a => a -> BNFC_QQType
- stringAq :: String -> BNFC_QQType
Happy and Alex
utf8Encode :: Char -> [Word8] Source #
listArray :: Ix i => (i, i) -> [e] -> Array i e #
Construct an array from a pair of bounds and a list of values in index order.
data Array i e :: * -> * -> * #
The type of immutable non-strict (boxed) arrays
with indices in i
and elements in e
.
Pretty printing
Print Char Source # | |
Print Double Source # | |
Print Integer Source # | |
Print PrintPlain Source # | |
Print Ident Source # | |
Print Reg Source # | |
Print MinimumSize Source # | |
Print Exp Source # | |
Print Arg Source # | |
Print HsTyp Source # | |
Print MIdent Source # | |
Print Label Source # | |
Print Cat Source # | |
Print Item Source # | |
Print RHS Source # | |
Print Def Source # | |
Print Grammar Source # | |
Print a => Print [a] Source # | |
Quasi quoting
parseToQuoter :: (String -> ParseMonad BNFC_QQType) -> QuasiQuoter Source #
parseToMonQuoter :: (String -> ParseMonad BNFC_QQType) -> QuasiQuoter Source #
data ParseMonad a Source #
Monad ParseMonad Source # | |
Functor ParseMonad Source # | |
Applicative ParseMonad Source # | |
Eq a => Eq (ParseMonad a) Source # | |
Ord a => Ord (ParseMonad a) Source # | |
Read a => Read (ParseMonad a) Source # | |
Show a => Show (ParseMonad a) Source # | |
data BNFC_QQType Source #
appEPAll :: LocType -> String -> [BNFC_QQType] -> BNFC_QQType Source #
appEPAllL :: LocType -> [BNFC_QQType] -> BNFC_QQType Source #
fromString :: Literal a => LocType -> a -> BNFC_QQType Source #
fromPositionToken :: LocType -> String -> ((Int, Int), String) -> BNFC_QQType Source #
A Lift
instance can have any of its values turned into a Template
Haskell expression. This is needed when a value used within a Template
Haskell quotation is bound outside the Oxford brackets ([| ... |]
) but not
at the top level. As an example:
add1 :: Int -> Q Exp add1 x = [| x + 1 |]
Template Haskell has no way of knowing what value x
will take on at
splice-time, so it requires the type of x
to be an instance of Lift
.
Lift
instances can be derived automatically by use of the -XDeriveLift
GHC language extension:
{-# LANGUAGE DeriveLift #-} module Foo where import Language.Haskell.TH.Syntax data Bar a = Bar1 a (Bar a) | Bar2 String deriving Lift
Lift Bool | |
Lift Char | |
Lift Double | |
Lift Float | |
Lift Int | |
Lift Int8 | |
Lift Int16 | |
Lift Int32 | |
Lift Int64 | |
Lift Integer | |
Lift Word | |
Lift Word8 | |
Lift Word16 | |
Lift Word32 | |
Lift Word64 | |
Lift () | |
Lift Natural | |
Lift a => Lift [a] | |
Lift a => Lift (Maybe a) | |
Integral a => Lift (Ratio a) | |
(Lift a, Lift b) => Lift (Either a b) | |
(Lift a, Lift b) => Lift (a, b) | |
(Lift a, Lift b, Lift c) => Lift (a, b, c) | |
(Lift a, Lift b, Lift c, Lift d) => Lift (a, b, c, d) | |
(Lift a, Lift b, Lift c, Lift d, Lift e) => Lift (a, b, c, d, e) | |
(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift (a, b, c, d, e, f) | |
(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift (a, b, c, d, e, f, g) | |
Helper functions for defining Anti-quotation
printAq :: Print a => a -> BNFC_QQType Source #
stringAq :: String -> BNFC_QQType Source #