2024-01-12 17:45:39 +03:00
|
|
|
---
|
|
|
|
source: tests/golden_tests.rs
|
2024-05-15 01:25:46 +03:00
|
|
|
input_file: tests/golden_tests/encode_pattern_match/is_some_some.bend
|
2024-01-12 17:45:39 +03:00
|
|
|
---
|
2024-05-18 15:01:20 +03:00
|
|
|
Scott
|
2024-02-13 22:34:32 +03:00
|
|
|
(some_some) = λa (a λb (b λ* 1 0) 0)
|
2024-02-07 18:19:07 +03:00
|
|
|
|
2024-05-10 22:42:32 +03:00
|
|
|
(main) = (some_some (Option/Some 1))
|
2024-02-09 20:08:25 +03:00
|
|
|
|
2024-05-10 22:42:32 +03:00
|
|
|
(Option/Some) = λa λb λ* (b a)
|
2024-03-19 20:37:30 +03:00
|
|
|
|
2024-05-10 22:42:32 +03:00
|
|
|
(Option/None) = λ* λb b
|
2024-05-18 15:01:20 +03:00
|
|
|
|
|
|
|
NumScott
|
|
|
|
(some_some) = λa (a λb switch b { 0: λc (c λd switch d { 0: λ* 1; _: λ* 0; }); _: λ* 0; })
|
|
|
|
|
|
|
|
(main) = (some_some (Option/Some 1))
|
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(Option/Some) = λa λb (b Option/Some/tag a)
|
2024-05-18 15:01:20 +03:00
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(Option/None) = λa (a Option/None/tag)
|
|
|
|
|
|
|
|
(Option/Some/tag) = 0
|
|
|
|
|
|
|
|
(Option/None/tag) = 1
|