2title = "2n: Functional Hacks"
11Build `f` such that `(f x) .= (b (a x))`.
22 ++ cork |*([a=_|=(* **) b=gate] (corl b a))
28 > (:(cork dec dec dec) 20)
31 > =mal (mo (limo a+15 b+23 ~))
32 > ((cork ~(got by mal) dec) %a)
35 > ((cork ~(got by mal) dec) %b)
56 |* [a=gate b=_|=(* **)]
57 =< +:|.((a (b))) :: span check
65 > ((corl (lift bex) (slat %ud)) '2')
74Right-curry a gate, binding the tail of its sample
98 > =tep (curr scan sym)
111Curry a gate, binding the head of its sample
148Demands that a specific type be produced, crashing the program if it is
165 > ((hard (list)) (limo [1 2 3 ~]))
167 > ((hard @) (add 2 2))
169 > ((hard @t) (crip "Tape to cord, bro!"))
171 > ((hard tape) (crip "...Tape to cord, bro?..."))
182Politely requests a specific type to be produced, producing null if it
190 |= fud=* ^- (unit han)
192 ?.(=(gol fud) ~ [~ gol])
198 > ((soft %4) (add 2 2))
201 > ((soft @) (add 2 2))
204 > ((soft %5) (add 2 2))
207 > ((soft @t) (crip "Tape to cord, Woohoo!"))
208 [~ 'Tape to cord, Woohoo!']
210 > ((soft @t) (trip 'Cmon man... Tape to cord? Please?!'))
220Produces the head of a cell.
254Produces the same value that it was given.
288Produces a stack trace if the stack trace isn't null, then produces the other
305 ?~(a same ~>(%slog.[pri i.a] $(a t.a)))
311 > =+ result=((slog [%leaf "error-message"]~) [12 13]) [%product result]
317`slog` is intended to be put in the middle of a bunch of chained function
318calls that string a piece of data through them, so that an error message will be
319printed if there's one to print.
326Ends the program and produces a `tang` tracing error message.
349 > ~>(%mean.[%leaf "fuse-loop"] !!)
359Produces the tail of a cell.
393Checks if `a` and `b` are equal, producing a flag.
408 ++ test |=(^ =(+<- +<+))
420 > (test "hello" 'hello')
423 > (test "hello" ['h' 'e' 'l' 'l' 'o' ~])
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