dph-base-0.4.0: Basic Definitions for Data-Parallel Haskell.Source codeContentsIndex
Data.Array.Parallel.Stream
Portabilitynon-portable (existentials)
Stabilityinternal
MaintainerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Description
This module defined the interface to the stream library used for loop fusion.
Synopsis
data Step s a
= Done
| Skip !s
| Yield !a !s
data Stream a = forall s . Rebox s => Stream (s -> Step s a) !s Int
emptyS :: Stream a
singletonS :: a -> Stream a
consS :: a -> Stream a -> Stream a
replicateS :: Int -> a -> Stream a
replicateEachS :: Int -> Stream (Int :*: a) -> Stream a
replicateEachRS :: Int -> Stream a -> Stream a
(+++) :: Stream a -> Stream a -> Stream a
indexedS :: Stream a -> Stream (Int :*: a)
tailS :: Stream a -> Stream a
enumFromToS :: Int -> Int -> Stream Int
enumFromThenToS :: Int -> Int -> Int -> Stream Int
enumFromStepLenS :: Int -> Int -> Int -> Stream Int
enumFromToEachS :: Int -> Stream (Int :*: Int) -> Stream Int
enumFromStepLenEachS :: Int -> Stream ((Int :*: Int) :*: Int) -> Stream Int
toStream :: [a] -> Stream a
fromStream :: Stream a -> [a]
mapS :: (a -> b) -> Stream a -> Stream b
filterS :: (a -> Bool) -> Stream a -> Stream a
foldS :: (b -> a -> b) -> b -> Stream a -> b
fold1MaybeS :: (a -> a -> a) -> Stream a -> MaybeS a
scanS :: (b -> a -> b) -> b -> Stream a -> Stream b
scan1S :: (a -> a -> a) -> Stream a -> Stream a
mapAccumS :: (acc -> a -> acc :*: b) -> acc -> Stream a -> Stream b
zipWithS :: (a -> b -> c) -> Stream a -> Stream b -> Stream c
zipWith3S :: (a -> b -> c -> d) -> Stream a -> Stream b -> Stream c -> Stream d
zipS :: Stream a -> Stream b -> Stream (a :*: b)
zip3S :: Stream a -> Stream b -> Stream c -> Stream ((a :*: b) :*: c)
combineS :: Stream Bool -> Stream a -> Stream a -> Stream a
findS :: (a -> Bool) -> Stream a -> Maybe a
findIndexS :: (a -> Bool) -> Stream a -> Maybe Int
randomS :: (RandomGen g, Random a) => Int -> g -> Stream a
randomRS :: (RandomGen g, Random a) => Int -> (a, a) -> g -> Stream a
foldSS :: (a -> b -> a) -> a -> Stream Int -> Stream b -> Stream a
fold1SS :: (a -> a -> a) -> Stream Int -> Stream a -> Stream a
combineSS :: Stream Bool -> Stream Int -> Stream a -> Stream Int -> Stream a -> Stream a
appendSS :: Stream Int -> Stream a -> Stream Int -> Stream a -> Stream a
foldValuesR :: (a -> b -> a) -> a -> Int -> Int -> Stream b -> Stream a
Documentation
data Step s a Source
Constructors
Done
Skip !s
Yield !a !s
show/hide Instances
data Stream a Source
Constructors
forall s . Rebox s => Stream (s -> Step s a) !s Int
emptyS :: Stream aSource
Empty stream
singletonS :: a -> Stream aSource
Singleton stream
consS :: a -> Stream a -> Stream aSource
Construction
replicateS :: Int -> a -> Stream aSource
Replication
replicateEachS :: Int -> Stream (Int :*: a) -> Stream aSource
Given a stream of (length,value) pairs and the sum of the lengths, replicate each value to the given length.
replicateEachRS :: Int -> Stream a -> Stream aSource
Repeat each element in the stream n times
(+++) :: Stream a -> Stream a -> Stream aSource
Concatenation
indexedS :: Stream a -> Stream (Int :*: a)Source
Associate each element in the Stream with its index
tailS :: Stream a -> Stream aSource
Yield the tail of a stream
enumFromToS :: Int -> Int -> Stream IntSource
Yield an enumerated stream
enumFromThenToS :: Int -> Int -> Int -> Stream IntSource
Yield an enumerated stream using a specific step
enumFromStepLenS :: Int -> Int -> Int -> Stream IntSource
enumFromToEachS :: Int -> Stream (Int :*: Int) -> Stream IntSource
enumFromToEachS [k1 :*: m1, ..., kn :*: mn] = [k1,...,m1,...,kn,...,mn]
enumFromStepLenEachS :: Int -> Stream ((Int :*: Int) :*: Int) -> Stream IntSource
toStream :: [a] -> Stream aSource
Convert a list to a Stream
fromStream :: Stream a -> [a]Source
Generate a list from a Stream
mapS :: (a -> b) -> Stream a -> Stream bSource
Mapping
filterS :: (a -> Bool) -> Stream a -> Stream aSource
Filtering
foldS :: (b -> a -> b) -> b -> Stream a -> bSource
Folding
fold1MaybeS :: (a -> a -> a) -> Stream a -> MaybeS aSource
Yield NothingS if the Stream is empty and fold it otherwise.
scanS :: (b -> a -> b) -> b -> Stream a -> Stream bSource
Scanning
scan1S :: (a -> a -> a) -> Stream a -> Stream aSource
Scan over a non-empty Stream
mapAccumS :: (acc -> a -> acc :*: b) -> acc -> Stream a -> Stream bSource
zipWithS :: (a -> b -> c) -> Stream a -> Stream b -> Stream cSource
Zipping
zipWith3S :: (a -> b -> c -> d) -> Stream a -> Stream b -> Stream c -> Stream dSource
zipS :: Stream a -> Stream b -> Stream (a :*: b)Source
zip3S :: Stream a -> Stream b -> Stream c -> Stream ((a :*: b) :*: c)Source
combineS :: Stream Bool -> Stream a -> Stream a -> Stream aSource
findS :: (a -> Bool) -> Stream a -> Maybe aSource
findIndexS :: (a -> Bool) -> Stream a -> Maybe IntSource
randomS :: (RandomGen g, Random a) => Int -> g -> Stream aSource
randomRS :: (RandomGen g, Random a) => Int -> (a, a) -> g -> Stream aSource
foldSS :: (a -> b -> a) -> a -> Stream Int -> Stream b -> Stream aSource
fold1SS :: (a -> a -> a) -> Stream Int -> Stream a -> Stream aSource
combineSS :: Stream Bool -> Stream Int -> Stream a -> Stream Int -> Stream a -> Stream aSource
appendSS :: Stream Int -> Stream a -> Stream Int -> Stream a -> Stream aSource
foldValuesR :: (a -> b -> a) -> a -> Int -> Int -> Stream b -> Stream aSource
Produced by Haddock version 2.6.1