Skip to content

StreamHaltStrategy

16 exports Added in v2.0.0 Source

Constructors

Both

Added in v2.0.0 Source

Signature

declare const Both: HaltStrategy;

Either

Added in v2.0.0 Source

Signature

declare const Either: HaltStrategy;

fromInput

Added in v2.0.0 Source

Signature

declare const fromInput: (input: HaltStrategyInput) => HaltStrategy;

Left

Added in v2.0.0 Source

Signature

declare const Left: HaltStrategy;

Right

Added in v2.0.0 Source

Signature

declare const Right: HaltStrategy;

Folding

match

Added in v2.0.0 Source

Folds over the specified HaltStrategy using the provided case functions.

Signature

declare const match: {
  <Z>(options: {
    readonly onBoth: () => Z;
    readonly onEither: () => Z;
    readonly onLeft: () => Z;
    readonly onRight: () => Z;
  }): (self: HaltStrategy) => Z;
  <Z>(
    self: HaltStrategy,
    options: {
      readonly onBoth: () => Z;
      readonly onEither: () => Z;
      readonly onLeft: () => Z;
      readonly onRight: () => Z;
    },
  ): Z;
};

Models

Both interface

Added in v2.0.0 Source

Signature

interface Both {
  readonly _tag: "Both";
}

Either interface

Added in v2.0.0 Source

Signature

interface Either {
  readonly _tag: "Either";
}

HaltStrategy type

Added in v2.0.0 Source

Signature

type HaltStrategy = Left | Right | Both | Either;

HaltStrategyInput type

Added in v2.0.0 Source

Signature

type HaltStrategyInput = HaltStrategy | "left" | "right" | "both" | "either";

Left interface

Added in v2.0.0 Source

Signature

interface Left {
  readonly _tag: "Left";
}

Right interface

Added in v2.0.0 Source

Signature

interface Right {
  readonly _tag: "Right";
}

Refinements

isBoth

Added in v2.0.0 Source

Signature

declare const isBoth: (self: HaltStrategy) => self is Both;

isEither

Added in v2.0.0 Source

Signature

declare const isEither: (self: HaltStrategy) => self is Either;

isLeft

Added in v2.0.0 Source

Signature

declare const isLeft: (self: HaltStrategy) => self is Left;

isRight

Added in v2.0.0 Source

Signature

declare const isRight: (self: HaltStrategy) => self is Right;