record ChunkSize : Type Pulls and streams produce their output in chunks (lists of value)
for reasons of efficiency, because the whole streaming machinery
comes with quite a bit of a performance overhead.
Many functions for generating pure streams
and pulls therefore take an auto-implicit value of type `ChunkSize`.
If not provided explicitly, this defaults to 128.
Totality: total
Visibility: public export
Constructor: CS : (size : Nat) -> {auto 0 _ : IsSucc size} -> ChunkSize
Projections:
0 .prf : ({rec:0} : ChunkSize) -> IsSucc (size {rec:0}) .size : ChunkSize -> Nat
Hints:
ChunkSize Eq ChunkSize Ord ChunkSize Show ChunkSize
.size : ChunkSize -> Nat- Totality: total
Visibility: public export size : ChunkSize -> Nat- Totality: total
Visibility: public export 0 .prf : ({rec:0} : ChunkSize) -> IsSucc (size {rec:0})- Totality: total
Visibility: public export 0 prf : ({rec:0} : ChunkSize) -> IsSucc (size {rec:0})- Totality: total
Visibility: public export fromInteger : Integer -> ChunkSize- Totality: total
Visibility: export defaultChunkSize : ChunkSize- Totality: total
Visibility: public export data SplitRes : Type -> Type- Totality: total
Visibility: public export
Constructors:
Middle : c -> c -> SplitRes c All : Nat -> SplitRes c
interface Chunk : Type -> Type -> Type A `Chunk c o` is a container type `c` holding elements of type `o`.
Examples include `List a` with element type `a` and `ByteString` with
element type `Bits8`.
Parameters: c, o
Constraints: Monoid c
Methods:
unfoldChunk : ChunkSize => (s -> Either r (o, s)) -> s -> UnfoldRes r s c replicateChunk : ChunkSize => o -> c isEmpty : c -> Bool unconsChunk : c -> Maybe (o, Maybe c) splitChunkAt : Nat -> c -> SplitRes c breakChunk : BreakInstruction -> (o -> Bool) -> c -> BreakRes c filterChunk : (o -> Bool) -> c -> Maybe c
Implementations:
Chunk (List a) a Chunk ByteString Bits8
unfoldChunk : Chunk c o => ChunkSize => (s -> Either r (o, s)) -> s -> UnfoldRes r s c- Totality: total
Visibility: public export replicateChunk : Chunk c o => ChunkSize => o -> c- Totality: total
Visibility: public export isEmpty : Chunk c o => c -> Bool- Totality: total
Visibility: public export unconsChunk : Chunk c o => c -> Maybe (o, Maybe c)- Totality: total
Visibility: public export splitChunkAt : Chunk c o => Nat -> c -> SplitRes c- Totality: total
Visibility: public export breakChunk : Chunk c o => BreakInstruction -> (o -> Bool) -> c -> BreakRes c- Totality: total
Visibility: public export filterChunk : Chunk c o => (o -> Bool) -> c -> Maybe c- Totality: total
Visibility: public export nonEmpty : Chunk c o => c -> Maybe c- Totality: total
Visibility: export unfold : ChunkSize => Chunk c o => s -> (s -> Either r (o, s)) -> Pull f c es r Like `unfold` but generates chunks of values of up to the given size.
Totality: total
Visibility: exportfill : ChunkSize => (0 c : Type) -> Chunk c o => o -> Pull f c es () Like `P.fill` but generates chunks of values of up to the given size.
Totality: total
Visibility: exportiterate : ChunkSize => (0 c : Type) -> Chunk c o => o -> (o -> o) -> Pull f c es () Like `P.iterate` but generates chunks of values of up to the given size.
Totality: total
Visibility: exportreplicate : ChunkSize => (0 c : Type) -> Chunk c o => Nat -> o -> Stream f es c Like `P.replicate` but generates chunks of values of up to the given size.
Totality: total
Visibility: exportuncons : Chunk c o => Pull f c es r -> Pull f q es (Either r (o, Pull f c es r)) Splits the very first element from the head of a `Pull`
Totality: total
Visibility: exportsplitAt : Chunk c o => Nat -> Pull f c es r -> Pull f c es (Pull f c es r) Emits the first `n` elements of a `Pull`, returning the remainder.
Totality: total
Visibility: exporttake : Chunk c o => Nat -> Pull f c es r -> Pull f c es () Emits the first `n` elements of a `Pull`, returning the remainder.
Totality: total
Visibility: exportlimit : Chunk c o => Has e es => Lazy e -> Nat -> Pull f c es r -> Pull f c es r Like `take` but limits the number of emitted values.
This fails with the given error in case the limit is exceeded.
Totality: total
Visibility: exportdrop : Chunk c o => Nat -> Pull f c es r -> Pull f c es r Drops the first `n` elements of a `Pull`, returning the
remainder.
Totality: total
Visibility: exporthead : Chunk c o => Pull f c es r -> Pull f c es () Emits the first element of a `Pull`, returning the remainder.
Totality: total
Visibility: exporttail : Chunk c o => Pull f c es r -> Pull f c es r Discards the first element of a `Pull`.
Totality: total
Visibility: exportbreakFull : Chunk c o => (r -> Pull f c es r) -> BreakInstruction -> (o -> Bool) -> Pull f c es r -> Pull f c es (Pull f c es r) Breaks a pull as soon as the given predicate returns `True` for
an emitted element.
`orElse` determines what to do if the pull is exhausted before any
splitting of output occurred.
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 : Chunk c o => Has e es => Lazy e -> BreakInstruction -> (o -> Bool) -> Pull f c es r -> Pull f c es (Pull f c es r) Like `breakFull` but fails with an error if the `Pull` is
exhausted before the prediate returns `True`.
Totality: total
Visibility: exporttakeUntil : Chunk c o => BreakInstruction -> (o -> Bool) -> Pull f c es r -> Stream f es c 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 : Chunk c o => (o -> Bool) -> Pull f c es r -> Stream f es c Emits values until the given predicate returns `False`,
returning the remainder of the `Pull`.
Totality: total
Visibility: exporttakeThrough : Chunk c o => (o -> Bool) -> Pull f c es r -> Stream f es c Like `takeWhile` but also includes the first failure.
Totality: total
Visibility: exportdropUntil : Chunk c o => BreakInstruction -> (o -> Bool) -> Pull f c es r -> Pull f c 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 : Chunk c o => (o -> Bool) -> Pull f c es r -> Pull f c es r Drops values from a stream while the given predicate returns `True`,
returning the remainder of the stream.
Totality: total
Visibility: exportdropThrough : Chunk c o => (o -> Bool) -> Pull f c es r -> Pull f c es r Like `dropWhile` but also drops the first value where
the predicate returns `False`.
Totality: total
Visibility: exportsplit : Chunk c o => (o -> Bool) -> Pull f c es r -> Pull f (List c) es r Splits a stream of chunks whenever an element fulfills the given
predicate.
Totality: total
Visibility: exportmapMaybe : (o -> Maybe p) -> Pull f (List o) es r -> Pull f (List p) es r Maps elements of output via a partial function.
Totality: total
Visibility: exportfilter : Chunk c o => (o -> Bool) -> Pull f c es r -> Pull f c es r Element-wise filtering of a stream of chunks.
Totality: total
Visibility: exportfilterNot : Chunk c o => (o -> Bool) -> Pull f c es r -> Pull f c es r Element-wise filtering of a stream of chunks.
Totality: total
Visibility: exportmapOutput : Functor t => (o -> p) -> Pull f (t o) es r -> Pull f (t p) es r Maps a function over all elements emitted by a pull.
Totality: total
Visibility: exportfold : Foldable t => (p -> o -> p) -> p -> Pull f (t o) es r -> Pull f p es r- Totality: total
Visibility: export foldPair : Foldable t => (p -> o -> p) -> p -> Pull f (t 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: exportfoldGet : Foldable t => (p -> o -> p) -> p -> Stream f es (t o) -> Pull f q es p Convenience version of `foldPair` for working on streams.
Totality: total
Visibility: exportfold1 : Foldable t => Chunk (t o) o => (o -> o -> o) -> Pull f (t 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 : Foldable t => (o -> Bool) -> Pull f (t o) es r -> Stream f es Bool Returns `True` if all emitted values of the given stream fulfill
the given predicate
Totality: total
Visibility: exportany : Foldable t => (o -> Bool) -> Pull f (t 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 : Foldable t => Num o => Pull f (t o) es r -> Pull f o es r Emits the sum over all elements emitted by a `Pull`.
Totality: total
Visibility: exportcount : Foldable t => Pull f (t o) es r -> Pull f Nat es r Emits the number of elements emitted by a `Pull`.
Totality: total
Visibility: exportmaximum : Foldable t => Chunk (t o) o => Ord o => Pull f (t o) es r -> Pull f o es r Emits the largest output encountered.
Totality: total
Visibility: exportminimum : Foldable t => Chunk (t o) o => Ord o => Pull f (t o) es r -> Pull f o es r Emits the smallest output encountered.
Totality: total
Visibility: exportmappend : Foldable t => Chunk (t o) o => Semigroup o => Pull f (t o) es r -> Pull f o es r Emits the smallest output encountered.
Totality: total
Visibility: exportfoldMap : Foldable t => Monoid m => (o -> m) -> Pull f (t 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: exportinterface Scan : (Type -> Type) -> Type- Parameters: f
Constraints: Functor f
Methods:
scanChunk : (s -> o -> (p, s)) -> s -> f o -> (f p, s)
Implementation: Scan List
scanChunk : Scan f => (s -> o -> (p, s)) -> s -> f o -> (f p, s)- Totality: total
Visibility: public export scan : Scan t => s -> (s -> o -> (p, s)) -> Pull f (t o) es r -> Pull f (t p) es r Computes a stateful running total over all elements emitted by a
pull.
Totality: total
Visibility: exportzipWithScan : Scan t => p -> (p -> o -> p) -> Pull f (t o) es r -> Pull f (t (o, p)) es r Zips the input with a running total according to `s`, up to but
not including the current element. Thus the initial
`vp` value is the first emitted to the output:
Totality: total
Visibility: exportzipWithScan1 : Scan t => p -> (p -> o -> p) -> Pull f (t o) es r -> Pull f (t (o, p)) es r Like `zipWithScan` but the running total is including the current element.
Totality: total
Visibility: exportzipWithIndex : Scan t => Pull f (t o) es r -> Pull f (t (o, Nat)) es r Pairs each element in the stream with its 0-based index.
Totality: total
Visibility: exportzipWithCount : Scan t => Pull f (t o) es r -> Pull f (t (o, Nat)) es r Pairs each element in the stream with its 1-based count.
Totality: total
Visibility: exportrunningCount : Scan t => Pull f (t o) es r -> Pull f (t Nat) es r Emits the count of each element.
Totality: total
Visibility: exportdata ZipRes : Type -> Type -> Type -> Type- Totality: total
Visibility: public export
Constructors:
ZB : List c -> ZipRes a b c ZL : List a -> List c -> ZipRes a b c ZR : List b -> List c -> ZipRes a b c
zipAllWith : o1 -> o2 -> (o1 -> o2 -> o3) -> Stream f es (List o1) -> Stream f es (List o2) -> Stream f es (List 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 (List o1) -> Stream f es (List o2) -> Stream f es (List (o1, o2)) `zipAllWith` specialized to returning a pair of values
Totality: total
Visibility: exportzipWith : (o1 -> o2 -> o3) -> Stream f es (List o1) -> Stream f es (List o2) -> Stream f es (List o3) Deterministically zips elements, terminating when the end
of either branch is reached naturally.
Totality: total
Visibility: exportzip : Stream f es (List o1) -> Stream f es (List o2) -> Stream f es (List (o1, o2)) `zipAll` specialized to returning a pair of values
Totality: total
Visibility: export
Fixity Declaration: infixr operator, level 6zipRight : Stream f es (List o1) -> Stream f es (List o2) -> Stream f es (List o2)- Totality: total
Visibility: export zipLeft : Stream f es (List o1) -> Stream f es (List o2) -> Stream f es (List o1)- Totality: total
Visibility: export