th-typegraph-0.24: Graph of the subtype relation

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.TypeGraph.TypeInfo

Contents

Synopsis

Type and builders

data TypeInfo Source

Information collected about the graph implied by the structure of one or more Type values.

makeTypeInfo :: forall m. DsMonad m => (Type -> m (Set Type)) -> [Type] -> m TypeInfo Source

Build a TypeInfo value by scanning the supplied types

Update

typeVertex :: MonadReader TypeInfo m => E Type -> m TGVSimple Source

Build a vertex from the given Type and optional Field. vertex :: forall m. (DsMonad m, MonadReader TypeInfo m) => Maybe Field -> E Type -> m TypeGraphVertex vertex fld etyp = maybe (typeVertex etyp) (fieldVertex etyp) fld

Build a non-field vertex

fieldVertex :: MonadReader TypeInfo m => Field -> E Type -> m TGV Source

Build a vertex associated with a field

Query

fieldVertices :: MonadReader TypeInfo m => TGVSimple -> m (Set TGV) Source

Find the vertices that involve a particular type - if the field is specified it return s singleton, otherwise it returns a set containing a vertex one for the type on its own, and one for each field containing that type.