template-haskell-2.4.0.0

Portabilityportable
Stabilityexperimental
Maintainerlibraries@haskell.org

Language.Haskell.TH.Syntax

Description

Abstract syntax definitions for Template Haskell.

Synopsis

Documentation

class (Monad m, Functor m) => Quasi m whereSource

Methods

qNewName :: String -> m Name Source

qReport :: Bool -> String -> m () Source

qRecover :: m a -> m a -> m aSource

qReify :: Name -> m Info Source

qLocation :: m Loc Source

qRunIO :: IO a -> m aSource

Instances

class Lift t whereSource

Methods

lift :: t -> Q Exp Source

Instances

Lift a => Lift [a]
Lift a => Lift (Maybe 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)

liftString :: String -> Q Exp Source

data Q a Source

Instances

runQ :: Quasi m => Q a -> m aSource

report :: Bool -> String -> Q () Source

recover :: Q a -> Q a -> Q aSource

reify :: Name -> Q Info Source

reify looks up information about the Name

location :: Q Loc Source

location gives you the Location at which this computation is spliced.

runIO :: IO a -> Q aSource

The runIO function lets you run an I/O computation in the Q monad. Take care: you are guaranteed the ordering of calls to runIO within a single Q computation, but not about the order in which splices are run.

Note: for various murky reasons, stdout and stderr handles are not necesarily flushed when the compiler finishes running, so you should flush them yourself.

data Name Source

Constructors

Instances

mkName :: String -> Name Source

newName :: String -> Q Name Source

nameBase :: Name -> String Source

nameModule :: Name -> Maybe String Source

showName :: Name -> String Source

showName' :: NameIs -> Name -> String Source

data NameIs Source

Constructors

data Dec Source

Constructors

Instances

data Exp Source

The CompE constructor represents a list comprehension, and takes a [Stmt ]. The result expression of the comprehension is the *last* of these, and should be a NoBindS . E.g. [ f x | x <- xs ] is represented by CompE [BindS (VarP x) (VarE xs), NoBindS (AppE (VarE f) (VarE x))]

Constructors

TupE [Exp]
DoE [Stmt]

Instances

data Con Source

Constructors

Instances

data Type Source

Constructors

Instances

data TyVarBndr Source

Constructors

Instances

data Kind Source

Constructors

Instances

type Cxt = [Pred]Source

data Pred Source

Constructors

Instances

data Match Source

Constructors

Instances

data Clause Source

Constructors

Instances

data Body Source

Constructors

Instances

data Guard Source

Constructors

Instances

data Stmt Source

Constructors

LetS [Dec]
ParS [[Stmt]]

Instances

data Range Source

Constructors

Instances

data Lit Source

Constructors

Instances

data Pat Source

Constructors

TupP [Pat]

Instances

type FieldExp = (Name, Exp)Source

type FieldPat = (Name, Pat)Source

data Strict Source

Constructors

Instances

data Foreign Source

Constructors

Instances

data Callconv Source

Constructors

Instances

data Safety Source

Constructors

Instances

data Pragma Source

Constructors

Instances

data InlineSpec Source

Constructors

Instances

type StrictType = (Strict, Type)Source

type VarStrictType = (Name, Strict, Type)Source

data FunDep Source

Constructors

Instances

data FamFlavour Source

Constructors

Instances

data Info Source

Constructors

Instances

data Loc Source

Constructors

Loc

type CharPos = (Int, Int)Source

data Fixity Source

Constructors

Instances

data FixityDirection Source

Constructors

Instances

defaultFixity :: Fixity Source

maxPrecedence :: Int Source

returnQ :: a -> Q aSource

bindQ :: Q a -> (a -> Q b) -> Q bSource

sequenceQ :: [Q a] -> Q [a]Source

data NameFlavour Source

Constructors

Instances

data NameSpace Source

Constructors

Instances

mkNameG_v :: String -> String -> String -> Name Source

mkNameG_d :: String -> String -> String -> Name Source

mkNameG_tc :: String -> String -> String -> Name Source

type Uniq = Int Source

mkNameL :: String -> Uniq -> Name Source

mkNameU :: String -> Uniq -> Name Source

tupleTypeName :: Int -> Name Source

tupleDataName :: Int -> Name Source

data OccName Source

Instances

mkOccName :: String -> OccName Source

occString :: OccName -> String Source

data ModName Source

Instances

mkModName :: String -> ModName Source

modString :: ModName -> String Source

data PkgName Source

Instances

mkPkgName :: String -> PkgName Source

pkgString :: PkgName -> String Source

AltStyle によって変換されたページ (->オリジナル) /