on 5e6a67f help sign in
43 lines 675 B history raw
1### `++murn`
3Maybe transform
5Passes each member of `++list` `a` to gate `b`, which must produce a
6`++unit`. Produces a new list with all the results that do not produce
7`~`.
9Accepts
10-------
12`a` is a list.
14`b` is a gate that produces a unit.
16Produces
17--------
19A unit.
21Source
22------
24 ++ murn :: maybe transform
25 ~/ %murn
26 |* {a/(list) b/$-(* (unit))}
27 |-
28 ?~ a ~
29 =+ c=(b i.a)
30 ?~ c
31 $(a t.a)
32 [i=u.c t=$(a t.a)]
34Examples
35--------
37 ~zod/try=> =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
38 ~zod/try=> (murn (limo [0 1 2 3 ~]) a)
39 [i=12 t=[i=13 t=~]]
43***