@@ -2,150 +2,172 @@
2navhome: /docs/
2navhome: /docs/
6# 2o: normalizing containers
5# 2o: normalizing containers
8+Mold generator. A `jar` is a `map` of `list`.
10−Tile generator. A `++jar` is a `++map` of `++list`.
15− ++ jar |*({a/$-(* *) b/$-(* *)} (map a (list b))) :: map of lists
18−Examples
12+ ++ jar |*([a=mold b=mold] (map a (list b)))
21−See also: `++ja`, `++by`, `++map`, `++list`
14+#### Examples
23− > =a (limo [1 2 ~])
16+ > =a (ly [1 2 ~])
25− [i=1 t=[i=2 t=~]]
18+ ~[1 2]
26− > =b (limo [3 4 ~])
20+ > =b (ly [3 4 ~])
28− [i=3 t=[i=4 t=~]]
22+ ~[3 4]
29− > =c (mo (limo [[%a a] [%b b] ~]))
24+ > =c (my [[%a a] [%b b] ~])
31− {[p=%a q=[i=1 t=[i=2 t=~]]] [p=%b q=[i=3 t=[i=4 t=~]]]}
26+ [n=[p=%b q=[i=3 t=~[4]]] l={[p=%a q=[i=1 t=[i=2 t=~]]]} r={}]
32 > (~(get ja c) %a)
28 > (~(get ja c) %a)
33 [i=1 t=[i=2 t=~]]
29 [i=1 t=[i=2 t=~]]
34 > (~(get ja c) %c)
31 > (~(get ja c) %c)
37+See also: [`ja`](../2j), [`by`](../2i), [`map`](../2i), [`list`](../2b)
40### `++jug`
40### `++jug`
42−mold generator. A `++jug` is a `++map` of `++set`s.
42+Mold generator. A `jug` is a `map` of `set`.
47− ++ jug |*({a/$-(* *) b/$-(* *)} (map a (set b))) :: map of sets
46+ ++ jug |*([a=mold b=mold] (map a (set b)))
50−Examples
49+#### Examples
53−See also: `++ju`, `++by`, `++map`, `++set`
55− > =a (sa (limo [1 2 ~]))
51+ > =a (sy [1 2 ~])
57− {1 2}
53+ [n=2 l={1} r={}]
58− > =b (sa (limo [3 4 ~]))
55+ > =b (sy [3 4 ~])
60− {4 3}
57+ [n=4 l={} r={3}]
61− > =c (mo (limo [[%a a] [%b b] ~]))
59+ > =c (my [%a a] [%b b] ~])
63− {[p=%a q={1 2}] [p=%b q={4 3}]}
61+ [n=[p=%b q=[n=4 l={} r={3}]] l={[p=%a q=[n=2 l={1} r={}]]} r={}]
64 > (~(get ju c) %b)
63 > (~(get ju c) %b)
65− {4 3}
64+ [n=4 l=~ r=[n=3 l={} r={}]]
66 > (~(put ju c) [%b 5])
66 > (~(put ju c) [%b 5])
67− {[p=%a q={1 2}] [p=%b q={5 4 3}]}
67+ [ n=[p=%b q=[n=4 l=[n=5 l={} r={}] r=[n=3 l={} r={}]]]
68+ l=[n=[p=%a q=[n=2 l=[n=1 l={} r={}] r=~]] l={} r={}]
74+See also: [`ja`](../2j), [`by`](../2i), [`map`](../2i), [`set`](..2h)
71### `++map`
77### `++map`
75−mold generator. A `++map` is a treap of
81+Mold generator. A `map` is a [treap](https://en.wikipedia.org/wiki/Treap) of
76key-value pairs.
82key-value pairs.
82− ++ map |* {a/$-(* *) b/$-(* *)} :: associative tree
87+ ++ map |* [a=mold b=mold]
83− $@($~ {n/{p/a q/b} l/(map a b) r/(map a b)}) ::
88+ %+ cork (tree (pair a b))
89+ |= c=(tree (pair a b)) ^+ c
89−See also: `++by`
95+ > ? *(map @t @u)
94 > (molt `(list (pair * *))`[[a+1 b+2] ~])
99 > (molt `(list (pair * *))`[[a+1 b+2] ~])
95− {[p=[97 1] q=[98 2]]}
100+ [n=[p=[97 1] q=[98 2]] l={} r={}]
104+See also: [`by`](../2i)
99### `++qeu`
107### `++qeu`
103−mold generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
111+Mold generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
106−Source
114+#### Source
116+ ++ qeu |*(a=mold (tree a))
109− ++ qeu |* a/$-(* *) :: queue
110− $@($~ {n/a l/(qeu a) r/(qeu a)}) ::
113−Examples
120+#### Examples
116 > (qeu time)
122 > (qeu time)
117− <1.qyo [* <1.sxx [a=<1.ebd [* <101.jzo 1.ypj %164>]> <101.jzo 1.ypj %164>]>]>
123+ < 1.huj
126+ { a/<1.vyv {* <112.lqf 224.nab 54.tyv 119.veb 31.ohr 1.jmk $143>}>
118 > (~(gas to *(qeu time)) [~2014.1.1 ~2014.1.2 ~])
133 > (~(gas to *(qeu time)) [~2014.1.1 ~2014.1.2 ~])
119− {~2014.1.2 ~2014.1.1}
134+ [n=~2014.1.2 l={} r={~2014.1.1}]
139+See also: [`qeu`](../2k)
124### `++set`
142### `++set`
128−mold generator. A `++set` is a treap with unique values.
146+Mold generator. A `qeu` is an ordered [treap](http://en.wikipedia.org/wiki/Treap) of
133− ++ set |* a/$-(* *) :: set
157+#### Examples
134− $@($~ {n/a l/(set a) r/(set a)}) ::
137−Examples
160+ > (sy "abc")
138−--------
161+ [n='b' l={'a' 'c'} r={}]
140−See also: `++in`
163+ > (~(put in (sy "abc")) %d)
164+ [n='b' l=[n='d' l={} r={'a' 'c'}] r=~]
144− > (~(put in (sa "abc")) %d)
166+ > (~(put in (sy "abc")) %a)
145− {~~d ~~a ~~c ~~b}
167+ [n='b' l=[n='c' l={'a'} r={}] r=~]
146− > (~(put in (sa "abc")) %a)
171+See also: [`in`](../2h)