3 ms·
I guess the closest thing to what you want in Ocaml is modular implicits. http://tycon.github.io/modular-implicits.html http://tycon.github.io/modular-implicits
by chillee 9y ago
I guess the closest thing to what you want in Ocaml is modular implicits. http://tycon.github.io/modular-implicits.html http://tycon.github.io/modular-implicits.html
As far as the tradeoff, my view on types is a bit different than yours, I think. First, a quick note:
> specify manually all the types of all the functions
This is usually encouraged in OCaml, in the form of a .mli file.
I think types can be a lot more than "compiler checked documentation that can also work as basic tests". They allow you to encode invariants that allow the compiler to check more than basic stuff. I thought this video had a good example. https://www.youtube.com/watch?v=-J8YyfrSwTk&t=20m10s https://www.youtube.com/watch?v=-J8YyfrSwTk&t=20m10s
- nnq 9y agowow, that video rocks! thx!