Closed hhugo closed 3 years ago
Does it pose a particular problem to you ? Formally the fmt
library does not depend on unix
, only fmt.tty
does.
The ocaml runtime has
caml_sys_isatty
which is what you want. It is used in the compiler but not exported in theStdlib
. Maybe it should.
Can't dig out the discussion but I think there was agreement when it was introduced that it would not.
I discovered this Unix
dependency while working on https://github.com/mirage/alcotest/pull/326 because of a missing primitives in jsoo needed for Unix.descr_of_out_channel on windows. It is fixed in https://github.com/ocsigen/js_of_ocaml/commit/0687e19072d11d038790f62e1d3bcdb181494980.
This is not blocking me right now, I've just opened the issue because I saw an opportunity to reduce the set of dependencies.
I'm not too keen to depend on primitives that are not publicly exposed.
I'll let you decide what to do with this issue then.
I don't mind dropping the dependency if the primitive gets exposed in the stdlib (it would also certainly be very useful for cmdliner). So you know what to do now ;–)
(Also I'm willing to use the primitive as soon as it gets clear that it will be exposed in the stdlib)
As far as I can see,
Fmt
only depends on unix for itsisatty
feature. The ocaml runtime hascaml_sys_isatty
which is what you want. It is used in the compiler but not exported in theStdlib
. Maybe it should.