Domanda

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

How can I import them?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top