Two simple declarations:

let x = 3 let f x = x + 1

and, after compilation with ocamlc -i example.ml, their types:

val x : int val f : int -> int

Then, building on these definitions:

let y = f 3
val y : int

What about compiler error messages?:

let z = 3 + "four"

They are also detected:

File "example.ml", line 1, characters 12-18: Error: This expression has type string but an expression was expected of type int

We can continue on from earlier examples:

let z = f y
val z : int

This document was translated from LATEX by HEVEA.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.