6Produces the list `a` in reverse order.
47Produces a `++list` whose type is a fork of all the contained types in the
48list `a`. Used when you want to make all the types of the elements of a list the same.
66 |% +- $ ?:(*? ~ [i=(snag 0 a) t=$])
75 [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
80 [i=1 t=[i=2 t=[i=3 t=~]]]
91Produces the length of any `++list` `a` as an atom.
119 > (lent (limo [1 2 3 4 ~]))
121 > (lent (limo [1 'a' 2 'b' (some 10) ~]))
131Computes the Boolean logical "and" on the results of gate `b` applied to each individual element in `++list` `a`.
150 |* {a/(list) b/$-(* ?)}
160 > =a |=(a/@ (lte a 1))
161 > (levy (limo [0 1 2 1 ~]) a)
163 > =a |=(a/@ (lte a 3))
164 > (levy (limo [0 1 2 1 ~]) a)
174Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
188 |* {a/(list) b/$-(* ?)}
197 > =a |=(a=@ (gte a 1))
198 > (lien (limo [0 1 2 1 ~]) a)
200 > =a |=(a=@ (gte a 3))
201 > (lien (limo [0 1 2 1 ~]) a)
211Turns a null-terminated tuple into a [`++list`]().
216`a` is a null-terminated tuple.
229 |% +- $ ?~(a ~ ?:(_? i=-.a t=$ $(a +.a)))
237 [i=1 t=[i=2 t=[i=3 t=~]]]
246Passes each member of `++list` `a` to gate `b`, which must produce a
247`++unit`. Produces a new list with all the results that do not produce
255`b` is a gate that produces a unit.
265 ++ murn :: maybe transform
267 |* {a/(list) b/$-(* (unit))}
278 > =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
279 > (murn (limo [0 1 2 3 ~]) a)
289Replicate: produces a `++list` containing `a` copies of `b`.
315 ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
317 ~[~s1 ~s1 ~s1 ~s1 ~s1]
318 > `@dr`(roll (reap 5 ~s1) add)
328Right fold: moves right to left across a `++list` `a`, recursively slamming
329a binary gate `b` with an element from `a` and an accumulator, producing
330the final value of the accumulator.
340The accumulator, which is a noun.
345 ++ reel :: right fold
347 |* {a/(list) b/_|=({* *} +<+)}
357 > =sum =|([p=@ q=@] |.((add p q)))
358 > (reel (limo [1 2 3 4 5 ~]) sum)
360 > =a =|([p=@ q=@] |.((sub p q)))
361 > (reel (limo [6 3 1 ~]) a)
363 > (reel (limo [3 6 1 ~]) a)
374Left fold: moves left to right across a list `a`, recursively slamming a
375binary [gate]() `b` with an element from the [`++list`]() and an accumulator,
376producing the final value of the accumulator.
381`b` is a binary [gate]().
386The accumulator, which is a [noun]().
393 |* [a=(list) b=_|=([* *] +<+)]
397 $(a t.a, b b(+<+ (b i.a +<+.b)))
402 > =sum =|([p=@ q=@] |.((add p q)))
403 > (roll (limo [1 2 3 4 5 ~]) sum)
405 > =a =|([p=@ q=@] |.((sub p q)))
406 > (roll (limo [6 3 1 ~]) a)
409 > (roll (limo [1 3 6 ~]) a)
419Accepts an atom `a` and [list]() `b`, producing the first `a` elements of
420the front of the list.
430A list of the same type as `b`.
439 ?: |(?=(~ b) =(0 a)) ~
440 [i.b $(b t.b, a (dec a))]
445 > (scag 2 (limo [0 1 2 3 ~]))
447 > (scag 10 (limo [1 2 3 4 ~]))
448 [i=1 t=[i=2 t=[i=3 t=[i=4 t=~]]]]
457Separates a `++list` `a` into two lists - Those elements of `a` who produce
458true when slammed to gate `b` and those who produce `%.n`.
463`b` is a gate that accepts one argument and produces a loobean.
475 |* {a/(list) b/$-(* ?)}
479 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
486 > =a |=(a/@ (gth a 1))
487 > (skid (limo [0 1 2 3 ~]) a)
488 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
497Cycles through the members of a list `a`, passing them to a gate `b` and
498producing a list of all of the members that produce `%.y`. Inverse of
504`b` is a gate that accepts one argument and produces a boolean.
516 |* {a/(list) b/$-(* ?)}
520 ?:((b i.a) [i.a $(a t.a)] $(a t.a))
526 > =a |=(a/@ (gth a 1))
527 > (skim (limo [0 1 2 3 ~]) a)
537Cycles through the members of `++list` `a`, passing them to a gate `b`.
538Produces a list of all of the members that produce `%.n`. Inverse of
544`b` is a gate that accepts one argument and produces a loobean.
549A list of the same type as `a`.
556 |* {a/(list) b/$-(* ?)}
560 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
566 > =a |=(a/@ (gth a 1))
567 > (skip (limo [0 1 2 3 ~]) a)
577Accepts an atom `a` and list `b`, producing the remaining elements from
588A list of the same type as `b`.
605 > (slag 2 (limo [1 2 3 4 ~]))
607 > (slag 1 (limo [1 2 3 4 ~]))
608 [i=2 t=[i=3 t=[i=4 t=~]]]
617Accepts an atom `a` and a `++list` `b`, producing the element at the index
618of `a`and failing if the list is null. Lists are 0-indexed.
628Produces an element of `b`, or crashes if no element exists at that index.
648 > (snag 0 `(list ,@ud)`~[1 2 3 4])
658Quicksort: accepts a `++list` `a` and a gate `b` which accepts two nouns and
659produces a loobean. `++sort` then produces a list of the elements of `a`,
660sorted according to `b`.
665`b` is a gate that ccepts two nouns and produces a boolean.
675 ++ sort !. :: quicksort
677 |* {a/(list) b/$-([* *] ?)}
682 $(a (skim t.a |=(c/_i.a (b c i.a))))
684 [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
690 > =a =|({p=@ q=@} |.((gth p q)))
691 > (sort (limo [0 1 2 3 ~]) a)
701Similar to `substr` in Javascript: extracts a string infix, beginning at
702inclusive index `a`, producing `b` number of characters.
712A list of the same type as `c`.
718 |* {{a/@ b/@} c/(list)}
719 (scag +<-> (slag +<-< c))
725 > (swag [2 5] "roly poly")
727 > (swag [2 2] (limo [1 2 3 4 ~]))
737Accepts a `++list` `a` and a gate `b`. Produces a list with the gate applied
738to each element of the original list.
755 |* {a/(list) b/$-(* *)}
758 [i=(b i.a) t=$(a t.a)]
764 > (turn (limo [104 111 111 110 ~]) ,@t)
766 > =a |=(a/@ (add a 4))
767 > (turn (limo [1 2 3 4 ~]) a)
777Concatenate two `++list`s `a` and `b`.
782`a` and `b` are lists.
787 ++ weld :: concatenate
789 |* {a/(list) b/(list)}
790 => .(a ^.(homo a), b ^.(homo b))
800 ~[~~u ~~r ~~b ~~i ~~t]
801 > (weld (limo [1 2 ~]) (limo [3 4 ~]))
811Concatenate two `++list`s `a` and `b` without losing their type information
829 ++ welp :: perfect weld
844 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
845 [60 61 62 %a %b %c ~]
846 ~zod/arvo=/hoon/hoon>? (welp ~[60 61 62] ~[%a %b %c])
847 [60 61 62 %a %b %c ~]
848 [@ud @ud @ud %a %b %c %~]
849 ~zod/arvo=/hoon/hoon> (welp [sa+1 so+2 ~] si/3)
850 [[%sa 1] [%so 2] %si 3]
859Turns a `++list` of lists into a single list by promoting the elements of
860each sublist into the higher.
889 > (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
890 ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
891 > (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
892 ~[1 97 2 98 3 99 4 100]
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