template-haskell-util-0.1.0.0: Some utilities for template Haskell.

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.Utils

Synopsis

Documentation

appExp :: [ExpQ] -> ExpQ Source

Apply a list of expression [(+), 1, 2] to (+) 1 2

appConT :: [TypeQ] -> TypeQ Source

Apply a type constructor, convert [a, b, c] to a b c

curryType :: [TypeQ] -> TypeQ Source

convert [a, b, c] to a -> b -> c

genBT :: String -> Int -> Q ([TyVarBndr], [TypeQ]) Source

Bind and Type

genPE :: String -> Int -> Q ([PatQ], [ExpQ]) Source

Pattern and expression

appKinds :: [Kind] -> Kind Source

Apply a list of kinds

curryKind :: [Kind] -> Kind Source

k1,k2,k3
to k1 -> k2 -> k3

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