Pregunta

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

How can I import them?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top