Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- intIs64 :: Bool
- replace :: (a -> Maybe a) -> a -> a
- composeExprs :: [ExpQ] -> ExpQ
- nameOfCon :: Con -> Name
- argTypesOfCon :: Con -> [Type]
- nameOfBinder :: TyVarBndr_ a -> Name
- varsBoundInCon :: Con -> [TyVarBndrSpec]
- namesBoundInPat :: Pat -> [Name]
- namesBoundInDec :: Dec -> [Name]
- genericalizeName :: Name -> Name
- genericalizeDecs :: [Dec] -> [Dec]
- headOfType :: Type -> Name
- occursInType :: Name -> Type -> Bool
- substVarsWith :: [Name] -> Type -> Type -> Type
- kindArity :: Kind -> Int
- tyConArity :: Name -> Q Int
- tyConArity' :: Name -> Q ([TyVarBndrUnit], Int)
- decCons :: Dec -> [Con]
- conArity :: Con -> Int
Documentation
composeExprs :: [ExpQ] -> ExpQ Source #
nameOfCon :: Con -> Name Source #
Determines the name of a data constructor. It's an error if the Con
binds more than one name (which
happens in the case where you use GADT syntax, and give multiple data constructor names separated by commas
in a type signature in the where clause).
argTypesOfCon :: Con -> [Type] Source #
WARNING: discards binders in GADTs and existentially-quantified constructors
nameOfBinder :: TyVarBndr_ a -> Name Source #
varsBoundInCon :: Con -> [TyVarBndrSpec] Source #
namesBoundInPat :: Pat -> [Name] Source #
namesBoundInDec :: Dec -> [Name] Source #
genericalizeName :: Name -> Name Source #
genericalizeDecs :: [Dec] -> [Dec] Source #
headOfType :: Type -> Name Source #
substVarsWith :: [Name] -> Type -> Type -> Type Source #
Assuming that we're building an instance of the form C (T v_1 ... v_(n-1)) for some GADT T, this function takes a list of the variables v_1 ... v_(n-1) used in the instance head, as well as the result type of some data constructor, say T x_1 ... x_(n-1) x_n, as well as the type t of some argument to it, and substitutes any of x_i (1 <= i <= n-1) occurring in t for the corresponding v_i, taking care to avoid name capture by foralls in t.
tyConArity' :: Name -> Q ([TyVarBndrUnit], Int) Source #
Given the name of a type constructor, determine a list of type variables bound as parameters by
its declaration, and the arity of the kind of type being defined (i.e. how many more arguments would
need to be supplied in addition to the bound parameters in order to obtain an ordinary type of kind *).
If the supplied Name
is anything other than a data or newtype, produces an error.