Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Option<A>

Used to represent an optional value

Type parameters

  • A

Hierarchy

Index

Properties

Abstract asEither

Converts an Option to an Either

Abstract isNone

isNone: boolean

Returns true if the instance is None

Accessors

isSome

  • get isSome(): boolean

Methods

Abstract chain

  • chain<B>(ab: function): Option<B>

Abstract fold

  • fold<S>(S: S, FN: function): S
  • Takes a seed S value and applies the FN if this is Some Returns the seed S if this is None

    Type parameters

    • S

    Parameters

    • S: S
    • FN: function
        • (r: A, s: S): S
        • Parameters

          • r: A
          • s: S

          Returns S

    Returns S

Abstract getOrElse

  • getOrElse(A: A): A

map

  • map<B>(ab: function): Option<B>

Static fromEither

Static isNone

  • isNone<A>(A: Option<A>): boolean

Static isSome

  • isSome<A>(A: Option<A>): boolean

Static none

Static some

Generated using TypeDoc