Question

I want to use the functions that come with the List and String modules in OCaml.

How can I import them?

Était-ce utile?

La solution

The standard modules are available just by naming them. You can use the functions by prefixing with the module name:

# List.length [1;2;3;4;5];;
- : int = 5
# String.length "12345";;
- : int = 5

There are quite a few other ways to handle the naming, but this is the basic one that you should start with.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top