6

I mean this module : Option

I can't find it, open Option gives me Error: Unbound module Option and there is no 'option.cma' file

Is it in the standard library ? Is it named 'option.cma' ?

1 Answer 1

9

This is not part of the OCaml standard library, no. It looks like it might be part of a former library named Extlib. Extlib, in turn, seems to have become part of OCaml Batteries Included. The Option module is now named BatOption.

If you want this module, you should get OCaml Batteries Included. Then you need to tell the OCaml compiler how to find the library. It will be explained in the installation instructions for Batteries.

4
  • thanks for the answer, didn't know Batteries; Is this lib designed to be the next standard library, some sort of Boost for ocaml?
    – codablank1
    Mar 28, 2012 at 19:49
  • 2
    As I understand it, it's not intended to be a standard part of the OCaml distribution. But this is good, it means that it can be improved independently of the compiler itself. It's intended to be a standard, I guess you could say. It seems to have good acceptance among OCaml coders. Mar 28, 2012 at 19:53
  • 7
    Batteries and Jane Street's Core are the two libraries currently considered to be the main "standard" libraries for OCaml. However both are distributed separately from ocaml itself. ExtLib is no longer recommended since Batteries has absorbed it fully. Mar 28, 2012 at 20:41
  • 1
    Is there a way to get the Option library without using Batteries? Like, can I write opam install (something) to get it?
    – sshine
    Aug 25, 2018 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.