th-typegraph-0.35.1: 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

data FieldType Source #

Instances

Eq FieldType Source # 
Data FieldType Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FieldType -> c FieldType #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FieldType #

toConstr :: FieldType -> Constr #

dataTypeOf :: FieldType -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c FieldType) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FieldType) #

gmapT :: (forall b. Data b => b -> b) -> FieldType -> FieldType #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FieldType -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FieldType -> r #

gmapQ :: (forall d. Data d => d -> u) -> FieldType -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FieldType -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FieldType -> m FieldType #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldType -> m FieldType #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldType -> m FieldType #

Ord FieldType Source # 
Show FieldType Source # 
Ppr FieldType Source # 

Methods

ppr :: FieldType -> Doc #

ppr_list :: [FieldType] -> Doc #

constructorPat :: Con -> PatQ Source #

Build a pattern that will match only values with the given constructor.

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.

Orphan instances

Ppr Field Source # 

Methods

ppr :: Field -> Doc #

ppr_list :: [Field] -> Doc #

Ppr (Maybe Field, Type) Source # 

Methods

ppr :: (Maybe Field, Type) -> Doc #

ppr_list :: [(Maybe Field, Type)] -> Doc #

Ppr (Maybe Field, E Type) Source # 

Methods

ppr :: (Maybe Field, E Type) -> Doc #

ppr_list :: [(Maybe Field, E Type)] -> Doc #