Class Right<B>

An Ior with a right-hand value.

Type Parameters

  • out B

Hierarchy

Constructors

Properties

kind: RIGHT = Kind.RIGHT

The property that discriminates Ior.

val: B

The value of this Ior.

Methods

  • Combine the values of this and that Ior.

    Type Parameters

    Parameters

    • this: Ior<A, B>
    • that: Ior<A, B>

    Returns Ior<A, B>

    Remarks

    When combined, left-hand values and right-hand values are combined pairwise. Combination is lossless and merges values into Both when there is no existing value to combine with.

  • Compare this and that Ior to determine their ordering.

    Type Parameters

    • A extends Ord<A>

    • B extends Ord<B>

    Parameters

    • this: Ior<A, B>
    • that: Ior<A, B>

    Returns Ordering

    Remarks

    When ordered, Left always compares as less than Right, and Right always compares as less than Both. If the variants are the same, their value(s) are compared to determine the ordering. Both compares left-hand values and right-hand values lexicographically.

  • Compare this and that Ior to determine their equality.

    Type Parameters

    • A extends Eq<A>

    • B extends Eq<B>

    Parameters

    • this: Ior<A, B>
    • that: Ior<A, B>

    Returns boolean

    Remarks

    Two Ior are equal if they are the same variant and their value(s) is (are) equal.

  • Returns Generator<Ior<never, B>, B, unknown>

  • If this Ior has a right-hand value, ignore the value and return that Ior.

    Type Parameters

    Parameters

    • this: Ior<A, any>
    • that: Ior<A, B1>

    Returns Ior<A, B1>

  • If this Ior has a right-hand value, apply a function to the value to return another Ior.

    Type Parameters

    Parameters

    • this: Ior<A, B>
    • f: ((val) => Ior<A, B1>)
        • (val): Ior<A, B1>
        • Parameters

          • val: B

          Returns Ior<A, B1>

    Returns Ior<A, B1>

  • If this Ior has a right-hand value, apply a generator function to the value to return another Ior.

    Type Parameters

    Parameters

    • this: Ior<A, B>
    • f: ((val) => Ior.Go<A, B1>)
        • (val): Ior.Go<A, B1>
        • Parameters

          • val: B

          Returns Ior.Go<A, B1>

    Returns Ior<A, B1>

  • Test whether this Ior is Both.

    Type Parameters

    • A

    • B

    Parameters

    • this: Ior<A, B>

    Returns this is Both<A, B>

  • If this Ior has a left-hand value, apply a function to map the value.

    Type Parameters

    • A

    • B

    • A1

    Parameters

    • this: Ior<A, B>
    • f: ((val) => A1)
        • (val): A1
        • Parameters

          • val: A

          Returns A1

    Returns Ior<A1, B>

  • If this Ior has a right-hand value, apply a function to map the value.

    Type Parameters

    • A

    • B

    • B1

    Parameters

    • this: Ior<A, B>
    • f: ((val) => B1)
        • (val): B1
        • Parameters

          • val: B

          Returns B1

    Returns Ior<A, B1>

  • Apply one of three functions to extract the value(s) out of this Ior depending on the variant.

    Type Parameters

    • A

    • B

    • T1

    • T2

    • T3

    Parameters

    • this: Ior<A, B>
    • unwrapLeft: ((val) => T1)
        • (val): T1
        • Parameters

          • val: A

          Returns T1

    • unwrapRight: ((val) => T2)
        • (val): T2
        • Parameters

          • val: B

          Returns T2

    • unwrapBoth: ((fst, snd) => T3)
        • (fst, snd): T3
        • Parameters

          • fst: A
          • snd: B

          Returns T3

    Returns T1 | T2 | T3

  • If this and that Ior have right-hand values, apply a function to combine the values.

    Type Parameters

    Parameters

    • this: Ior<A, B>
    • that: Ior<A, B1>
    • f: ((lhs, rhs) => B2)
        • (lhs, rhs): B2
        • Parameters

          • lhs: B
          • rhs: B1

          Returns B2

    Returns Ior<A, B2>

Generated using TypeDoc