OCaml By Examples



**utop** is OCaml's [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) (referred to as a *toplevel* in OCaml): an interactive program that allows you to quickly test OCaml commands.
$ opam install utop
$ utop


In utop, you can experiment with code, load libraries and debug modules. Note that nothing gets executed unless you write `;;` to indicate that things should get executed.
utop # 1 + 1;;
- : int = 2

utop # 1 = 1;;
- : bool = true


Libraries are by default not accessible in utop, unless you write `#require "library_name";;`.<br> As Core is a standard library replacement you can enter these few lines in your `~/.ocamlinit` file to initialize utop with Core automatically.
#use "topfind";;
#require "core.top";;
open Core;;
next: values