type-plus icon indicating copy to clipboard operation
type-plus copied to clipboard

use Maybe type for error handling (Fail case)

Open unional opened this issue 1 year ago • 2 comments

NumericStruct.Add<NumericStruct.FromNumeric<A, Fail>, NumericStruct.FromNumeric<B, Fail>>
//              ^ fail as input not accepting `Fail`

Instead of:

type NumericStruct.Add<A extends NumericStruct, B extends NumericStruct> ...

Accept Maybe<NumericStruct> and propagate the error.

This will simplify many implementation.

unional avatar May 29 '23 20:05 unional