OCaml is an actively used programming language created in 1996.

23Years Old 31,421Users 2Jobs

Example code from the Hello World Collection:

(* Hello World in OCaml *)

print_string "Hello World!\n";;

Example code from Linguist:

 * Copyright (c) 2013 Jeremy Yallop.
 * This file is distributed under the terms of the MIT License.
 * See the file LICENSE for details.

let string_of format v = 
  let buf = Buffer.create 100 in
  let fmt = Format.formatter_of_buffer buf in begin
    format fmt v;
    Format.pp_print_flush fmt ();
    Buffer.contents buf

Example code from Wikipedia:

fun x_1 -> (x_1 *
     let y_3 = 
         let y_2 = (x_1 * 1)
         in (y_2 * y_2)
     in (y_3 * y_3))

Last updated February 11th, 2019