metamorphic-0.1.2.3: metamorphisms: ana . cata or understanding folds and unfolds

Portabilityportable
Stabilityexperimental
MaintainerDrew Day <drewday@gmail.com>
Safe HaskellSafe-Infered

Graph

Description

Code adapted from: http://web.engr.oregonstate.edu/~erwig/meta/

Documentation (and further updates in technique) forthcoming.

Documentation

data Graph a b Source

Instances

(Show a, Show b) => Show (Graph a b) 

type Edge b = (Node, Node, b)Source

type Adj b = [(b, Node)]Source

type Context a b = (Adj b, Node, a, Adj b)Source

type MContext a b = Maybe (Context a b)Source

type Decomp a b = (MContext a b, Graph a b)Source

embed :: Context a b -> Graph a b -> Graph a bSource

match :: Node -> Graph a b -> Decomp a bSource

matchAny :: Graph a b -> (Context a b, Graph a b)Source

matchSome :: (Graph a b -> Node -> Bool) -> Graph a b -> (Context a b, Graph a b)Source

matchThe :: (Graph a b -> Node -> Bool) -> Graph a b -> (Context a b, Graph a b)Source

context :: Node -> Graph a b -> Context a bSource

(\\) :: Graph a b -> [Node] -> Graph a bSource

suc :: Graph a b -> Node -> [Node]Source

pre :: Graph a b -> Node -> [Node]Source

out :: Graph a b -> Node -> [Edge b]Source

inn :: Graph a b -> Node -> [Edge b]Source

indeg :: Graph a b -> Node -> IntSource

outdeg :: Graph a b -> Node -> IntSource

deg :: Graph a b -> Node -> IntSource

suc' :: (t, t1, t2, [(a, b)]) -> [b]Source

pre' :: ([(a, b)], t, t1, t2) -> [b]Source

neighbors' :: ([(a1, a)], t, t1, [(a2, a)]) -> [a]Source

out' :: (t, t1, t2, t3) -> tSource

inn' :: (t, t1, t2, t3) -> t3Source

indeg' :: ([a], t, t1, t2) -> IntSource

outdeg' :: (t, t1, t2, [a]) -> IntSource

deg' :: ([a], t, t1, [a1]) -> IntSource

node' :: (t, t1, t2, t3) -> t1Source

lab' :: (t, t1, t2, t3) -> t2Source

nodes :: Graph a b -> [Node]Source

labNodes :: Graph a b -> [(Node, a)]Source

edges :: Graph t t1 -> [(Node, Node)]Source

labEdges :: Graph a b -> [Edge b]Source

ufold :: (Context a b -> c -> c) -> c -> Graph a b -> cSource

gfold :: Dir a b -> Dagg a b c d -> Bagg d c -> [Node] -> Graph a b -> cSource

newNodes :: Int -> Graph a b -> [Node]Source

insNode :: Graph a b -> (Node, a) -> Graph a bSource

insNodes :: Graph a b -> [(Node, a)] -> Graph a bSource

insEdge :: Graph a b -> (Node, Node, b) -> Graph a bSource

insEdges :: Graph a b -> [(Node, Node, b)] -> Graph a bSource

mkGraph :: [(Node, a)] -> [(Node, Node, b)] -> Graph a bSource

buildGr :: [Context a b] -> Graph a bSource