3

I thought I set this up correctly, like explained on realworldocaml, but when I try to do

open Core;;

I get

Unbound module Core

I think this is related to .ocamlinit, but I don't know what else should I add / remove from it.

#use "topfind";;
#thread;;
#camlp4o;;
#require "core.top";;
#require "core.syntax";;
#require "ppx_jane";;

(* Added by OPAM. *)
let () =
  try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
  with Not_found -> ()
;;

I don't really understand if that try should be the first thing in the file (but I tried both version and I have the same result). What am I missing here?

I looked over this question, but my situation isn't like that (I don't get all those errors, only the Unbound module one).

Community
  • 1
  • 1
icebp
  • 1,608
  • 1
  • 14
  • 24

1 Answers1

1

You ocamlinit is fine, so you either didn't install the core library at all, or didn't activate opam, if you're using it. Make sure, that you did the following:

eval $(opam config env)
opam install core
coretop

and then in the REPL, you can do

open Core.Std;;
ivg
  • 34,431
  • 2
  • 35
  • 63