capped-list-1.1: A list-like type for lazy sequences, with a user-defined termination value.Source codeContentsIndex
Data.CappedList
Portabilityportable
Maintainerjmillikin@gmail.com
Description

A list-like type for lazy sequences, with a user-defined termination value.

This module uses common names and so is designed to be imported qualified:

 import qualified Data.CappedList as CL
Synopsis
data CappedList cap a
= Next a (CappedList cap a)
| Cap cap
null :: CappedList cap a -> Bool
append :: CappedList cap a -> CappedList cap a -> CappedList cap a
map :: (a -> b) -> CappedList cap a -> CappedList cap b
mapEither :: (a -> Either cap b) -> CappedList cap a -> CappedList cap b
concatMap :: (a -> CappedList cap b) -> CappedList cap a -> CappedList cap b
foldr :: (a -> b -> b) -> (cap -> b) -> CappedList cap a -> b
foldl :: (b -> a -> b) -> (cap -> b) -> CappedList cap a -> b
unfoldr :: (b -> Either cap (a, b)) -> b -> CappedList cap a
length :: CappedList cap a -> Int
Documentation
data CappedList cap a Source
A list-like type for lazy sequences, with a user-defined termination value.
Constructors
Next a (CappedList cap a)
Cap cap
show/hide Instances
Empty cap => Monad (CappedList cap)
Functor (CappedList cap)
Empty cap => MonadFix (CappedList cap)
Empty cap => MonadPlus (CappedList cap)
Empty cap => Applicative (CappedList cap)
Foldable (CappedList cap)
Traversable (CappedList cap)
Empty cap => Alternative (CappedList cap)
(Eq cap, Eq a) => Eq (CappedList cap a)
(Show cap, Show a) => Show (CappedList cap a)
Empty cap => Monoid (CappedList cap a)
Empty cap => Empty (CappedList cap a)
null :: CappedList cap a -> BoolSource
Like the standard null function.
append :: CappedList cap a -> CappedList cap a -> CappedList cap aSource
Like the standard ++ function.
map :: (a -> b) -> CappedList cap a -> CappedList cap bSource
Like the standard map function.
mapEither :: (a -> Either cap b) -> CappedList cap a -> CappedList cap bSource
Like the standard map function, but the mapping function may return a capping value.
concatMap :: (a -> CappedList cap b) -> CappedList cap a -> CappedList cap bSource
Like the standard concatMap function.
foldr :: (a -> b -> b) -> (cap -> b) -> CappedList cap a -> bSource
Like the standard foldr function, but accepting an extra parameter to handle Cap values.
foldl :: (b -> a -> b) -> (cap -> b) -> CappedList cap a -> bSource
Like the standard foldl function, but accepting an extra parameter to handle Cap values.
unfoldr :: (b -> Either cap (a, b)) -> b -> CappedList cap aSource
Like the standard Data.List.unfoldr function, but the step function must return a cap to terminate the unfold.
length :: CappedList cap a -> IntSource
Like the standard length function; Cap is considered 0-length.
Produced by Haddock version 2.6.0