th-typegraph-0.32: Graph of the subtype relation

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.TypeGraph.Shape

Contents

Description

A fold on the shape of the constructors of a DataD or NewtypeD record.

Synopsis

Field name and position

Decl shape

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.