2006-07-18 04:58:44 -07:00
|
|
|
type t = A of t * t | B;;
|
|
|
|
type t2 = C of (t2 * t2) | D;;
|
|
|
|
type 'a t3 = S of 'a | T;;
|
|
|
|
|
|
|
|
fun B B B -> ();;
|
|
|
|
|
|
|
|
fun B (A (B, B)) B -> ();;
|
|
|
|
|
|
|
|
fun D (D, D) -> ();;
|
|
|
|
|
|
|
|
fun (C (D, D)) -> ();;
|
|
|
|
|
|
|
|
let A (b, B) = A (B, B);;
|
|
|
|
|
|
|
|
let f (A (B, B)) = ();;
|
|
|
|
|
|
|
|
let f B (A (B, B)) = ();;
|
|
|
|
|
|
|
|
let (D, d) = (D, D);;
|
|
|
|
|
|
|
|
let (C (D, d)) = (C (D, D));;
|
|
|
|
|
|
|
|
function S S T -> ();;
|
|
|
|
|
|
|
|
function Some (A (B, B)) -> ();;
|
|
|
|
|
|
|
|
function S (A (B, B)) -> ();;
|
|
|
|
|
|
|
|
function S (D, D) -> ();;
|
|
|
|
|
|
|
|
function (C (D, D)) -> ();;
|
|
|
|
|
2006-07-17 07:05:28 -07:00
|
|
|
function
|
|
|
|
| Some Some Some x -> x
|
|
|
|
(* | None None None x -> x *)
|
|
|
|
| _ -> assert false;;
|
|
|
|
|
|
|
|
fun None None None -> ();;
|
|
|
|
|
|
|
|
fun (Some None) None None -> ();;
|
|
|
|
|
2006-07-17 15:32:39 -07:00
|
|
|
let Some a = Some 42;;
|
|
|
|
let Some a :: y = [Some 42];;
|
|
|
|
let Some a, b = Some 42, 43;;
|
|
|
|
let (Some a), b = Some 42, 43;;
|
|
|
|
let Some a as b = let _ = b = 42 in Some 42;;
|
|
|
|
(* let Some (a as b) = let _ = b = None in Some 42;; *)
|
|
|
|
(* let Some (a as b) = let _ = b = 42 in Some 42;; *)
|
|
|
|
(* let (Some a) as b = let _ = b = 42 in Some 42;; *)
|
|
|
|
(* let (Some a) as b = let _ = b = None in Some 42;; *)
|
|
|
|
let Some a | Some a = Some 42;;
|
2006-07-18 04:58:44 -07:00
|
|
|
let x,y as r = 1,2 ;;
|
|
|
|
let ((x, y) as r) = (1, 2);;
|
|
|
|
|
|
|
|
type top = Top of (int * int);;
|
|
|
|
|
|
|
|
match Top (1,2) with Top min as t -> ();;
|
|
|
|
|
|
|
|
match Top (1,2) with Top (min,max) as t -> ();;
|
|
|
|
|
2006-07-17 15:32:39 -07:00
|
|
|
(* let Some 'a' .. 'b' = Some 'b';; *)
|
|
|
|
|
|
|
|
let rec f x y = ();;
|
|
|
|
|
|
|
|
fun x y -> ();;
|
|
|
|
|
2006-07-18 04:58:44 -07:00
|
|
|
fun (x, y) -> ();;
|
2006-07-17 15:32:39 -07:00
|
|
|
|
|
|
|
function x, y -> ();;
|
|
|
|
|
|
|
|
let rec next line pos0 = () in ();;
|
|
|
|
|
|
|
|
(* fun Some None None None -> ();; *)
|
2006-07-18 04:58:44 -07:00
|
|
|
(* fun x, y -> ();; |+ syntax error +| *)
|
|
|
|
|