Link Search Menu Expand Document

PSet overview

Added in v0.1.0


Table of contents


utils

PSet (interface)

Typeclass for persistent sets.

Signature

export interface PSet<S extends URIS, A> {
  readonly empty: Kind<S, A>
  readonly insert: (a: A, s: Kind<S, A>) => Kind<S, A>
  readonly member: (a: A, s: Kind<S, A>) => boolean

  // Not part of Okasaki's original specification
  readonly union: (s: Kind<S, A>, t: Kind<S, A>) => Kind<S, A>
  readonly fromArray: (xs: Array<A>) => Kind<S, A>
  readonly toArray: (s: Kind<S, A>) => Array<A>
}

Added in v0.1.0