summaryrefslogtreecommitdiff
path: root/test/c/option_nest.sail
blob: 995bf0747b0d8d575deef791c847ad5dfbe546b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
union test ('a : Type) = {
  Just : 'a,
  Nothing : unit 
}

union option ('a : Type) = {
  None : unit,
  Some : 'a
}

val "print_endline" : string -> unit

function main() : unit -> unit = {
  let _ : test(option(int)) = Just(None());
  let Just(Some(x)) = Just(Some("test"));
  print_endline(x)
}