streams-3.3: Various Haskell 2010 stream comonads

Copyright(C) 2008-2015 Edward Kmett
(C) 2004 Dave Menendez
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellTrustworthy
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

data Future a Source #

Constructors

Last !(Complete a) 
!(Complete a) :< (Future a) infixr 5 

Instances

Functor Future Source # 

Methods

fmap :: (a -> b) -> Future a -> Future b #

(<$) :: a -> Future b -> Future a #

Applicative Future Source # 

Methods

pure :: a -> Future a #

(<*>) :: Future (a -> b) -> Future a -> Future b #

(*>) :: Future a -> Future b -> Future b #

(<*) :: Future a -> Future b -> Future a #

Foldable Future Source # 

Methods

fold :: Monoid m => Future m -> m #

foldMap :: Monoid m => (a -> m) -> Future a -> m #

foldr :: (a -> b -> b) -> b -> Future a -> b #

foldr' :: (a -> b -> b) -> b -> Future a -> b #

foldl :: (b -> a -> b) -> b -> Future a -> b #

foldl' :: (b -> a -> b) -> b -> Future a -> b #

foldr1 :: (a -> a -> a) -> Future a -> a #

foldl1 :: (a -> a -> a) -> Future a -> a #

toList :: Future a -> [a] #

null :: Future a -> Bool #

length :: Future a -> Int #

elem :: Eq a => a -> Future a -> Bool #

maximum :: Ord a => Future a -> a #

minimum :: Ord a => Future a -> a #

sum :: Num a => Future a -> a #

product :: Num a => Future a -> a #

Traversable Future Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Future a -> f (Future b) #

sequenceA :: Applicative f => Future (f a) -> f (Future a) #

mapM :: Monad m => (a -> m b) -> Future a -> m (Future b) #

sequence :: Monad m => Future (m a) -> m (Future a) #

Comonad Future Source # 

Methods

extract :: Future a -> a #

duplicate :: Future a -> Future (Future a) #

extend :: (Future a -> b) -> Future a -> Future b #

ComonadApply Future Source # 

Methods

(<@>) :: Future (a -> b) -> Future a -> Future b #

(@>) :: Future a -> Future b -> Future b #

(<@) :: Future a -> Future b -> Future a #

Traversable1 Future Source # 

Methods

traverse1 :: Apply f => (a -> f b) -> Future a -> f (Future b) #

sequence1 :: Apply f => Future (f b) -> f (Future b) #

Alt Future Source # 

Methods

(<!>) :: Future a -> Future a -> Future a #

some :: Applicative Future => Future a -> Future [a] #

many :: Applicative Future => Future a -> Future [a] #

Apply Future Source # 

Methods

(<.>) :: Future (a -> b) -> Future a -> Future b #

(.>) :: Future a -> Future b -> Future b #

(<.) :: Future a -> Future b -> Future a #

Extend Future Source # 

Methods

duplicated :: Future a -> Future (Future a) #

extended :: (Future a -> b) -> Future a -> Future b #

Foldable1 Future Source # 

Methods

fold1 :: Semigroup m => Future m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Future a -> m #

IsList (Future a) Source # 

Associated Types

type Item (Future a) :: * #

Methods

fromList :: [Item (Future a)] -> Future a #

fromListN :: Int -> [Item (Future a)] -> Future a #

toList :: Future a -> [Item (Future a)] #

Show a => Show (Future a) Source # 

Methods

showsPrec :: Int -> Future a -> ShowS #

show :: Future a -> String #

showList :: [Future a] -> ShowS #

type Item (Future a) Source # 
type Item (Future a) = a

(<|) :: a -> Future a -> Future a infixr 5 Source #

O(1) cons

length :: Foldable t => forall a. t a -> Int #

Returns the size/length of a finite structure as an Int. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

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

O(1).

last :: Future a -> a Source #

O(log n).

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

O(1).

index :: Int -> Future a -> a Source #

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 a Source #

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 a Source #

O(log n)

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

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

update :: Int -> a -> Future a -> Future a Source #

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

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

singleton :: a -> Future a Source #

O(1)