1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
let _ =
Eq.eq<bool> true false
let _ =
Show.show<(bool * string) list option>
(Some ([true, "yes";
false, "no"]))
let _ =
[Typeable.mk<int> 3;
Typeable.mk<float> 3.0;
Typeable.mk<int list> [1;2;3]]
type 'a seq = [`Nil | `Cons of 'a * 'a seq]
deriving (Typeable)
type nil = [`Nil]
deriving (Typeable)
type intlist = ([nil| `Cons of int * 'a ] as 'a)
deriving (Typeable)
let t1 = Lazy.force (Typeable.type_rep<intlist>)
let t2 = Lazy.force (Typeable.type_rep<int seq>)
let _ = Deriving_Typeable.TypeRep.eq t1 t2
let _ =
Typeable.throwing_cast<int seq>
(Typeable.mk<intlist> (`Cons (1, `Cons (2, `Cons (3, `Nil)))))
let _ =
Eq.eq<bool> true (Eq.eq<int> 3 4)
let _ =
print_endline "Tests succeeded!"
|