streams-3.2.1: Various Haskell 2010 stream comonads

Copyright(C) 2008-2011 Edward Kmett, (C) 2004 Dave Menendez
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

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 a infixr 5

O(1) cons

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

length :: Future a -> Int

O(log n).

head :: Future a -> a

O(1)

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

O(1).

last :: Future a -> a

O(log n).

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

O(1).

index :: Int -> Future a -> a

O(log n).

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

O(log n).

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

indexed :: Future a -> Future (Int, a)

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

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

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

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

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

repeat :: a -> Future a

replicate :: Int -> a -> Future a

O(log n)

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

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

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

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

fromList :: [a] -> Future a

toFuture :: [a] -> Maybe (Future a)