Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import and use new modules in ocaml?

I am unable to use module Extstring.

like image 386
priyanka Avatar asked Jan 25 '26 07:01

priyanka


1 Answers

If you are running the toplevel, you need to have exstring.cmo in its path (the simple way is to run ocaml in the same directory as extstring.cmo). Then, you can do:

# #load "extstring.cmo";;
# Extstring.split "a.b" '.' 2;;
[..]
like image 58
Thomas Avatar answered Jan 28 '26 15:01

Thomas