Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Failure<A>

Type parameters

  • A

Hierarchy

  • Failure

Implements

  • Functor<A, any, Try<A>>

Index

Constructors

constructor

  • new Failure(value: Error): Failure

Properties

isFailure

isFailure: boolean = true

isSuccess

isSuccess: boolean = false

Readonly type

type: string = "Failure"

Readonly value

value: Error

Methods

ap

  • ap<B>(fa: Try<(a: A) => B>): Try<B>

failed

  • failed(): Try<A> | Try<Error>

filter

  • filter(p: (a: A) => boolean): Try<A>
  • Parameters

    • p: (a: A) => boolean
        • (a: A): boolean
        • Parameters

          • a: A

          Returns boolean

    Returns Try<A>

flatMap

  • flatMap<B>(f: (x: A) => Try<B>): Try<B>
  • Type parameters

    • B: any

    Parameters

    • f: (x: A) => Try<B>
        • (x: A): Try<B>
        • Parameters

          • x: A

          Returns Try<B>

    Returns Try<B>

flatten

  • flatten(): Try<A>

fold

  • fold<B>(f: (x: Error) => B, s: (x: A) => B): B
  • Type parameters

    • B: any

    Parameters

    • f: (x: Error) => B
        • (x: Error): B
        • Parameters

          • x: Error

          Returns B

    • s: (x: A) => B
        • (x: A): B
        • Parameters

          • x: A

          Returns B

    Returns B

forEach

  • forEach(fn: (a: A) => any): void
  • Parameters

    • fn: (a: A) => any
        • (a: A): any
        • Parameters

          • a: A

          Returns any

    Returns void

get

  • get(): A

getOrElse

  • getOrElse<B>(b: () => B): A | B
  • Type parameters

    • B: any

    Parameters

    • b: () => B
        • (): B
        • Returns B

    Returns A | B

map

  • map<B>(f: (x: A) => B): Try<B>
  • Type parameters

    • B: any

    Parameters

    • f: (x: A) => B
        • (x: A): B
        • Parameters

          • x: A

          Returns B

    Returns Try<B>

orElse

recover

  • recover<B>(pf: (x: Error) => Try<B>): Try<B>
  • Type parameters

    • B: any

    Parameters

    • pf: (x: Error) => Try<B>
        • (x: Error): Try<B>
        • Parameters

          • x: Error

          Returns Try<B>

    Returns Try<B>

Generated using TypeDoc