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

Portability portable experimental Drew Day Safe-Infered

Aprog

Description

Documentation (and further updates in technique) forthcoming.

Synopsis

# Simple Fold Examples

sum' :: (Eq a, Num a) => [a] -> aSource

sumset :: (Eq a, Num a) => [a] -> aSource

# Numeric ( N * N ) Transformers

minus :: Num c => (c, c) -> cSource

eq0 :: (Eq b, Num b) => (a, b) -> BoolSource

eq0' :: (Eq b, Num b) => (b, b1) -> BoolSource

lt0' :: (Ord b, Num b) => (b, b1) -> BoolSource

# List and Set Transformers

length1 :: [t] -> IntSource

length2 :: [a] -> IntSource

length3 :: [a] -> IntSource

length4 :: [a] -> IntSource

card :: (Eq a, Num a) => [a] -> IntSource

card_alt :: (Eq a, Num a) => [a] -> IntSource

quicksort :: Ord a => [a] -> [a]Source

histogram :: Ord a => [a] -> FiniteMap a IntSource

any2 :: (a -> Bool) -> [a] -> BoolSource

all2 :: (a -> Bool) -> [a] -> BoolSource

size :: A s (II a) t -> t -> IntSource

mapset :: (Eq a, Eq b, Num a, Num b) => (a -> b) -> [a] -> [b]Source

# Tree Transformers

preorder :: Tree a -> [a]Source

dfsr :: Rose a -> [a]Source

bfsr :: [Rose a] -> [a]Source

binSearch :: Ord a => a -> Tree a -> BoolSource

tree' :: (Tree a -> t) -> (Tree a -> Tree a) -> A () (II t) (Tree a)Source

rose1 :: Num a => Rose aSource

rose2 :: Num a => Rose aSource

# Graph Transformers

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

gmap :: (Context a b -> Context c d) -> Graph a b -> Graph c dSource

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

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

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

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

mapNodes :: (a -> a') -> Graph a b -> Graph a' bSource

mapEdges :: (b -> b') -> Graph a b -> Graph a b'Source

grev :: Graph a b -> Graph a bSource

mlist :: A (II (Maybe a) [a]) (II a) [a]Source

nodeId :: II (MContext a b) c -> II (Maybe Node) cSource

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

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

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

sp :: (Num b, Ord b) => Node -> Graph a b -> [Node]Source

sp1 :: (Num b, Ord b) => Node -> Graph a b -> [Node]Source

remdup :: (Num a, Eq a) => [a] -> [a]Source

rev :: [a] -> [a]Source

heapsort :: Ord a => [a] -> [a]Source

bucketsort' :: Ord a => [a] -> [a]Source

bucketsort :: Ord a => [a] -> [a]Source

# Example Data

forceList :: [a] -> aSource

# Auxiliary Functions

sucs :: Functor f => t -> (t1, t2, t3, f (a, b)) -> f bSource

labSucs :: Num t4 => (t4, t) -> (t1, t2, t3, [(t4, t5)]) -> [(t4, t5)]Source

labnl :: (Enum a, Enum b, Num a) => b -> Int -> [(a, b)]Source

noLab :: (t, t1) -> (t, t1, ())Source