Safe Haskell | None |
---|---|
Language | Haskell2010 |
Helper functions for dealing with record fields, type shape, type arity, primitive types, and pretty printing.
- unReify :: Data a => a -> a
- unReifyName :: Name -> Name
- data FieldType = FieldType {}
- type Field = (Name, Name, Either Int Name)
- fName :: FieldType -> Maybe Name
- fType :: FieldType -> Type
- constructorFields :: Con -> [FieldType]
- foldShape :: Monad m => ([(Con, [FieldType])] -> m r) -> (Con -> [FieldType] -> m r) -> ([Con] -> m r) -> (Con -> FieldType -> m r) -> [Con] -> m r
- constructorName :: Con -> Name
- typeArity :: Quasi m => Type -> m Int
- pprint' :: Ppr a => a -> [Char]
Documentation
unReifyName :: Name -> Name Source
Declaration shape
constructorFields :: Con -> [FieldType] Source
foldShape :: Monad m => ([(Con, [FieldType])] -> m r) -> (Con -> [FieldType] -> m r) -> ([Con] -> m r) -> (Con -> FieldType -> m r) -> [Con] -> m r Source
Given the list of constructors from a Dec, dispatch on the different levels of complexity of the type they represent - a wrapper is a single arity one constructor, an enum is several arity zero constructors, and so on.
Constructor deconstructors
constructorName :: Con -> Name Source
Queries
typeArity :: Quasi m => Type -> m Int Source
Compute the arity of a type - the number of type parameters that must be applied to it in order to obtain a concrete type.