Link Search Menu Expand Document

Unfoldable overview

This class identifies data structures which can be unfolded, generalizing unfold on arrays.

Added in v2.0.0


Table of contents


type classes

Unfoldable (interface)

Signature

export interface Unfoldable<F> {
  readonly URI: F
  readonly unfold: <A, B>(b: B, f: (b: B) => Option<[A, B]>) => HKT<F, A>
}

Added in v2.0.0

Unfoldable1 (interface)

Signature

export interface Unfoldable1<F extends URIS> {
  readonly URI: F
  readonly unfold: <A, B>(b: B, f: (b: B) => Option<[A, B]>) => Kind<F, A>
}

Added in v2.0.0

Unfoldable2 (interface)

Signature

export interface Unfoldable2<F extends URIS2> {
  readonly URI: F
  readonly unfold: <E, A, B>(b: B, f: (b: B) => Option<[A, B]>) => Kind2<F, E, A>
}

Added in v2.0.0

Unfoldable2C (interface)

Signature

export interface Unfoldable2C<F extends URIS2, E> {
  readonly URI: F
  readonly _E: E
  readonly unfold: <A, B>(b: B, f: (b: B) => Option<[A, B]>) => Kind2<F, E, A>
}

Added in v2.0.0

Unfoldable3 (interface)

Signature

export interface Unfoldable3<F extends URIS3> {
  readonly URI: F
  readonly unfold: <R, E, A, B>(b: B, f: (b: B) => Option<[A, B]>) => Kind3<F, R, E, A>
}

Added in v2.0.0

Unfoldable3C (interface)

Signature

export interface Unfoldable3C<F extends URIS3, E> {
  readonly URI: F
  readonly _E: E
  readonly unfold: <R, A, B>(b: B, f: (b: B) => Option<[A, B]>) => Kind3<F, R, E, A>
}

Added in v2.10.0

Unfoldable4 (interface)

Signature

export interface Unfoldable4<F extends URIS4> {
  readonly URI: F
  readonly unfold: <S, R, E, A, B>(b: B, f: (b: B) => Option<[A, B]>) => Kind4<F, S, R, E, A>
}

Added in v2.0.0