Skip to content

Instantly share code, notes, and snippets.

@hcarty
Created March 18, 2015 18:21
Show Gist options
  • Save hcarty/0464098413faec3c354e to your computer and use it in GitHub Desktop.
Save hcarty/0464098413faec3c354e to your computer and use it in GitHub Desktop.
ppx_import in .ml from .mli
$ ocamlbuild -classic-display -use-ocamlfind -package ppx_import,ppx_deriving.std test.cma
ocamlfind ocamldep -package ppx_import,ppx_deriving.std -modules test.mli > test.mli.depends
ocamlfind ocamlc -c -package ppx_import,ppx_deriving.std -o test.cmi test.mli
ocamlfind ocamldep -package ppx_import,ppx_deriving.std -modules test.ml > test.ml.depends
ocamlfind ocamlc -c -package ppx_import,ppx_deriving.std -o test.cmo test.ml
+ ocamlfind ocamlc -c -package ppx_import,ppx_deriving.std -o test.cmo test.ml
File "test.ml", line 1, characters 19-25:
Error: Unbound module Test
Command exited with code 2.
type t = [%import: Test.t] [@@deriving create]
type t = {
x : int;
y : int;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment