on 492ae2f help sign in
40 lines 585 B history raw
1### `++turn`
3Gate to list
5Accepts a `++list` `a` and a gate `b`. Produces a list with the gate applied
6to each element of the original list.
8Accepts
9-------
11`b` is a gate.
13Produces
14--------
16A list.
18Source
19------
21 ++ turn :: transform
22 ~/ %turn
23 |* {a/(list) b/$-(* *)}
24 |-
25 ?~ a ~
26 [i=(b i.a) t=$(a t.a)]
29Examples
30--------
32 ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
33 <|h o o n|>
34 ~zod/try=> =a |=(a/@ (add a 4))
35 ~zod/try=> (turn (limo [1 2 3 4 ~]) a)
36 ~[5 6 7 8]
40***