| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
TypeInfo
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.
Names 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
'fand''Tcan be used to construct names, The expression'fgives aNamewhich refers to the valuefcurrently in scope, and''Tgives aNamewhich refers to the typeTcurrently in scope. These names can never be captured. lookupValueNameandlookupTypeNameare similar to'fand''Trespectively, but theNames are looked up at the point where the current splice is being run. These names can never be captured.newNamemonadically generates a new name, which can never be captured.mkNamegenerates 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 Methods 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))) | |
Constructors
| 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) |
Constructors
| Con | |
Constructors
| TypeDef | |
involvedWith :: TypeDef -> [Type] Source #
getRecursives :: TypeEnv -> [Con] Source #
getTerminals :: TypeEnv -> [Con] Source #