3 ms·
Aren't the Ocaml and F# examples relying on some dedicated compiler support for the format string type, though? The Idris example is interesting because its pri
by cannam 9y ago
Aren't the Ocaml and F# examples relying on some dedicated compiler support for the format string type, though? The Idris example is interesting because its printf implementation can actually be written in Idris.
- lower 9y agoThe OCaml implementation used to be hard-coded in the type system, but has now been rewritten (in 4.02, I think) using GADTs. https://ocaml.org/meetings/ocaml/2013/proposals/formats-as-gadts.pdf https://ocaml.org/meetings/ocaml/2013/proposals/formats-as-g... https://caml.inria.fr/mantis/view.php?id=6017 https://caml.inria.fr/mantis/view.php?id=6017 The compiler only does syntactic desugaring of format strings now.