th-typegraph-0.17: Graph of the subtype relation

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.TypeGraph.Monad

Description

Operations using MonadReader (TypeGraphInfo hint).

Synopsis

Documentation

fieldVertices :: MonadReader (TypeGraphInfo hint) m => TypeGraphVertex -> m (Set TypeGraphVertex) Source

Build 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.

vertex :: forall m hint. (DsMonad m, MonadReader (TypeGraphInfo hint) m) => Maybe Field -> E Type -> m TypeGraphVertex Source

Build a vertex from the given Type and optional Field.

typeVertex :: MonadReader (TypeGraphInfo hint) m => E Type -> m TypeGraphVertex Source

Build a non-field vertex

fieldVertex :: MonadReader (TypeGraphInfo hint) m => E Type -> Field -> m TypeGraphVertex Source

Build a vertex associated with a field

typeGraphEdges :: forall m hint. (DsMonad m, Default hint, Eq hint, HasVertexHints hint, MonadReader (TypeGraphInfo hint) m) => m (GraphEdges hint TypeGraphVertex) Source

Start with the type graph on the known types, and build a new graph which incorporates the information from the hints.

simpleEdges :: GraphEdges hint TypeGraphVertex -> GraphEdges hint TypeGraphVertex Source

Simplify a graph by throwing away the field information in each node. This means the nodes only contain the fully expanded Type value (and any type synonyms.)