2title = "2n: Functional Hacks"
11Build `f` such that `(f x) .= (b (a x))`.
22++ cork |*([a=$-(* *) b=$-(* *)] (corl b a))
28 > (:(cork dec dec dec) 20)
31 > `@ub`(bex (met 0 23))
34 > `@ub`((cork (cury met 0) bex) 23)
55++ corl :: compose backwards
56 |* [a=$-(* *) b=$-(* *)]
57 =< +:|.((a (b))) :: type check
66 > ((corl (lift bex) (slat %ud)) '2')
76Right-curry a gate, binding the tail of its sample
100 > =tep (curr scan sym)
114Curry a gate, binding the head of its sample
152Demands that a specific type be produced, crashing the program if it is
169 > ((hard (list)) (limo [1 2 3 ~]))
171 > ((hard @) (add 2 2))
173 > ((hard @t) (crip "Tape to cord, bro!"))
175 > ((hard tape) (crip "...Tape to cord, bro?..."))
186Politely requests a specific type to be produced, producing null if it
194 |= fud=* ^- (unit han)
196 ?.(=(gol fud) ~ [~ gol])
202 > ((soft %4) (add 2 2))
205 > ((soft @) (add 2 2))
208 > ((soft %5) (add 2 2))
211 > ((soft @t) (crip "Tape to cord, Woohoo!"))
212 [~ 'Tape to cord, Woohoo!']
214 > ((soft @t) (trip 'Cmon man... Tape to cord? Please?!'))
224Produces the head of a cell.
259Produces the same value that it was given.
294Produces a stack trace if the stack trace isn't null, then produces the other
311 ?~(a same ~>(%slog.[pri i.a] $(a t.a)))
317 > =+ result=((slog [%leaf "error-message"]~) [12 13]) [%product result]
323`slog` is intended to be put in the middle of a bunch of chained function
324calls that string a piece of data through them, so that an error message will be
325printed if there's one to print.
333Ends the program and produces a `tang` tracing error message.
356 > ~>(%mean.[%leaf "fuse-loop"] !!)
367Produces the tail of a cell.
402Checks if `a` and `b` are equal, producing a flag.
417 ++ test |=(^ =(+<- +<+))
429 > (test "hello" 'hello')
432 > (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