Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Either<L, R>

A class to represent something that can be one value or the other.

Type parameters

  • L

  • R

Hierarchy

  • Either

Implements

Index

Methods

apply

equals

  • equals(m: Either<L, R>): boolean

fmap

  • fmap<B>(func: function): Either<L, B>

getOr

  • getOr(r: R): R

isLeft

  • isLeft(): boolean

isRight

  • isRight(): boolean

map

  • map<B>(func: function): Either<L, B>
  • Lifts functions into the Either type.

    Type parameters

    • B

    Parameters

    • func: function
        • (r: R): B
        • Parameters

          • r: R

          Returns B

    Returns Either<L, B>

Static Left

  • Left<L, R>(l: L): Either<L, R>

Static Right

  • Right<L, R>(r: R): Either<L, R>

Static fromMaybe

  • If the value is Just something, turn it into a Right. If the value is Nothing, use the provided default as a Left.

    Type parameters

    • L

    • R

    Parameters

    Returns Either<L, R>

Static fromNullable

  • fromNullable<L, R>(l: L, r?: R): Either<L, R>
  • Type parameters

    • L

    • R

    Parameters

    • l: L
    • Optional r: R

    Returns Either<L, R>

Generated using TypeDoc