Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • A

Hierarchy

  • Some

Implements

Index

Constructors

constructor

  • new Some(value: A): Some
  • Parameters

    • value: A

    Returns Some

Properties

_A

_A: A

_URI

_URI: URI

_tag

_tag: "Some"

value

value: A

Methods

alt

  • Parameters

    Returns Option<A>

ap

  • Type parameters

    • B

    Parameters

    Returns Option<B>

ap_

  • Type parameters

    • B

    • C

    Parameters

    Returns Option<C>

chain

  • chain<B>(f: function): Option<B>
  • Type parameters

    • B

    Parameters

    • f: function

    Returns Option<B>

concat

  • Parameters

    Returns function

contains

  • contains(S: Setoid<A>, a: A): boolean
  • Returns true if the option has an element that is equal (as determined by S) to a, false otherwise

    Parameters

    Returns boolean

equals

  • equals(S: Setoid<A>): function
  • Parameters

    Returns function

      • Parameters

        Returns boolean

exists

  • exists(p: function): boolean
  • Returns true if this option is non empty and the predicate p returns true when applied to this Option's value

    Parameters

    • p: function
        • (a: A): boolean
        • Parameters

          • a: A

          Returns boolean

    Returns boolean

extend

  • extend<B>(f: function): Option<B>
  • Type parameters

    • B

    Parameters

    • f: function

    Returns Option<B>

filter

  • Returns this option if it is non empty and the predicate p return true when applied to this Option's value. Otherwise returns None

    Parameters

    Returns Option<A>

fold

  • fold<B>(n: Lazy<B>, s: function): B
  • Type parameters

    • B

    Parameters

    • n: Lazy<B>
    • s: function
        • (a: A): B
        • Parameters

          • a: A

          Returns B

    Returns B

getOrElse

  • getOrElse(f: Lazy<A>): A
  • Parameters

    Returns A

getOrElseValue

  • getOrElseValue(value: A): A
  • Parameters

    • value: A

    Returns A

inspect

  • inspect(): string
  • Returns string

isNone

  • isNone(): boolean
  • Returns true if the option is None, false otherwise

    Returns boolean

isSome

  • isSome(): boolean
  • Returns true if the option is an instance of Some, false otherwise

    Returns boolean

map

  • map<B>(f: function): Option<B>
  • Type parameters

    • B

    Parameters

    • f: function
        • (a: A): B
        • Parameters

          • a: A

          Returns B

    Returns Option<B>

mapNullable

  • mapNullable<B>(f: function): Option<B>
  • Maps f over this Option's value. If the value returned from f is null or undefined, returns None

    Type parameters

    • B

    Parameters

    • f: function
        • (a: A): B | null | undefined
        • Parameters

          • a: A

          Returns B | null | undefined

    Returns Option<B>

partitionMap

  • partitionMap<L, R>(f: function): object
  • Type parameters

    • L

    • R

    Parameters

    • f: function

    Returns object

reduce

  • reduce<B>(f: function, b: B): B
  • Type parameters

    • B

    Parameters

    • f: function
        • (b: B, a: A): B
        • Parameters

          • b: B
          • a: A

          Returns B

    • b: B

    Returns B

toNullable

  • toNullable(): A | null
  • Returns A | null

toString

  • toString(): string
  • Returns string

toUndefined

  • toUndefined(): A | undefined
  • Returns A | undefined

traverse

  • Type parameters

    Parameters

    Returns function

      • Type parameters

        • L

        • B

        Parameters

        • f: function
            • Parameters

              • a: A

              Returns HKT2As<F, L, B>

        Returns HKT2As<F, L, Option<B>>

  • Type parameters

    Parameters

    Returns function

      • Type parameters

        • B

        Parameters

        • f: function
            • Parameters

              • a: A

              Returns HKTAs<F, B>

        Returns HKTAs<F, Option<B>>

  • Type parameters

    • F

    Parameters

    Returns function

      • Type parameters

        • B

        Parameters

        • f: function
            • (a: A): HKT<F, B>
            • Parameters

              • a: A

              Returns HKT<F, B>

        Returns HKT<F, Option<B>>

wilt

  • Type parameters

    • M

    Parameters

    Returns function

      • <L, R>(f: function): HKT<M, object>
      • Type parameters

        • L

        • R

        Parameters

        Returns HKT<M, object>

Generated using TypeDoc