build with ocamlbuild by default
[deriving.git] / tests / inline.ml
bloba15fe2524fee230a5c287ae98d0ceef8bb38fb9d
1 (*pp deriving *)
3 let _ =
4 Eq.eq<bool> true false
7 let _ =
8 Show.show<(bool * string) list option>
9 (Some ([true, "yes";
10 false, "no"]))
13 let _ =
14 [Typeable.mk<int> 3;
15 Typeable.mk<float> 3.0;
16 Typeable.mk<int list> [1;2;3]]
18 type 'a seq = [`Nil | `Cons of 'a * 'a seq]
19 deriving (Typeable)
21 type nil = [`Nil]
22 deriving (Typeable)
23 type intlist = ([nil| `Cons of int * 'a ] as 'a)
24 deriving (Typeable)
26 let _ =
27 Typeable.throwing_cast<intlist>
28 (Typeable.mk<int seq> (`Cons (1, `Cons (2, `Cons (3, `Nil)))))
30 let _ =
31 Eq.eq<bool> true (Eq.eq<int> 3 4)
33 let _ =
34 print_endline "Tests succeeded!"