2k: Queue Logic
+to
+toQueue operations.
Container arm for +que operation arms. The contained arms inherit .a, its sample +que.
Accepts
.a is a tree.
Source
++ to
=| a=(tree) :: (qeu)
|@Discussion
+tree is the generic tree-shape mold. Maps, sets, and +ques all share that shape, but they put their elements in different places and have different interfaces. +to is the interface core for +qeu; it's not generic across all the different containers that use +tree.
+apt:to
+apt:toCheck correctness.
Test whether +que .a is correctly ordered, producing a $flag.
Accepts
.a is a +que.
Produces
A $flag.
Source
Examples
+bal:to
+bal:toBalance.
Vertically rebalances +que .a.
Accepts
.a is a +qeu.
Produces
A +qeu.
Source
Examples
+dep:to
+dep:toMaximum Depth.
Produces the maximum depth of leaves (.r.a and .l.a) in +que .a.
Accepts
.a is a +que.
Produces
An $atom.
Source
Examples
+gas:to
+gas:toPush +list.
Push all elements of +list .b into the +que .a.
Accepts
.a is a +que, and is the sample of +to.
.b is a +list.
Produces
A +que.
Source
Examples
+get:to
+get:toHead-tail pair.
Produces the head and tail +que of .a.
Accepts
.a is a +que.
Produces
A cell of the last element in .a along with the rest of +que .a.
Source
Examples
+nap:to
+nap:toRemove head.
Removes the head of +que .a, producing the resulting +que.
Accepts
.a is a +que.
Produces
A +que.
Source
Examples
+nip:to
+nip:toRemoves the root of +que .a, producing the resulting +que.
Accepts
.a is a +que.
Produces
A +que.
Source
Examples
+put:to
+put:toInsert.
Accept $noun .b and adds to +que .a as the head, producing the resulting +que.
Accepts
.a is a +que, and is the sample of +to.
.b is a $noun.
Produces
A +que.
Source
Examples
+tap:to
+tap:toQueue to +list.
Produces +que .a as a +list from front to back.
Accepts
.a is a +que.
Produces
A +list.
Source
Examples
+top:to
+top:toProduce head.
Produces the head of +que .a as a +unit.
Accepts
.a is a +que.
Produces
A unit.
Source
Examples
Discussion
An empty +que has no head.
Last updated