Polymorphic variants compose naturally by design, eg:
let foo = Error(#FooError)
let bar = foo->Result.flatMap(foo => switch foo {
| 0 => Error(#Zero)
| other => Ok(other)
})
Why do you need the module functions then?
Polymorphic variants compose naturally by design, eg:
let foo = Error(#FooError)
let bar = foo->Result.flatMap(foo => switch foo {
| 0 => Error(#Zero)
| other => Ok(other)
})
Why do you need the module functions then?