11Produces the list `a` in reverse order.
52Produces a `++list` whose type is a fork of all the contained types in the
53list `a`. Used when you want to make all the types of the elements of a list the same.
71 |% +- $ ?:(*? ~ [i=(snag 0 a) t=$])
80 [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
85 [i=1 t=[i=2 t=[i=3 t=~]]]
96Produces the length of any `++list` `a` as an atom.
124 > (lent (limo [1 2 3 4 ~]))
126 > (lent (limo [1 'a' 2 'b' (some 10) ~]))
136Computes the Boolean logical "and" on the results of gate `b` applied to each individual element in `++list` `a`.
155 |* {a/(list) b/$-(* ?)}
165 > =a |=(a/@ (lte a 1))
166 > (levy (limo [0 1 2 1 ~]) a)
168 > =a |=(a/@ (lte a 3))
169 > (levy (limo [0 1 2 1 ~]) a)
179Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
193 |* {a/(list) b/$-(* ?)}
202 > =a |=(a=@ (gte a 1))
203 > (lien (limo [0 1 2 1 ~]) a)
205 > =a |=(a=@ (gte a 3))
206 > (lien (limo [0 1 2 1 ~]) a)
216Turns a null-terminated tuple into a [`++list`]().
221`a` is a null-terminated tuple.
234 |% +- $ ?~(a ~ ?:(_? i=-.a t=$ $(a +.a)))
242 [i=1 t=[i=2 t=[i=3 t=~]]]
251Passes each member of `++list` `a` to gate `b`, which must produce a
252`++unit`. Produces a new list with all the results that do not produce
260`b` is a gate that produces a unit.
270 ++ murn :: maybe transform
272 |* {a/(list) b/$-(* (unit))}
283 > =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
284 > (murn (limo [0 1 2 3 ~]) a)
294Replicate: produces a `++list` containing `a` copies of `b`.
320 ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
322 ~[~s1 ~s1 ~s1 ~s1 ~s1]
323 > `@dr`(roll (reap 5 ~s1) add)
333Right fold: moves right to left across a `++list` `a`, recursively slamming
334a binary gate `b` with an element from `a` and an accumulator, producing
335the final value of the accumulator.
345The accumulator, which is a noun.
350 ++ reel :: right fold
352 |* {a/(list) b/_|=({* *} +<+)}
362 > =sum =|([p=@ q=@] |.((add p q)))
363 > (reel (limo [1 2 3 4 5 ~]) sum)
365 > =a =|([p=@ q=@] |.((sub p q)))
366 > (reel (limo [6 3 1 ~]) a)
368 > (reel (limo [3 6 1 ~]) a)
379Left fold: moves left to right across a list `a`, recursively slamming a
380binary [gate]() `b` with an element from the [`++list`]() and an accumulator,
381producing the final value of the accumulator.
386`b` is a binary [gate]().
391The accumulator, which is a [noun]().
398 |* [a=(list) b=_|=([* *] +<+)]
402 $(a t.a, b b(+<+ (b i.a +<+.b)))
407 > =sum =|([p=@ q=@] |.((add p q)))
408 > (roll (limo [1 2 3 4 5 ~]) sum)
410 > =a =|([p=@ q=@] |.((sub p q)))
411 > (roll (limo [6 3 1 ~]) a)
414 > (roll (limo [1 3 6 ~]) a)
424Accepts an atom `a` and [list]() `b`, producing the first `a` elements of
425the front of the list.
435A list of the same type as `b`.
444 ?: |(?=(~ b) =(0 a)) ~
445 [i.b $(b t.b, a (dec a))]
450 > (scag 2 (limo [0 1 2 3 ~]))
452 > (scag 10 (limo [1 2 3 4 ~]))
453 [i=1 t=[i=2 t=[i=3 t=[i=4 t=~]]]]
462Separates a `++list` `a` into two lists - Those elements of `a` who produce
463true when slammed to gate `b` and those who produce `%.n`.
468`b` is a gate that accepts one argument and produces a loobean.
480 |* {a/(list) b/$-(* ?)}
484 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
491 > =a |=(a/@ (gth a 1))
492 > (skid (limo [0 1 2 3 ~]) a)
493 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
502Cycles through the members of a list `a`, passing them to a gate `b` and
503producing a list of all of the members that produce `%.y`. Inverse of
509`b` is a gate that accepts one argument and produces a boolean.
521 |* {a/(list) b/$-(* ?)}
525 ?:((b i.a) [i.a $(a t.a)] $(a t.a))
531 > =a |=(a/@ (gth a 1))
532 > (skim (limo [0 1 2 3 ~]) a)
542Cycles through the members of `++list` `a`, passing them to a gate `b`.
543Produces a list of all of the members that produce `%.n`. Inverse of
549`b` is a gate that accepts one argument and produces a loobean.
554A list of the same type as `a`.
561 |* {a/(list) b/$-(* ?)}
565 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
571 > =a |=(a/@ (gth a 1))
572 > (skip (limo [0 1 2 3 ~]) a)
582Accepts an atom `a` and list `b`, producing the remaining elements from
593A list of the same type as `b`.
610 > (slag 2 (limo [1 2 3 4 ~]))
612 > (slag 1 (limo [1 2 3 4 ~]))
613 [i=2 t=[i=3 t=[i=4 t=~]]]
622Accepts an atom `a` and a `++list` `b`, producing the element at the index
623of `a`and failing if the list is null. Lists are 0-indexed.
633Produces an element of `b`, or crashes if no element exists at that index.
653 > (snag 0 `(list ,@ud)`~[1 2 3 4])
663Quicksort: accepts a `++list` `a` and a gate `b` which accepts two nouns and
664produces a loobean. `++sort` then produces a list of the elements of `a`,
665sorted according to `b`.
670`b` is a gate that ccepts two nouns and produces a boolean.
680 ++ sort !. :: quicksort
682 |* {a/(list) b/$-([* *] ?)}
687 $(a (skim t.a |=(c/_i.a (b c i.a))))
689 [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
695 > =a =|({p=@ q=@} |.((gth p q)))
696 > (sort (limo [0 1 2 3 ~]) a)
706Similar to `substr` in Javascript: extracts a string infix, beginning at
707inclusive index `a`, producing `b` number of characters.
717A list of the same type as `c`.
723 |* {{a/@ b/@} c/(list)}
724 (scag +<-> (slag +<-< c))
730 > (swag [2 5] "roly poly")
732 > (swag [2 2] (limo [1 2 3 4 ~]))
742Accepts a `++list` `a` and a gate `b`. Produces a list with the gate applied
743to each element of the original list.
760 |* {a/(list) b/$-(* *)}
763 [i=(b i.a) t=$(a t.a)]
769 > (turn (limo [104 111 111 110 ~]) ,@t)
771 > =a |=(a/@ (add a 4))
772 > (turn (limo [1 2 3 4 ~]) a)
782Concatenate two `++list`s `a` and `b`.
787`a` and `b` are lists.
792 ++ weld :: concatenate
794 |* {a/(list) b/(list)}
795 => .(a ^.(homo a), b ^.(homo b))
805 ~[~~u ~~r ~~b ~~i ~~t]
806 > (weld (limo [1 2 ~]) (limo [3 4 ~]))
816Concatenate two `++list`s `a` and `b` without losing their type information
834 ++ welp :: perfect weld
849 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
850 [60 61 62 %a %b %c ~]
851 ~zod/arvo=/hoon/hoon>? (welp ~[60 61 62] ~[%a %b %c])
852 [60 61 62 %a %b %c ~]
853 [@ud @ud @ud %a %b %c %~]
854 ~zod/arvo=/hoon/hoon> (welp [sa+1 so+2 ~] si/3)
855 [[%sa 1] [%so 2] %si 3]
864Turns a `++list` of lists into a single list by promoting the elements of
865each sublist into the higher.
894 > (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
895 ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
896 > (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
897 ~[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