darklang / tablecloth

A standard library with the same API in F#, Rescript and OCaml

Home Page:https://www.tablecloth.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make build gives me an error.

shubhamkumar13 opened this issue · comments

I followed the developer setup guide -> https://github.com/darklang/tablecloth#developing.

And I got an error in native/src/TableclothMap.ml

sk@pop-os:~/tablecloth (master)$ make build
make[1]: Entering directory '/home/sk/tablecloth'

Building tablecloth-native ...
opam config exec -- dune build
File "native/src/TableclothMap.ml", line 100, characters 20-29:
100 |           | true -> `Fst data
                          ^^^^^^^^^
Error: This expression has type [> `Fst of 'a ]
       but an expression was expected of type ('b, 'c) Base.Either.t
Done: 436/455 (jobs: 1)make[1]: *** [Makefile:3: build-native] Error 1
make[1]: Leaving directory '/home/sk/tablecloth'
make: *** [Makefile:12: build] Error 2

Looking at the source code made me realize that nothing is wrong. This function is dependent on Base.Map.partition_mapi which emits a tuple -> http://binaryanalysisplatform.github.io/bap/api/odoc/base/Base/Map/index.html#val-partition_mapi

So I cannot see what's going on here, any suggestions would be helpful :)

It looks like newer version of base use an Either instead of `Fst and `Snd. See https://ocaml.janestreet.com/ocaml-core/v0.14/doc/base/Base/Map/ vs https://ocaml.janestreet.com/ocaml-core/v0.10/doc/base/Base/Map/.

Not sure how to fix that in a general solution that will work with all versions. It may be that we should just update to the format of the latest version?

This is fixed in #220