Function unzip

  • Type safe function to unzip an option of a tuple of 2 into a tuple of 2 options.

    Type Parameters

    • A

      Any type

    • B

      Any type

    Parameters

    • opt: Option<[A, B]>

      Option to unzip

    Returns OptionDuo<A, B>

    a tuple of 2 options.

    Example

    const opt: Option<[number, string]> = Option.Some([10, 'foo'])
    const [optA, optB] =unzip(opt)
    optA.unwrap() === 10 // true
    optB.unwrap() === 'foo' // true

Generated using TypeDoc