streams-0.4: Various Haskell 2010 stream comonads

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>

Data.Stream.Branching

Contents

Description

 

Synopsis

The type of streams

data Stream f a Source

Constructors

a :< (f (Stream f a)) 

Instances

Functor f => Functor (Stream f) 
Applicative f => Applicative (Stream f) 
Functor f => Comonad (Stream f) 
Functor f => Extend (Stream f) 
Distributive f => Distributive (Stream f) 
Apply f => ComonadApply (Stream f) 
Apply f => Apply (Stream f) 
(Eq (f (Stream f a)), Eq a) => Eq (Stream f a) 
(Ord (f (Stream f a)), Ord a) => Ord (Stream f a) 
(Show (f (Stream f a)), Show a) => Show (Stream f a) 

Basic functions

head :: Stream f a -> aSource

tail :: Stream f a -> f (Stream f a)Source

tails :: Functor f => Stream f a -> Stream f (Stream f a)Source

inits1 :: Functor f => Stream f a -> Stream f (NonEmpty a)Source

equivalent to inits sans the initial [] context

scanr :: Functor f => (a -> f b -> b) -> Stream f a -> Stream f bSource

scanl :: Functor f => (a -> b -> a) -> a -> Stream f b -> Stream f aSource

unfold :: Functor f => (b -> (a, f b)) -> b -> Stream f aSource