6 ms·
Ocaml can do this let do_something (thing : Thing.t) (logging : [`With_logging | `No_logging]) = ... Even better, it can even infer the type based on you
by dklsf 11y ago
Ocaml can do this
let do_something (thing : Thing.t) (logging : [`With_logging | `No_logging]) =
...
Even better, it can even infer the type based on you using it (for example matching on it):
let do_something thing logging =
let logging_as_bool =
match logging with
| `With_logging -> true
| `No_logging -> false
in
....