data UnfoldRes : Type -> Type -> Type -> Type- Totality: total
Visibility: public export
Constructors:
More : o -> s -> UnfoldRes r s o Done : r -> UnfoldRes r s o Last : r -> o -> UnfoldRes r s o
emits : List o -> Stream f es o Emits a list of chunks.
Totality: total
Visibility: exportemitList : List o -> Stream f es (List o) Emits a list of values as a single chunk.
Totality: total
Visibility: exportemitMaybe : Maybe o -> Stream f es o Emits a single optional value.
Totality: total
Visibility: exportemitSnoc : SnocList o -> Maybe o -> Stream f es (List o) Utility to emit a single list chunk from a snoc list.
Totality: total
Visibility: exporteval : f es o -> Stream f es o Emits a single chunk of output generated from an effectful
computation.
Totality: total
Visibility: exportunfold : s -> (s -> UnfoldRes r s o) -> Pull f o es r Like `unfold` but emits values in larger chunks.
This allows us to potentially emit a bunch of values right before
we are done.
This overlaps with function `FS.Chunk.unfold`, so it is typically
used qualified: `P.unfold`.
Totality: total
Visibility: exportunfoldEval : s -> (s -> f es (UnfoldRes r s o)) -> Pull f o es r Like `unfold` but produces values via an effectful computation
until a `Done` or `Last` is returned.
Totality: total
Visibility: exportunfoldEvalMaybe : f es (Maybe o) -> Stream f es o Produces values via an effectful computation
until a `Nothing` is returned.
Totality: total
Visibility: exportfill : o -> Pull f o es () Infinitely produces chunks of values of the given size
Totality: total
Visibility: exportiterate : o -> (o -> o) -> Pull f o es () An infinite stream of values of type `o` where
the next value is built from the previous one by
applying the given function.
Totality: total
Visibility: exportreplicate : Nat -> o -> Stream f es o Produces the given chunk of value `n` times.
Totality: total
Visibility: exportrepeat : Stream f es o -> Pull f o es () Infinitely cycles through the given `Pull`
Totality: total
Visibility: exportconsMaybe : Maybe o -> Pull f o es r -> Pull f o es r Prepends the given optional output to a pull.
Totality: total
Visibility: exportcycle : (as : List a) -> {auto 0 _ : NonEmpty as} -> Stream f es a Infinitely cycles through the values in the given
non-empty list.
Totality: total
Visibility: exportdata BreakInstruction : Type- Totality: total
Visibility: public export
Constructors:
TakeHit : BreakInstruction Take the first succeeding value as part of the emitted prefix
PostHit : BreakInstruction Keep the succeeding value as part of the postfix.
DropHit : BreakInstruction Discard the succeeding value
peek : Pull f o es r -> Pull f q es (Either r (o, Pull f o es r)) Like `uncons` but does not consume the chunk
Totality: total
Visibility: exportpeekRes : Pull f o es r -> Pull f q es (Either r (Pull f o es r)) Like `peeks` but only checks if the pull has been exhausted or not.
Totality: total
Visibility: exportdrain : Pull f o es r -> Pull f q es r Empties a stream silently dropping all output.
Totality: total
Visibility: exportsplitAt : Nat -> Pull f o es r -> Pull f o es (Pull f o es r) Emits the first `n` values of a `Pull`, returning the remainder.
In case the remaining pull is exhausted, with will wrap the
final result in a `Left`, otherwise, the (non-empty) remainder will be
wrapped in a right.
Totality: total
Visibility: exporttake : Nat -> Pull f o es r -> Stream f es o Emits only the first `n` values of a `Stream`.
Totality: total
Visibility: exportlimit : Has e es => Lazy e -> Nat -> Pull f o es r -> Pull f o es r Like `take` but limits the number of emitted values.
This fails with the given error in case the limit is exceeded.
Note: This tries to read past the end of a pull by invoking `peekRes`.
This is not suitable for limitting the input from a stream that
blocks once it is exhausted.
Totality: total
Visibility: exportdrop : Nat -> Pull f o es r -> Pull f o es r Discards the first `n` values of a `Stream`, returning the
remainder.
Totality: total
Visibility: exporthead : Pull f o es r -> Stream f es o Only keeps the first element of the input.
Totality: total
Visibility: exporttail : Pull f o es r -> Pull f o es r Drops the first element of the input.
Totality: total
Visibility: exportdata BreakRes : Type -> Type Result of splitting a value into two parts. This is used to
split up streams of data along logical boundaries.
Totality: total
Visibility: public export
Constructors:
Broken : Maybe c -> Maybe c -> BreakRes c The value was broken and we got a (possibly empty) pre- and postfix.
Keep : c -> BreakRes c The value could not be broken.
breakPull : (r -> Pull f o es r) -> (o -> BreakRes o) -> Pull f o es r -> Pull f o es (Pull f o es r) Uses the given breaking function to break the pull into
a prefix of emitted chunks and a suffix that is returned as
the result.
Totality: total
Visibility: exportbreakFull : (r -> Pull f o es r) -> BreakInstruction -> (o -> Bool) -> Pull f o es r -> Pull f o es (Pull f o es r) Breaks a pull as soon as the given predicate returns `True`.
The `BreakInstruction` dictates, if the value, for which the
predicate held, should be emitted as part of the prefix or the
suffix, or if it should be discarded.
Totality: total
Visibility: exportforceBreakFull : Has e es => Lazy e -> BreakInstruction -> (o -> Bool) -> Pull f o es r -> Pull f o es (Pull f o es r) Like `breakFull` but fails with the given execption if no
breaking point was found.
Totality: total
Visibility: exporttakeUntil : BreakInstruction -> (o -> Bool) -> Pull f o es r -> Stream f es o Emits values until the given predicate returns `True`.
The `BreakInstruction` dictates, if the value, for which the
predicate held, should be emitted as part of the prefix or not.
Totality: total
Visibility: exporttakeWhile : (o -> Bool) -> Pull f o es r -> Stream f es o Emits values until the given predicate returns `False`,
returning the remainder of the `Pull`.
Totality: total
Visibility: exporttakeThrough : (o -> Bool) -> Pull f o es r -> Stream f es o Like `takeWhile` but also includes the first failure.
Totality: total
Visibility: exporttakeWhileJust : Pull f (Maybe o) es r -> Stream f es o Emits values until the given pull emits a `Nothing`.
Totality: total
Visibility: exportdropUntil : BreakInstruction -> (o -> Bool) -> Pull f o es r -> Pull f o es r Discards values until the given predicate returns `True`.
The `BreakInstruction` dictates, if the value, for which the
predicate held, should be emitted as part of the remainder or not.
Totality: total
Visibility: exportdropWhile : (o -> Bool) -> Pull f o es r -> Pull f o es r Drops values from a stream while the given predicate returns `True`,
returning the remainder of the stream.
Totality: total
Visibility: exportdropThrough : (o -> Bool) -> Pull f o es r -> Pull f o es r Like `dropWhile` but also drops the first value where
the predicate returns `False`.
Totality: total
Visibility: exportmapMaybe : (o -> Maybe p) -> Pull f o es r -> Pull f p es r Maps chunks of output via a partial function.
Totality: total
Visibility: exportcatMaybes : Pull f (Maybe o) es r -> Pull f o es r Emits a values wrapped in a `Just` from the initial stream.
Totality: total
Visibility: exportmapRight : (o -> Either e p) -> Pull f o es r -> Pull f p es r Emits the values, for which the given function returns a `Right`.
Totality: total
Visibility: exportcatRights : Pull f (Either e o) es r -> Pull f o es r Emits the values wrapped `Rights`.
Totality: total
Visibility: exportmapLeft : (o -> Either e p) -> Pull f o es r -> Pull f e es r Emits the values, for which the given function returns a `Right`.
Totality: total
Visibility: exportcatLefts : Pull f (Either e o) es r -> Pull f e es r Emits the values wrapped `Rights`.
Totality: total
Visibility: exportmapOutput : (o -> p) -> Pull f o es r -> Pull f p es r Chunk-wise maps the emit of a `Pull`
Totality: total
Visibility: exportevalMap : (o -> f es p) -> Pull f o es r -> Pull f p es r Chunk-wise effectful mapping of the emit of a `Pull`
Totality: total
Visibility: exportevalMapMaybe : (o -> f es (Maybe p)) -> Pull f o es r -> Pull f p es r Chunk-wise effectful mapping of the emit of a `Pull`
Totality: total
Visibility: exportfilter : (o -> Bool) -> Pull f o es r -> Pull f o es r Chunk-wise filters the emit of a `Pull` emitting only the
values that fulfill the given predicate
Totality: total
Visibility: exportfilterNot : (o -> Bool) -> Pull f o es r -> Pull f o es r Convenience alias for `filterC (not . pred)`.
Totality: total
Visibility: exportendWithNothing : Pull f o es r -> Pull f (Maybe o) es r Wraps the values emitted by this stream in a `Just` and
marks its end with a `Nothing`.
Totality: total
Visibility: exportpairLastOr : Lazy o -> Pull f o es r -> Pull f p es (o, r) Returns the first output of this stream and pairs it with the
result.
The remainder of the pull is drained and run to completion.
Totality: total
Visibility: exportlastOr : Lazy o -> Stream f es o -> Pull f p es o Like `pairLastOr` but operates on a stream and therefore only returns
the last output.
Totality: total
Visibility: exportpairLastOrErr : Has e es => Lazy e -> Pull f o es r -> Pull f p es (o, r) Like `firstOr` but fails with the given error in case no
value is emitted.
Totality: total
Visibility: exportlastOrErr : Has e es => Lazy e -> Stream f es o -> Pull f p es o Like `pairLastOrErr` but operates on a stream and therefore only returns
the last output.
Totality: total
Visibility: exportfold : (p -> o -> p) -> p -> Pull f o es r -> Pull f p es r Folds the emit of a pull using an initial value and binary operator.
The accumulated result is emitted as a single value.
Totality: total
Visibility: exportfoldPair : (p -> o -> p) -> p -> Pull f o es r -> Pull f q es (p, r) Like `fold` but instead of emitting the result as a single
value of output, it is paired with the `Pull`s result.
Totality: total
Visibility: exportfoldPairE : Has e es => (p -> o -> Either e p) -> p -> Pull f o es r -> Pull f q es (p, r) Like `foldPair` but with a function that can fail.
Totality: total
Visibility: exportfoldGet : (p -> o -> p) -> p -> Stream f es o -> Pull f q es p Convenience version of `foldPair` for working on streams.
Totality: total
Visibility: exportfold1 : (o -> o -> o) -> Pull f o es r -> Pull f o es r Like `foldC` but will not emit a value in case of an empty pull.
Totality: total
Visibility: exportall : (o -> Bool) -> Pull f o es r -> Stream f es Bool Emits `True` if all emitted values of the given stream fulfill
the given predicate
Totality: total
Visibility: exportany : (o -> Bool) -> Pull f o es r -> Stream f es Bool Returns `True` if any of the emitted values of the given stream fulfills
the given predicate
Totality: total
Visibility: exportsum : Num o => Pull f o es r -> Pull f o es r Sums up the emitted chunks.
Totality: total
Visibility: exportcount : Pull f o es r -> Pull f Nat es r Counts the number of emitted chunks.
Totality: total
Visibility: exportmaximum : Ord o => Pull f o es r -> Pull f o es r Emits the largest output encountered.
Totality: total
Visibility: exportminimum : Ord o => Pull f o es r -> Pull f o es r Emits the smallest output encountered.
Totality: total
Visibility: exportmappend : Semigroup o => Pull f o es r -> Pull f o es r Emits the smallest output encountered.
Totality: total
Visibility: exportfoldMap : Monoid m => (o -> m) -> Pull f o es r -> Pull f m es r Accumulates the emitted values over a monoid.
Note: This corresponds to a left fold, so it will
run in quadratic time for monoids that are
naturally accumulated from the right (such as List)
Totality: total
Visibility: exportevalFold : (p -> o -> f es p) -> p -> Pull f o es r -> Pull f p es r Folds the emit of a pull using an initial value and binary operator.
The accumulated result is emitted as a single value.
Totality: total
Visibility: exportevalFoldPair : (p -> o -> f es p) -> p -> Pull f o es r -> Pull f q es (p, r) Like `fold` but instead of emitting the result as a single
value of output, it is paired with the `Pull`s result.
Totality: total
Visibility: exportevalFoldGet : (p -> o -> f es p) -> p -> Stream f es o -> Pull f q es p Convenience version of `evalFoldPair` for working on streams.
Totality: total
Visibility: exportscan : s -> (s -> o -> (p, s)) -> Pull f o es r -> Pull f p es r Runs a stateful computation across all chunks of data.
Totality: total
Visibility: exportdistinctBy : (o -> o -> Bool) -> Pull f o es r -> Pull f o es r Emits values of the original pull, but emits consecutive
values for which `f` returns `True` only once.
Note: For this to work correctly, `f` must be an equivalence relation.
This function makes no guarantees about the order in which arguments
are passed to `f`, so `f` must be symmetric. It also makes
no guarantees about which emitted value is being kept in its
internal state, so `f` must be transitive.
Totality: total
Visibility: exportdistinct : Eq o => Pull f o es r -> Pull f o es r Emits values of the original pull, but emits consecutive
identical values only once.
Totality: total
Visibility: exportscanMaybe : s -> (s -> Maybe (o -> (p, s))) -> Pull f o es r -> Pull f p es s General stateful conversion of a `Pull`s emit.
Aborts as soon as the given accumulator function returns `Nothing`
Totality: total
Visibility: exportscanFull : s -> (s -> o -> (Maybe p, s)) -> (s -> Maybe p) -> Pull f o es r -> Pull f p es r Like `scan` but will possibly also emit the final state.
Totality: total
Visibility: exportzipWithScan : p -> (p -> o -> p) -> Pull f o es r -> Pull f (o, p) es r Zips the input with a running total, up to but
not including the current element.
Totality: total
Visibility: exportzipWithScan1 : p -> (p -> o -> p) -> Pull f o es r -> Pull f (o, p) es r Like `zipWithScan` but the running total is including the current element.
Totality: total
Visibility: exportzipWithIndex : Pull f o es r -> Pull f (o, Nat) es r Pairs each element in the stream with its 0-based index.
Totality: total
Visibility: exportzipWithCount : Pull f o es r -> Pull f (o, Nat) es r Pairs each element in the stream with its 1-based count.
Totality: total
Visibility: exportscans : p -> (p -> o -> p) -> Pull f o es r -> Pull f p es r Accumulates the input value using the given function.
The emitted result will include the input up to but
not including the current value.
Totality: total
Visibility: exportscans1 : p -> (p -> o -> p) -> Pull f o es r -> Pull f p es r Like `scans` but the running total is including the current element.
Emits the initial value as its first output.
Totality: total
Visibility: exportscanFrom : o -> Pull f (o -> o) es r -> Pull f o es r Like `scans` but specialized to a pull of unary functions.
Totality: total
Visibility: exportscanFrom1 : o -> Pull f (o -> o) es r -> Pull f o es r Like `scans1` but specialized to a pull of unary functions.
Totality: total
Visibility: exportrunningCount : Pull f o es r -> Pull f Nat es r Emits the count of each element.
Totality: total
Visibility: exportevalScan : s -> (s -> o -> f es (p, s)) -> Pull f o es r -> Pull f p es r Like `scan` but with an effectful computation.
Totality: total
Visibility: exportevalScans : Functor (f es) => p -> (p -> o -> f es p) -> Pull f o es r -> Pull f p es r Accumulates the input value using the given function.
The emitted result will include the input up to but
not including the current value.
Totality: total
Visibility: exportevalScans1 : Functor (f es) => p -> (p -> o -> f es p) -> Pull f o es r -> Pull f p es r Like `scans` but the running total is including the current element.
Totality: total
Visibility: exportevalScanFrom : Functor (f es) => o -> Pull f (o -> f es o) es r -> Pull f o es r Like `evalScans` but specialized to a pull of unary effectful functions.
Totality: total
Visibility: exportevalScanFrom1 : Functor (f es) => o -> Pull f (o -> f es o) es r -> Pull f o es r Like `evalScans1` but specialized to a pull of unary effectful functions.
Totality: total
Visibility: exportforeach : (o -> f es ()) -> Pull f o es r -> Pull f q es r Performs the given action on each emitted chunk of values, thus draining
the stream, consuming all its output.
For acting on output without actually draining the stream, see
`observe` and `observe1`.
Totality: total
Visibility: exportforeach' : f es () -> Pull f o es r -> Pull f q es r Utility alias for `foreach . const`.
Totality: total
Visibility: exportobserve : (o -> f es ()) -> Pull f o es r -> Pull f o es r Performs the given action on every chunk of values of the stream without
otherwise affecting the emitted values.
Totality: total
Visibility: exportobserve' : f es () -> Pull f o es r -> Pull f o es r Utility alias for `observe . const`.
Totality: total
Visibility: exportflatMap : Pull f o es r -> (o -> Stream f es p) -> Pull f p es r Converts every chunk of output to a new stream,
concatenating the resulting streams before emitting the final
result.
Totality: total
Visibility: exportbind : (o -> Pull f p es ()) -> Pull f o es r -> Pull f p es r Flipped version of `flatMapC`
Totality: total
Visibility: exportattemptOutput : Pull f o es () -> Pull f (Result es o) fs ()- Totality: total
Visibility: export stepLeg : Stream f es o -> Pull f p es (Maybe (StepLeg f es o)) This is an internal utility to run the remainder of a stream
in the correct scope.
Totality: total
Visibility: exportstep : StepLeg f es o -> Pull f p es (Maybe (StepLeg f es o)) Runs a `StepLeg` in its scope, returning then next `StepLeg`.
Totality: total
Visibility: export0 ZipWithLeft : (List Type -> Type -> Type) -> List Type -> Type -> Type -> Type Type alias for a function that converts a stream plus
a prefix to a stream emitting different values.
Totality: total
Visibility: public exportzipAllWith : o1 -> o2 -> (o1 -> o2 -> o3) -> Stream f es o1 -> Stream f es o2 -> Stream f es o3 Determinsitically zips elements with the specified function, terminating
when the ends of both branches are reached naturally, padding the left
branch with `pad1` and padding the right branch with `pad2` as necessary.
Totality: total
Visibility: exportzipAll : o1 -> o2 -> Stream f es o1 -> Stream f es o2 -> Stream f es (o1, o2) `zipAllWith` specialized to returning a pair of values
Totality: total
Visibility: exportzipWith : (o1 -> o2 -> o3) -> Stream f es o1 -> Stream f es o2 -> Stream f es o3 Deterministically zips elements, terminating when the end
of either branch is reached naturally.
Totality: total
Visibility: exportzip : Stream f es o1 -> Stream f es o2 -> Stream f es (o1, o2) `zipAll` specialized to returning a pair of values
Totality: total
Visibility: export
Fixity Declaration: infixr operator, level 6zipRight : Stream f es o1 -> Stream f es o2 -> Stream f es o2- Totality: total
Visibility: export zipLeft : Stream f es o1 -> Stream f es o2 -> Stream f es o1- Totality: total
Visibility: export hzip : All (Stream f es) ts -> Stream f es (HList ts) Zips the values in a heterogeneous list of streams.
Totality: total
Visibility: export0 HZipFun : List Type -> Type -> Type- Totality: total
Visibility: public export happly : HZipFun ts r -> HList ts -> r- Totality: total
Visibility: export hzipWith : HZipFun ts r -> All (Stream f es) ts -> Stream f es r Zips the given streams applying the resulting heterogeneous
lists of values to the given function.
Totality: total
Visibility: export