2024-01-19 22:06:19 +03:00
|
|
|
---
|
|
|
|
source: tests/golden_tests.rs
|
2024-05-15 01:25:46 +03:00
|
|
|
input_file: tests/golden_tests/encode_pattern_match/match_adt_unscoped_lambda.bend
|
2024-01-19 22:06:19 +03:00
|
|
|
---
|
2024-05-18 15:01:20 +03:00
|
|
|
Scott
|
2024-05-10 22:42:32 +03:00
|
|
|
(main) = (Maybe/Some 1 λ$x * λa a $x)
|
2024-02-13 22:34:32 +03:00
|
|
|
|
2024-05-10 22:42:32 +03:00
|
|
|
(Maybe/None) = λa λ* a
|
2024-03-19 20:37:30 +03:00
|
|
|
|
2024-05-10 22:42:32 +03:00
|
|
|
(Maybe/Some) = λa λ* λc (c a)
|
2024-05-18 15:01:20 +03:00
|
|
|
|
|
|
|
NumScott
|
|
|
|
(main) = (Maybe/Some 1 λa switch a { 0: λ$x *; _: λ* λb b; } $x)
|
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(Maybe/None) = λa (a Maybe/None/tag)
|
2024-05-18 15:01:20 +03:00
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(Maybe/Some) = λa λb (b Maybe/Some/tag a)
|
|
|
|
|
|
|
|
(Maybe/None/tag) = 0
|
|
|
|
|
|
|
|
(Maybe/Some/tag) = 1
|