Module
Run.Streaming.Prelude
- Package
- purescript-run-streaming
- Repository
- natefaubion/purescript-run-streaming
#cat Source
cat :: forall a x r. Run (Transformer x x r) a
Forwards incoming values downstream.
#map Source
map :: forall a o i r. (i -> o) -> Run (Transformer i o r) a
Adapts incoming values.
#filter Source
filter :: forall a x r. (x -> Boolean) -> Run (Transformer x x r) a
Filters incoming values based on a predicate.
#concat Source
concat :: forall a f x r. Foldable f => Run (Transformer (f x) x r) a
Forwards all individual values in an incoming Foldable downstream.
#concatMap Source
concatMap :: forall a f o i r. Foldable f => (i -> f o) -> Run (Transformer i o r) a
Composition of map
followed by concat
.
#take Source
take :: forall x r. Int -> Run (Transformer x x r) Unit
Takes a specified number of values from the head of the stream, terminating upon completion.
#takeWhile Source
takeWhile :: forall x r. (x -> Boolean) -> Run (Transformer x x r) Unit
Takes values from the head of the stream as determined by the provided predicate. Terminates when the predicate fails.
#drop Source
drop :: forall a x r. Int -> Run (Transformer x x r) a
Drops a specified number of values from the head of the stream.
#dropWhile Source
dropWhile :: forall a x r. (x -> Boolean) -> Run (Transformer x x r) a
Drops values from the head of the stream as determined by the provided predicate. Forwards all subsequent values.
#scan Source
scan :: forall a x o i r. (x -> i -> x) -> x -> (x -> o) -> Run (Transformer i o r) a
Folds over the input, yielding each step.
Re-exports from Run.Streaming
#Transformer Source
type Transformer i o r = (await :: AWAIT i, yield :: YIELD o | r)
Transformers await values i
and yield values o
using effects r
.