2021-08-24 21:33:27 +03:00
|
|
|
structural type Foo0 = Foo0
|
|
|
|
structural type Foo1 a = Foo1 a
|
|
|
|
structural type Foo2 a b = Foo2 a b
|
|
|
|
structural type Foo3 a b c = Foo3 a b c
|
2018-08-16 18:34:37 +03:00
|
|
|
|
|
|
|
use Foo0 Foo0
|
|
|
|
use Foo1 Foo1
|
|
|
|
use Foo2 Foo2
|
|
|
|
|
2020-02-07 05:29:43 +03:00
|
|
|
x = match Foo0 with
|
2018-08-16 18:34:37 +03:00
|
|
|
Foo0 -> 1
|
|
|
|
|
2020-02-07 05:29:43 +03:00
|
|
|
y = match Foo1 1 with
|
2018-08-16 18:34:37 +03:00
|
|
|
Foo1 1 -> 0
|
|
|
|
Foo1 _ -> 10
|
|
|
|
|
2020-02-07 05:29:43 +03:00
|
|
|
z = match Foo2 1 "hi" with
|
2018-08-16 18:34:37 +03:00
|
|
|
Foo2 1 "hi" -> 1
|
2023-01-18 17:50:15 +03:00
|
|
|
Foo2 x "bye" -> x
|
|
|
|
_ -> bug "unexpected"
|
2018-08-16 18:34:37 +03:00
|
|
|
|
2019-03-08 20:56:02 +03:00
|
|
|
> z
|