|Portability||to be determined.|
|Maintainer||Stephen Tetley <firstname.lastname@example.org>|
A Join List datatype and operations.
Join Lists are symmetric lists where joining two lists (catenation, aka (++)) is a cheap operation. This constrasts with the regular list datatype which is a cons list: while consing on a regular list (building a list by adding an elementary prefix) is by nature cheap, joining (++) is expensive.
- data JoinList a
- empty :: JoinList a
- wrap :: a -> JoinList a
- (++) :: JoinList a -> JoinList a -> JoinList a
- join :: JoinList a -> JoinList a -> JoinList a
- null :: JoinList a -> Bool
- concat :: JoinList (JoinList a) -> JoinList a
- length :: JoinList a -> Int
- map :: (a -> b) -> JoinList a -> JoinList b
- replicate :: Int -> a -> JoinList a
- repeated :: Int -> JoinList a -> JoinList a
- gfold :: b -> (a -> b) -> (b -> b -> b) -> JoinList a -> b
- xzip :: JoinList a -> [b] -> JoinList (a, b)
- xzipWith :: (a -> b -> c) -> JoinList a -> [b] -> JoinList c
- toList :: JoinList a -> [a]
- fromList :: [a] -> JoinList a
Join list datatype
Catenate two join lists. Unlike (++) on regular lists, catenation on join lists is (relatively) cheap hence the monicker join list.
An alias for (++) that does not cause a name clash with the Prelude.
Building join lists
Repeatedly build a join list by catenating the seed list.
A Jeremy Gibbons style generalised fold, where each constructor has an operation.
cross zip - zip a join list against a regular list, maintaining the shape of the join list provided the lengths of the lists match.
Generalized cross zip - c.f. zipWith on regular lists.