th-typegraph-0.32: Graph of the subtype relation

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.TypeGraph.TypeInfo

Contents

Synopsis

Type and builders

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

Build a TypeInfo value by scanning the supplied types

Update

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

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

Build a non-field vertex

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

Build a vertex associated with a field

Query

fieldVertices :: MonadReaders 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.