2023-12-13 20:08:49 +03:00
|
|
|
---
|
|
|
|
source: tests/golden_tests.rs
|
2024-05-15 01:25:46 +03:00
|
|
|
input_file: tests/golden_tests/encode_pattern_match/concat_def.bend
|
2023-12-13 20:08:49 +03:00
|
|
|
---
|
2024-05-18 15:01:20 +03:00
|
|
|
Scott
|
2024-05-29 10:15:13 +03:00
|
|
|
(concat) = λa (a λb b λd λe λf (String/Cons d (concat e f)))
|
2024-02-07 18:19:07 +03:00
|
|
|
|
2024-05-15 21:23:26 +03:00
|
|
|
(main) = (concat (String/Cons 97 (String/Cons 98 String/Nil)) (String/Cons 99 (String/Cons 100 String/Nil)))
|
2024-02-09 20:08:25 +03:00
|
|
|
|
2024-05-18 15:01:20 +03:00
|
|
|
(String/Nil) = λa λ* a
|
2024-02-07 18:19:07 +03:00
|
|
|
|
2024-05-18 15:01:20 +03:00
|
|
|
(String/Cons) = λa λb λ* λd (d a b)
|
|
|
|
|
|
|
|
NumScott
|
2024-05-29 10:15:13 +03:00
|
|
|
(concat) = λa (a λb switch b { 0: λc c; _: λ* λe λf λg (String/Cons e (concat f g)); })
|
2024-05-18 15:01:20 +03:00
|
|
|
|
|
|
|
(main) = (concat (String/Cons 97 (String/Cons 98 String/Nil)) (String/Cons 99 (String/Cons 100 String/Nil)))
|
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(String/Nil) = λa (a String/Nil/tag)
|
2024-05-18 15:01:20 +03:00
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(String/Cons) = λa λb λc (c String/Cons/tag a b)
|
|
|
|
|
|
|
|
(String/Nil/tag) = 0
|
|
|
|
|
|
|
|
(String/Cons/tag) = 1
|