letters icon indicating copy to clipboard operation
letters copied to clipboard

Add support for older OCaml versions

Open mikonieminen opened this issue 4 years ago • 4 comments

The code uses syntax like let (let*) = Lwt.bind in that is supported OCaml 4.08.1 onward. Luckily dune has preprosessing support to enable this syntax with older compilers and we should use it so that we can support also older compiler versions.

More info: https://dune.readthedocs.io/en/stable/concepts.html?highlight=future_Syntax#future-syntax

mikonieminen avatar Jul 10 '20 16:07 mikonieminen

This adds a dependency on https://github.com/ocaml-ppx/ocaml-syntax-shims though. Maybe you could get rid of let* in this package?

joseferben avatar Jul 11 '20 11:07 joseferben

This package is small enough that we could get rid of the let* syntax. On the other hand, it improves readability of the code so it would be nice if we can keep it. What is the drawback of having the added dependency?

mikonieminen avatar Jul 11 '20 11:07 mikonieminen

The added dependency is really small, it has no transitive dependencies. I am more concerned with the added compile step and the complexity it adds and the case when something doesn't work or doesn't work as expected. The current use of let* could be easily replaced with Lwt.map without giving up too much of readability.

joseferben avatar Jul 11 '20 12:07 joseferben

Note that colombe uses the syntax extension too - but for an other purpose than lwt. So, by transitivity, letters requires ocaml-syntax-shims.

dinosaure avatar Jul 15 '20 09:07 dinosaure