Take
Constructors
Creates a Take with the specified chunk.
Signature
declare const chunk: <A>(chunk: Chunk.Chunk<A>) => Take<A>Creates a failing Take with the specified defect.
Signature
declare const die: (defect: unknown) => Take<never>dieMessage
Creates a failing Take with the specified error message.
Signature
declare const dieMessage: (message: string) => Take<never>Represents the end-of-stream marker.
Signature
declare const end: Take<never>Creates a failing Take with the specified error.
Signature
declare const fail: <E>(error: E) => Take<never, E>Creates a failing Take with the specified cause.
Signature
declare const failCause: <E>(cause: Cause.Cause<E>) => Take<never, E>fromEffect
Creates an effect from Effect<A, E, R> that does not fail, but succeeds with
the Take<A, E>. Error from stream when pulling is converted to
Take.failCause. Creates a single value chunk.
Signature
declare const fromEffect: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<Take<A, E>, never, R>Creates a Take from an Exit.
Signature
declare const fromExit: <A, E>(exit: Exit.Exit<A, E>) => Take<A, E>Creates effect from Effect<Chunk<A>, Option<E>, R> that does not fail, but
succeeds with the Take<A, E>. Errors from stream when pulling are converted
to Take.failCause, and the end-of-stream is converted to Take.end.
Signature
declare const fromPull: <A, E, R>(pull: Effect.Effect<Chunk.Chunk<A>, Option.Option<E>, R>) => Effect.Effect<Take<A, E>, never, R>Constructs a Take.
Signature
declare const make: <A, E>(exit: Exit.Exit<Chunk.Chunk<A>, Option.Option<E>>) => Take<A, E>Creates a Take with a single value chunk.
Signature
declare const of: <A>(value: A) => Take<A>Destructors
Transforms a Take<A, E> to an Effect<A, E>.
Signature
declare const done: <A, E>(self: Take<A, E>) => Effect.Effect<Chunk.Chunk<A>, Option.Option<E>>Folds over the failure cause, success value and end-of-stream marker to yield a value.
Signature
declare const match: { <Z, E, Z2, A, Z3>(options: { readonly onEnd: () => Z; readonly onFailure: (cause: Cause.Cause<E>) => Z2; readonly onSuccess: (chunk: Chunk.Chunk<A>) => Z3; }): (self: Take<A, E>) => Z | Z2 | Z3; <A, E, Z, Z2, Z3>(self: Take<A, E>, options: { readonly onEnd: () => Z; readonly onFailure: (cause: Cause.Cause<E>) => Z2; readonly onSuccess: (chunk: Chunk.Chunk<A>) => Z3; }): Z | Z2 | Z3;}matchEffect
Effectful version of Take.fold.
Folds over the failure cause, success value and end-of-stream marker to yield an effect.
Signature
declare const matchEffect: { <Z, E2, R, E, Z2, R2, A, Z3, E3, R3>(options: { readonly onEnd: Effect.Effect<Z, E2, R>; readonly onFailure: (cause: Cause.Cause<E>) => Effect.Effect<Z2, E2, R2>; readonly onSuccess: (chunk: Chunk.Chunk<A>) => Effect.Effect<Z3, E3, R3>; }): (self: Take<A, E>) => Effect<Z | Z2 | Z3, E2 | E | E3, R | R2 | R3>; <A, E, Z, E2, R, Z2, R2, Z3, E3, R3>(self: Take<A, E>, options: { readonly onEnd: Effect.Effect<Z, E2, R>; readonly onFailure: (cause: Cause.Cause<E>) => Effect.Effect<Z2, E2, R2>; readonly onSuccess: (chunk: Chunk.Chunk<A>) => Effect.Effect<Z3, E3, R3>; }): Effect<Z | Z2 | Z3, E | E2 | E3, R | R2 | R3>;}Getters
Checks if this take is done (Take.end).
Signature
declare const isDone: <A, E>(self: Take<A, E>) => booleanChecks if this take is a failure.
Signature
declare const isFailure: <A, E>(self: Take<A, E>) => booleanChecks if this take is a success.
Signature
declare const isSuccess: <A, E>(self: Take<A, E>) => booleanMapping
Models
Other
Sequencing
Returns an effect that effectfully "peeks" at the success of this take.
Signature
declare const tap: { <A, X, E2, R>(f: (chunk: Chunk<A>) => Effect<X, E2, R>): <E>(self: Take<A, E>) => Effect<void, E2 | E, R>; <A, E, X, E2, R>(self: Take<A, E>, f: (chunk: Chunk<A>) => Effect<X, E2, R>): Effect<void, E | E2, R>;}Symbols
TakeTypeId
Signature
declare const TakeTypeId: unique symbolTakeTypeId type
Signature
type TakeTypeId = typeof TakeTypeId