Safe Haskell | None |
---|---|
Language | Haskell2010 |
- appExp :: [ExpQ] -> ExpQ
- appExp' :: [Exp] -> Exp
- appConT :: [TypeQ] -> TypeQ
- appConT' :: [Type] -> Type
- curryType :: [TypeQ] -> TypeQ
- curryType' :: [Type] -> Type
- genBT :: String -> Int -> Q ([TyVarBndr], [TypeQ])
- genBT' :: String -> Int -> ([TyVarBndr], [Type])
- genPE :: String -> Int -> Q ([PatQ], [ExpQ])
- genPE' :: String -> Int -> ([Pat], [Exp])
- appKinds :: [Kind] -> Kind
- curryKind :: [Kind] -> Kind
- getTypeNames :: Type -> [Name]
- getTVBName :: TyVarBndr -> Name
- getCompositeType :: Con -> [Name]
Documentation
curryType :: [TypeQ] -> TypeQ Source
> pprint $ appConT' (map ConT [''(,), ''Int , ''Bool]) "GHC.Tuple.(,) GHC.Types.Int GHC.Types.Bool"
|
convert [a, b, c] to a -> b -> c
curryType' :: [Type] -> Type Source
genBT :: String -> Int -> Q ([TyVarBndr], [TypeQ]) Source
> pprint $ curryType' (map ConT [''Int , ''Int , ''Bool]) "GHC.Types.Int -> GHC.Types.Int -> GHC.Types.Bool"
|
Generate a list of type Bind and Type
genPE :: String -> Int -> Q ([PatQ], [ExpQ]) Source
> genBT' "a" 3 ([PlainTV a1,PlainTV a2,PlainTV a3],[VarT a1,VarT a2,VarT a3])
|
Pattern and expression
appKinds :: [Kind] -> Kind Source
> genPE' "a" 3 ([VarP a1,VarP a2,VarP a3],[VarE a1,VarE a2,VarE a3])
|
Apply a list of kinds
getTypeNames :: Type -> [Name] Source
get type Names recursively
getTVBName :: TyVarBndr -> Name Source
get type var bind name
getCompositeType :: Con -> [Name] Source
get all names recursively from a constructor