4 ms·
Algebraic datatypes, which naturally begets Option and Either, predate OCaml.
by Munksgaard 5y ago
Algebraic datatypes, which naturally begets Option and Either, predate OCaml.
- pjmlp 5y agoI am fully aware of it, I was just making the point that it wasn't invented by Rust as the title suggests, and first versions of Rust were written in OCaml, hence why I chose that ML flavour for the example. If you want to go pedatic we can start discussing the type theory papers they appear on.
- linkdd 5y agoWhen I say "inspired by Rust Result type", I mean the function names. I could implement map/fmap/bind/lift/unlift/return/... But I choosed and_then/or_else/unwrap/...