-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Join list - symmetric list type
--
-- A JoinList - a list type with with cheap catenation. Currently
-- somewhat minimal.
--
-- Changelog
--
--
-- - 2.0 - more operations and some bugfixes (toList...), wrap
-- renamed to singleton.
--
@package joinlist
@version 0.2.0
-- | 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.
module Data.JoinList
data JoinList a
-- | Build a join list from a regular list.
fromList :: [a] -> JoinList a
-- | Convert a join list to a regular list.
toList :: JoinList a -> [a]
-- | Create an empty join list.
empty :: JoinList a
-- | Create a singleton join list.
singleton :: a -> JoinList a
-- | Cons an element to the front of the join list.
cons :: a -> JoinList a -> JoinList a
-- | Snoc an element to the tail of the join list.
snoc :: JoinList a -> a -> JoinList a
-- | Catenate two join lists. Unlike (++) on regular lists, catenation on
-- join lists is (relatively) cheap hence the name join list.
(++) :: JoinList a -> JoinList a -> JoinList a
-- | An alias for (++) that does not cause a name clash with the Prelude.
join :: JoinList a -> JoinList a -> JoinList a
-- | Test whether a join list is empty.
null :: JoinList a -> Bool
-- | Concatenate a (join) list of (join) lists.
concat :: JoinList (JoinList a) -> JoinList a
-- | Get the length of a join list.
length :: JoinList a -> Int
-- | Map a function over a join list.
map :: (a -> b) -> JoinList a -> JoinList b
-- | Build a join list of n elements.
replicate :: Int -> a -> JoinList a
-- | Repeatedly build a join list by catenating the seed list.
repeated :: Int -> JoinList a -> JoinList a
-- | A generalized fold, where each constructor has an operation.
gfold :: b -> (a -> b) -> (b -> b -> b) -> JoinList a -> b
-- | Right-associative fold of a JoinList.
foldr :: (a -> b -> b) -> b -> JoinList a -> b
-- | Left-associative fold of a JoinList.
foldl :: (b -> a -> b) -> b -> JoinList a -> b
-- | unfoldl is permitted due to cheap snoc-ing.
unfoldl :: (b -> Maybe (a, b)) -> b -> JoinList a
-- | unfoldr - the usual unfoldr opertation.
unfoldr :: (b -> Maybe (a, b)) -> b -> JoinList a
-- | cross zip - zip a join list against a regular list, maintaining
-- the shape of the join list provided the lengths of the lists match.
xzip :: JoinList a -> [b] -> JoinList (a, b)
-- | Generalized cross zip - c.f. zipWith on regular lists.
xzipWith :: (a -> b -> c) -> JoinList a -> [b] -> JoinList c
instance (Eq a) => Eq (JoinList a)
instance (Show a) => Show (JoinList a)
instance Traversable JoinList
instance Foldable JoinList
instance Monad JoinList
instance Functor JoinList
instance Monoid (JoinList a)