2024-01-15 17:40:34 +03:00
|
|
|
---
|
|
|
|
source: tests/golden_tests.rs
|
2024-05-15 01:25:46 +03:00
|
|
|
input_file: tests/golden_tests/encode_pattern_match/match_syntax.bend
|
2024-01-15 17:40:34 +03:00
|
|
|
---
|
2024-05-18 15:01:20 +03:00
|
|
|
Scott
|
2024-05-10 22:42:32 +03:00
|
|
|
(head) = λa (a λb λ* b List_/Nil)
|
2024-02-07 18:19:07 +03:00
|
|
|
|
2024-05-10 22:42:32 +03:00
|
|
|
(List_/Cons) = λa λb λc λ* (c a b)
|
2024-03-19 20:37:30 +03:00
|
|
|
|
2024-05-10 22:42:32 +03:00
|
|
|
(List_/Nil) = λ* λb b
|
2024-05-18 15:01:20 +03:00
|
|
|
|
|
|
|
NumScott
|
|
|
|
(head) = λa (a λb switch b { 0: λc λ* c; _: λ* List_/Nil; })
|
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(List_/Cons) = λa λb λc (c List_/Cons/tag a b)
|
2024-05-18 15:01:20 +03:00
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(List_/Nil) = λa (a List_/Nil/tag)
|
|
|
|
|
|
|
|
(List_/Cons/tag) = 0
|
|
|
|
|
|
|
|
(List_/Nil/tag) = 1
|