TypeMachine.Type
data Type Source #
Data structure to easily manipulate Template Haskell's DataD
DataD
Constructors
Fields
Name of the data type
Fields of the data type
Type parameter of the ADT
Defined in TypeMachine.Type
Methods
showsPrec :: Int -> Type -> ShowS #
show :: Type -> String #
showList :: [Type] -> ShowS #
(==) :: Type -> Type -> Bool #
(/=) :: Type -> Type -> Bool #
getField :: String -> Type -> Maybe (Bang, Type) Source #
hasField :: String -> Type -> Bool Source #
typeToDec :: Type -> Dec Source #
Turns a Type back to a Template Haskell Dec
Type
Dec
decToType :: Quasi m => Dec -> m Type Source #
Transform a Template Haskell Dec into a TypeMachine's type
For this to succeed, the input type must have exactly one record constructor
reifyType :: Name -> Q Type Source #
Wrapper around the TH's reify function. Fails if the type is not a datatype declaration
reify