summaryrefslogtreecommitdiff
path: root/test/c/poly_pair.sail
blob: 7c86062dd0ce477f6675ce5b174960c8da440570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
default Order dec

val print = "print_endline" : string -> unit

val eq_int = { lem: "eq", _: "eq_int" } : (int, int) -> bool

union test('a : Type, 'b : Type) = {
  Ctor1 : ('a, 'b),
  Ctor2 : int
}

val main : unit -> unit

function main() = {
  let x = Ctor1(3, 2);
  match x {
    Ctor1(y, z) if eq_int(y, 3) => print("1"),
    _ => print("2")
  };
}