Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (14 sloc) 395 Bytes
let u = { re = 1, im = 0 }
;;
let conjugate =
fun f(z : {re:int, im:int}):{re:int, im:int} is
{re = z.re, im = 0 - z.im}
;;
let plus =
fun f(z : {re:int, im:int}) : {re:int, im:int} -> {re:int, im:int} is
fun g(w : {re:int, im:int}) : {re:int, im:int} is
{ re = z.re + w.re, im = z.im + w.im }
;;
plus u (conjugate u)
;;
conjugate {re = 5, im = 7, foo = {}, bar = conjugate}