unison/unison-src/tests/pattern-matching2.uu
2018-08-16 11:34:37 -04:00

23 lines
323 B
Plaintext

type Foo0 = Foo0
type Foo1 a = Foo1 a
type Foo2 a b = Foo2 a b
type Foo3 a b c = Foo3 a b c
use Foo0 Foo0
use Foo1 Foo1
use Foo2 Foo2
x = case Foo0 of
Foo0 -> 1
y = case Foo1 1 of
Foo1 1 -> 0
Foo1 _ -> 10
-- text patterns don't work, parse error
z = case Foo2 1 "hi" of
Foo2 x "bye" -> x
Foo2 1 "hi" -> 1
()