data-reify-gadt-0.1.0.0: Data.Reify for GADTs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Reify.GADT

Synopsis

Documentation

class MuRef (a :: Type -> Type) where Source #

MuRef is a class that provided a way to reference into a specific type, and a way to map over the deferenced internals.

Associated Types

type DeRef (a :: Type -> Type) :: (Type -> Type) -> Type -> Type Source #

type E (a :: Type -> Type) :: Type -> Type Source #

Methods

mapDeRef :: (Applicative f, e ~ E a) => (forall t'. MuRef e => e t' -> f (u t')) -> a t -> f (DeRef a u t) Source #

reifyGraph :: (MuRef s, E (E s) ~ E s, DeRef (E s) ~ DeRef s) => s a -> IO (Graph (DeRef s) a) Source #

reifyGraph takes a data structure that admits MuRef, and returns a Graph that contains the dereferenced nodes, with their children as Uniques rather than recursive values.

reifyGraphs :: (MuRef s, E (E s) ~ E s, DeRef (E s) ~ DeRef s, Traversable t) => t (s e) -> IO (t (Graph (DeRef s) e)) Source #

reifyGraphs takes a Traversable container 't s' of a data structure s admitting MuRef, and returns a 't (Graph (DeRef s))' with the graph nodes resolved within the same context.

This allows for, e.g., a list of mutually recursive structures.