2title = "2n: Functional Hacks"
11`+aftr` first takes gate `a`, producing a wet gate. The new wet gate then takes `b`, producing the inverted pair of `[b a]`. This is the inverted version of [+fore](#fore).
15`a` is a gate, and the sample of `+aftr`.
17`b` is a gate, and the sample of `(aftr a)`.
26++ aftr |*(a=$-(* *) |*(b=$-(* *) (pair b a)))
43Build `f` such that `(f x) .= (b (a x))`.
54++ cork |*([a=$-(* *) b=$-(* *)] (corl b a))
60 > (:(cork dec dec dec) 20)
63 > `@ub`(bex (met 0 23))
66 > `@ub`((cork (cury met 0) bex) 23)
88 |* [a=$-(* *) b=$-(* *)]
89 =< +:|.((a (b))) :: type check
98 > ((corl (lift bex) (slat %ud)) '2')
108Right-curry a gate, binding the tail of its sample
133 > =tep (curr scan sym)
147Curry a gate, binding the head of its sample
186`+fore` first takes gate `a`, producing a wet gate. The new wet gate then takes `b`, producing the pair of `[a b]`.
190`a` is a gate, and is the sample of `+fore`.
192`b` is a gate, and is the sample of `(fore a)`.
201++ fore |*(a=$-(* *) |*(b=$-(* *) (pair a b)))
218Produces the head of a cell.
253Produces the same value that it was given.
317Produces the tail of a cell.
352Checks if `a` and `b` are equal, producing a flag.
367++ test |=(^ =(+<- +<+))
379 > (test "hello" 'hello')
382 > (test "hello" ['h' 'e' 'l' 'l' 'o' ~])
392`(lead a)` produces a wet gate, then `((lead a) b)` produces `[a b]`.
396`a` is a noun, and is the sample of `+lead`.
398`b` is a noun, and is the sample of `((lead a) b)`
407++ lead |*(* |*(* [+>+< +<]))
424`(late a)` produces a wet gate, then `((late a) b)` produces the inverted cell `[b a]`. This is the inverted version of [+lead](#lead).
428`a` is a noun, and is the sample of `+late`.
430`b` is a noun, and is the sample of `(late a)`.
439++ late |*(* |*(* [+< +>+<]))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list