A categorical programming language
修订版 | dc332465541b5b6ab48bd455a900ca46f277d9a3 (tree) |
---|---|
时间 | 2021-09-17 08:53:44 |
作者 | Corbin <cds@corb...> |
Commiter | Corbin |
Factor out list/filter.
This was the strongest motivating example of a user-defined non-nullary
functor, and I'm pleased to see that it works exactly as imagined.
@@ -1,2 +1 @@ | ||
1 | -(comp list/range | |
2 | - (fold nil (comp (pair (comp fst nat/is_even) (pair cons snd)) pick))) | |
1 | +(comp list/range (list/filter nat/is_even)) |
@@ -0,0 +1 @@ | ||
1 | +(fold nil (comp (pair (comp fst @0) (pair cons snd)) pick)) |