Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Year of OCaml?

Name: Anonymous 2015-05-28 4:58

We have recently gotten or will be soon getting, in no particular order:

# multicore (no more GIL)
# flambda
# GC tuning for real time systems
# algebraic effects
# modular implicits

Are we kicking ass yet?

Name: Anonymous 2015-05-31 5:42

>>4,24,etc
$ tail -5 look-ma-no-hands.ml
let a = 1 + 2
let b = 2.2 + 3.3
let _ = print a
let _ = print b
let _ = "Have a nice day!" |> print_endline

$ ocaml ./look-ma-no-hands.ml
3
5.5
Have a nice day!


Not featured: +., ; or ;;

Try it yourself at: https://andrewray.github.io/iocamljs/modimp.html

Full disclosure:
$ head -33 look-ma-no-hands.ml
module type Num = sig
type t
val add : t -> t -> t
end

let (+) (implicit N : Num) = N.add

implicit module Num_int = struct
type t = int
let add = Pervasives.(+)
end

implicit module Num_float = struct
type t = float
let add = Pervasives.(+.)
end

module type Show = sig
type t
val show : t -> unit
end

let print (implicit S : Show) x = S.show x

implicit module Show_int = struct
type t = int
let show x = string_of_int x |> print_endline
end

implicit module Show_int = struct
type t = float
let show x = string_of_float x |> print_endline
end

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List