data-reify-0.6.4: Reify a recursive data structure into an explicit graph.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Reify

Synopsis

- class MuRef a where
  - type DeRef a :: Type -> Type
  - mapDeRef :: Applicative f => (forall b. (MuRef b, DeRef a ~ DeRef b) => b -> f u) -> a -> f (DeRef a u)
- module Data.Reify.Graph
- reifyGraph :: MuRef s => s -> IO (Graph (DeRef s))
- reifyGraphs :: (MuRef s, Traversable t) => t s -> IO (t (Graph (DeRef s)))

# Documentation

class MuRef a 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 Source #

Methods

mapDeRef :: Applicative f => (forall b. (MuRef b, DeRef a ~ DeRef b) => b -> f u) -> a -> f (DeRef a u) Source #

module Data.Reify.Graph

reifyGraph :: MuRef s => s -> IO (Graph (DeRef s)) Source #

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

reifyGraphs :: (MuRef s, Traversable t) => t s -> IO (t (Graph (DeRef s))) 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.