OCaml explicit type signatures

OCaml has two ways of specifying types, they can be done inline:

let intEq (x : int) (y : int) : bool = ...

or they can be placed in an interface file, as you have done:

val intEq : int -> int -> bool

I believe the latter is preferred, since it more cleanly separates the specification (type) from the implementation (code).


References: OCaml for Haskellers

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)