OCaml's utop: importing external modules

1.3k views Asked by At

I'm interested in introducing Angstrom, a parsing combinator library, to a project of mine.

I installed Angstrom to my system with opam as follows:

$> opam install angstrom

I also successfully compiled the project with reference to the module in question using ocamlfind:

$> ocamlbuild -use-ocamlfind -pkgs 'angstrom' project.byte

Surprisingly, I'm having trouble importing Angstrom to the utop repl. Commands like #open Angstrom indicate a value bound to the module name. I have searched for documentation of module imports from the repl, but I haven't found the result that I'm looking for.

What's the best way to reference an external module from utop?

1

There are 1 answers

0
David Shaked On BEST ANSWER

I found an answer to my question. From utop:

utop # #require "angstrom";;
utop # open Angstrom;;

My apologies for perhaps posting prematurely, but hopefully someone will find this answer helpful in the future.