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)))
43Call gate `a`, then call gate `b` with its product.
45This is a wet gate that takes two gates and produces a new gate.
47This is the inverse of [`++corl`](#corl).
58++ cork |*([a=$-(* *) b=$-(* *)] (corl b a))
64> ((cork dec |=(a=@ [a a])) 20)
77Call gate `b`, then call gate `a` with its product.
79This is a wet gate that takes two gates and produces a new gate.
81This is the inverse of [`++cork`](#cork).
93 |* [a=$-(* *) b=$-(* *)]
94 =< +:|.((a (b))) :: type check
103> ((corl |=(a=@ [a a]) dec) 20)
106> ((corl some dec) 20)
112## `++curr` {% #curry %}
116Right-curry a gate, binding the tail of its sample
141 > =tep (curr scan sym)
155Curry a gate, binding the head of its sample
194`+fore` first takes gate `a`, producing a wet gate. The new wet gate then takes `b`, producing the pair of `[a b]`.
198`a` is a gate, and is the sample of `+fore`.
200`b` is a gate, and is the sample of `(fore a)`.
209++ fore |*(a=$-(* *) |*(b=$-(* *) (pair a b)))
226Produces the head of a cell.
261Produces the same value that it was given.
325Produces the tail of a cell.
360Checks if `a` and `b` are equal, producing a flag.
375++ test |=(^ =(+<- +<+))
387 > (test "hello" 'hello')
390 > (test "hello" ['h' 'e' 'l' 'l' 'o' ~])
400`(lead a)` produces a wet gate, then `((lead a) b)` produces `[a b]`.
404`a` is a noun, and is the sample of `+lead`.
406`b` is a noun, and is the sample of `((lead a) b)`
415++ lead |*(* |*(* [+>+< +<]))
432`(late a)` produces a wet gate, then `((late a) b)` produces the inverted cell `[b a]`. This is the inverted version of [+lead](#lead).
436`a` is a noun, and is the sample of `+late`.
438`b` is a noun, and is the sample of `(late a)`.
447++ 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