"Open" functions, working on functors instead of trees.
- toList :: Foldable t => t a -> [a]
- mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- mapAccumL_ :: Traversable f => (a -> b -> (a, c)) -> a -> f b -> f c
- mapAccumR_ :: Traversable f => (a -> b -> (a, c)) -> a -> f b -> f c
- holes :: Traversable f => f a -> f (a, a -> f a)
- holesList :: Traversable f => f a -> [(a, a -> f a)]
- apply :: Traversable f => (a -> a) -> f a -> f (f a)
- builder :: Traversable f => f a -> [b] -> f b
- enumerate :: Traversable f => f a -> (Int, f (Int, a))
- enumerateWith :: Traversable f => (Int -> a -> b) -> f a -> (Int, f b)
- enumerateWith_ :: Traversable f => (Int -> a -> b) -> f a -> f b
Documentation
Accumulating maps
mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
mapAccumL_ :: Traversable f => (a -> b -> (a, c)) -> a -> f b -> f cSource
mapAccumR_ :: Traversable f => (a -> b -> (a, c)) -> a -> f b -> f cSource
Open functions
holes :: Traversable f => f a -> f (a, a -> f a)Source
The children together with functions replacing that particular child.
holesList :: Traversable f => f a -> [(a, a -> f a)]Source
apply :: Traversable f => (a -> a) -> f a -> f (f a)Source
Apply the given function to each child in turn.
builder :: Traversable f => f a -> [b] -> f bSource
Builds up a structure from a list of the children.
Enumerations
enumerate :: Traversable f => f a -> (Int, f (Int, a))Source
Enumerates children from the left to the right, starting with zero.
Also returns the number of children. This is just a simple application
of mapAccumL
.
enumerateWith :: Traversable f => (Int -> a -> b) -> f a -> (Int, f b)Source
enumerateWith_ :: Traversable f => (Int -> a -> b) -> f a -> f bSource