Equivalence of ML types


(* user-defined types *)
type meters = float;;

type feet = float;;

let length1:meters = 5.1;;

let length2:feet = 8.8;;

length1 +. length2;;

let convert_cm x:meters =
x *. 100.0;;

convert_cm length1;;

convert_cm length2;;

(* types with the same constructor - the last one overwrites *)
type 'a list = Empty | Node of 'a * 'a list;;

type 'a tree = Empty | Node of 'a * 'a tree * 'a tree;;

Empty;;

CSci 4651 course.