Skip to main content Link Search Menu Expand Document (external link)

StreamHaltStrategy overview

Added in v2.0.0


Table of contents


constructors

Both

Signature

export declare const Both: HaltStrategy

Added in v2.0.0

Either

Signature

export declare const Either: HaltStrategy

Added in v2.0.0

Left

Signature

export declare const Left: HaltStrategy

Added in v2.0.0

Signature

export declare const Right: HaltStrategy

Added in v2.0.0

fromInput

Signature

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

Added in v2.0.0

folding

match

Folds over the specified HaltStrategy using the provided case functions.

Signature

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

Added in v2.0.0

models

Both (interface)

Signature

export interface Both {
  readonly _tag: "Both"
}

Added in v2.0.0

Either (interface)

Signature

export interface Either {
  readonly _tag: "Either"
}

Added in v2.0.0

HaltStrategy (type alias)

Signature

export type HaltStrategy = Left | Right | Both | Either

Added in v2.0.0

HaltStrategyInput (type alias)

Signature

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

Added in v2.0.0

Left (interface)

Signature

export interface Left {
  readonly _tag: "Left"
}

Added in v2.0.0

Right (interface)

Signature

export interface Right {
  readonly _tag: "Right"
}

Added in v2.0.0

refinements

isBoth

Signature

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

Added in v2.0.0

isEither

Signature

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

Added in v2.0.0

isLeft

Signature

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

Added in v2.0.0

isRight

Signature

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

Added in v2.0.0