type-plus
type-plus copied to clipboard
use Maybe type for error handling (Fail case)
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.