Skip to content

Commit

Permalink
Mention ocaml-print-intf (#2716)
Browse files Browse the repository at this point in the history
* Mention ocaml-print-intf

* Typo

* Apply suggestions from code review

Co-authored-by: Christine Rose <[email protected]>

---------

Co-authored-by: Cuihtlauac ALVARADO <[email protected]>
Co-authored-by: Christine Rose <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2024
1 parent 2efcd88 commit 1052e5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion data/tutorials/language/1ms_00_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,17 @@ module Unit :

The OCaml compiler tool chain can be used to dump an `.ml` file's default interface.
```shell
$ ocamlc -c -i cairo.ml
$ ocamlc -i cairo.ml
val message : string
val hello : unit -> unit
```

You can also use Anil Madhavapeddy's [`ocaml-print-intf`](https://github.com/avsm/ocaml-print-intf) tool to do the same. You have to install it using `opam install ocaml-print-intf`. You can either:
* Call it on a `.cmi` file (Compiled ML Interface): `ocaml-print-intf cairo.cmi`.
* Call it using Dune: `dune exec -- ocaml-print-intf cairo.ml`

If you are using Dune, `.cmi` file are in the `_build` directory. Otherwise, you can compile manually to generate them. The command `ocamlc -c cairo.ml` will create `cairo.cmo` (the executable bytecode) and `cairo.cmi` (the compiled interface). See [Compiling OCaml Projects](docs/compiling-ocaml-projects) for details on compilation without Dune.

### Module Inclusion

Let's say we feel that a function is missing from the `List` module,
Expand Down

0 comments on commit 1052e5a

Please sign in to comment.