Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Name
- type TypeEnv = [TypeDef]
- data Type
- data Con = Con {}
- data TypeDef = TypeDef {}
- apply :: Name -> [Type] -> Type
- unapply :: Type -> (Name, [Type])
- typeName :: TypeDef -> Name
- typeArgs :: TypeDef -> [Type]
- flatten :: Type -> [Name]
- subtype :: Type -> Type -> Bool
- occurrences :: Type -> Con -> Int
- countSat :: (a -> Bool) -> [a] -> Int
- typeSigs :: TypeEnv -> [Type]
- consList :: TypeEnv -> [Name]
- involvedWith :: TypeDef -> [Type]
- getCon :: Name -> TypeDef -> Con
- conType :: TypeEnv -> Name -> TypeDef
- getSiblings :: Name -> TypeEnv -> [Con]
- isSibling :: TypeEnv -> Name -> Name -> Bool
- splitCons :: TypeEnv -> ([Con], [Con])
- getRecursives :: TypeEnv -> [Con]
- getTerminals :: TypeEnv -> [Con]
- isTerminal :: TypeEnv -> Name -> Bool
Documentation
An abstract type representing names in the syntax tree.
Name
s can be constructed in several ways, which come with different
name-capture guarantees (see Language.Haskell.TH.Syntax for
an explanation of name capture):
- the built-in syntax
'f
and''T
can be used to construct names, The expression'f
gives aName
which refers to the valuef
currently in scope, and''T
gives aName
which refers to the typeT
currently in scope. These names can never be captured. lookupValueName
andlookupTypeName
are similar to'f
and''T
respectively, but theName
s are looked up at the point where the current splice is being run. These names can never be captured.newName
monadically generates a new name, which can never be captured.mkName
generates a capturable name.
Names constructed using newName
and mkName
may be used in bindings
(such as let x = ...
or x -> ...
), but names constructed using
lookupValueName
, lookupTypeName
, 'f
, ''T
may not.
Instances
Eq Name | |
Data Name | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name # dataTypeOf :: Name -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Name) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) # gmapT :: (forall b. Data b => b -> b) -> Name -> Name # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # | |
Ord Name | |
Show Name | |
Generic Name | |
Ppr Name | |
type Rep Name | |
Defined in Language.Haskell.TH.Syntax type Rep Name = D1 (MetaData "Name" "Language.Haskell.TH.Syntax" "template-haskell" False) (C1 (MetaCons "Name" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 OccName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NameFlavour))) |
Base Name | A base type name (e.g. Int, Maybe, Either) |
Var Name | A type variable (e.g. a, b) |
App Type Type | A type application (e.g. T U) |
involvedWith :: TypeDef -> [Type] Source #
getRecursives :: TypeEnv -> [Con] Source #
getTerminals :: TypeEnv -> [Con] Source #