3 ms·
Rust manages it without HKT quite reasonably (rather than implementing generic monads, it has the `?` operator, which is syntax-sugar for something like [0]), t
by vertex-four 10y ago
Rust manages it without HKT quite reasonably (rather than implementing generic monads, it has the `?` operator, which is syntax-sugar for something like [0]), though sum types are a necessity.
[0] match whatever { Ok(v) => v, Err(e) => return Err(From::from(e)) }
- lmm 10y agoAh, last I knew they were relying on macros. Still, ? is an ugly special case where with HKT it could be a reusable general operator.
- vertex-four 10y agoAbsolutely - there's currently discussion around a Carrier trait which would make it generic, once we have some variety of HKT. Still, it's good enough for now, and any future development of it will be backwards-compatible.