The OCaml REPL displays the value and type of any expression. For instance, evaluating:
let rec map f = function
| [] -> []
| x::l -> f x :: map f l;;
Gives:
val map : ('a -> 'b) -> 'a list -> 'b list = <fun>
This is unvaluable for teaching the language.
I am considering switching to Reason, but how would you obtain the same informations?
let rec map = (f) =>
fun
| [] => []
| [x, ...l] => [f(x), ...map(f, l)];
Try Reason doesn't display any type, and I am not sure if there exists a REPL for Reason.