Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Try

Callable

  • Try<A>(value: () => A): Try<A>
  • Type parameters

    • A

    Parameters

    • value: () => A
        • (): A
        • Returns A

    Returns Try<A>

Index

Functions

ap

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

apply

  • apply<A>(value: () => A): Try<A>
  • Type parameters

    • A

    Parameters

    • value: () => A
        • (): A
        • Returns A

    Returns Try<A>

failed

failure

  • failure<A>(value: Error): Try<A>

filter

  • filter<A>(p: (a: A) => boolean, a: Try<A>): Try<A>
  • Type parameters

    • A

    Parameters

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

          • a: A

          Returns boolean

    • a: Try<A>

    Returns Try<A>

flatMap

  • flatMap<A, B>(f: (x: A) => Try<B>, a: Try<A>): Try<B>

flatten

  • flatten<A>(a: Try<A>): Try<A>

fold

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

    • A

    • B

    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

    • a: Try<A>

    Returns B

forEach

  • forEach<A>(fn: (a: A) => any, a: Try<A>): void
  • Type parameters

    • A

    Parameters

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

          • a: A

          Returns any

    • a: Try<A>

    Returns void

get

  • get<A>(a: Try<A>): A

getOrElse

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

    • A

    • B

    Parameters

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

    • a: Try<A>

    Returns A | B

isFailure

  • isFailure<A>(a: Try<A>): boolean

isSuccess

  • isSuccess<A>(a: Try<A>): boolean

map

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

    • A

    • B

    Parameters

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

          • x: A

          Returns B

    • a: Try<A>

    Returns Try<B>

of

  • of<A>(value: A): Try<A>

orElse

recover

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

    • A

    • B

    Parameters

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

          • x: Error

          Returns Try<B>

    • a: Try<A>

    Returns Try<B>

success

  • success<A>(value: A): Try<A>

Generated using TypeDoc