streams-0.7.2: Various Haskell 2010 stream comonads

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>

Data.Stream.Future.Skew

Description

Anticausal streams implemented as non-empty skew binary random access lists

The Applicative zips streams, but since these are potentially infinite this is stricter than would be desired. You almost always want

Synopsis

Documentation

(<|) :: a -> Future a -> Future aSource

O(1) cons

cons :: a -> Future a -> Future aSource

length :: Future a -> IntSource

O(log n).

head :: Future a -> aSource

O(1)

tail :: Future a -> Maybe (Future a)Source

O(1).

last :: Future a -> aSource

O(log n).

uncons :: Future a -> (a, Maybe (Future a))Source

O(1).

index :: Int -> Future a -> aSource

O(log n).

drop :: Int -> Future a -> Maybe (Future a)Source

O(log n).

dropWhile :: (a -> Bool) -> Future a -> Maybe (Future a)Source

from :: Num a => a -> Future aSource

break :: (a -> Bool) -> Future a -> ([a], Maybe (Future a))Source

span :: (a -> Bool) -> Future a -> ([a], Maybe (Future a))Source

split :: (a -> Bool) -> Future a -> ([a], Maybe (Future a))Source

splitW :: (Future a -> Bool) -> Future a -> ([a], Maybe (Future a))Source

replicate :: Int -> a -> Future aSource

O(log n)

insert :: Ord a => a -> Future a -> Future aSource

insertBy :: (a -> a -> Ordering) -> a -> Future a -> Future aSource

update :: Int -> a -> Future a -> Future aSource

adjust :: Int -> (a -> a) -> Future a -> Future aSource