@@ -0,0 +1,919 @@
1+#### /ui/todo-list/jibb control
2+/= todo /ui/api/todo
3+
4+++ main (program init update view subs)
5+
6++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
7++$ msg
8+ [%typed text=@t]
9+ %submit
10+ [%toggled id=@ud]
11+ [%got todos=(list item.todo)]
12+ [%acked err=(unit @t)]
13+
14+++ init |= ts=(list item.todo)
15+ [todos=ts draft="" error=~]
16+
17+++ update |= [=msg m=model]
18+ ?- msg
19+ [%typed t]
20+ ?- (gth (lent (tuba (trip t))) 80)
21+ %.y [m(draft=t error=`"Too long") ~]
22+ %.n [m(draft=t error=~) ~]
23+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
24+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
25+ [%got ts] [m(todos=ts) ~]
26+ [%acked err] [m(error=err) ~]
27+
28+++ subs |= m=model
29+ ~[[%watch (todos.todo |=%got)]]
30+
31+++ view |= m=model
32+ column ~[gap+%s2] ~[
33+ heading 2 "Todos"
34+ each (turn todos.m row-of)
35+ row ~[gap+%s1] ~[
36+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
37+ button "Add" %submit
38+ el ~[tone+%danger] (text (fall error.m ""))
39+
40+++ row-of |= t=item.todo
41+ [id.t (toggle done.t text.t [%toggled id.t])]
42+#### /ui/todo-list/jibb reorder
43+/= todo /ui/api/todo
44+
45+++ row-of |= t=item.todo
46+ [id.t (toggle done.t text.t [%toggled id.t])]
47+
48+++ view |= m=model
49+ column ~[gap+%s2] ~[
50+ heading 2 "Todos"
51+ each (turn todos.m row-of)
52+ row ~[gap+%s1] ~[
53+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
54+ button "Add" %submit
55+ el ~[tone+%danger] (text (fall error.m ""))
56+
57+++ subs |= m=model
58+ ~[[%watch (todos.todo |=%got)]]
59+
60+++ update |= [=msg m=model]
61+ ?- msg
62+ [%typed t]
63+ ?- (gth (lent (tuba (trip t))) 80)
64+ %.y [m(draft=t error=`"Too long") ~]
65+ %.n [m(draft=t error=~) ~]
66+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
67+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
68+ [%got ts] [m(todos=ts) ~]
69+ [%acked err] [m(error=err) ~]
70+
71+++ init |= ts=(list item.todo)
72+ [todos=ts draft="" error=~]
73+
74++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
75++$ msg
76+ [%typed text=@t]
77+ %submit
78+ [%toggled id=@ud]
79+ [%got todos=(list item.todo)]
80+ [%acked err=(unit @t)]
81+
82+++ main (program init update view subs)
83+#### /ui/todo-list/jibb rename-view-sample
84+/= todo /ui/api/todo
85+
86+++ main (program init update view subs)
87+
88++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
89++$ msg
90+ [%typed text=@t]
91+ %submit
92+ [%toggled id=@ud]
93+ [%got todos=(list item.todo)]
94+ [%acked err=(unit @t)]
95+
96+++ init |= ts=(list item.todo)
97+ [todos=ts draft="" error=~]
98+
99+++ update |= [=msg m=model]
100+ ?- msg
101+ [%typed t]
102+ ?- (gth (lent (tuba (trip t))) 80)
103+ %.y [m(draft=t error=`"Too long") ~]
104+ %.n [m(draft=t error=~) ~]
105+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
106+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
107+ [%got ts] [m(todos=ts) ~]
108+ [%acked err] [m(error=err) ~]
109+
110+++ subs |= m=model
111+ ~[[%watch (todos.todo |=%got)]]
112+
113+++ view |= mdl=model
114+ column ~[gap+%s2] ~[
115+ heading 2 "Todos"
116+ each (turn todos.mdl row-of)
117+ row ~[gap+%s1] ~[
118+ el ~[width+[%fill 1]] (field "New todo" draft.mdl |=%typed)
119+ button "Add" %submit
120+ el ~[tone+%danger] (text (fall error.mdl ""))
121+
122+++ row-of |= t=item.todo
123+ [id.t (toggle done.t text.t [%toggled id.t])]
124+#### /ui/todo-list/jibb rename-row-sample
125+/= todo /ui/api/todo
126+
127+++ main (program init update view subs)
128+
129++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
130++$ msg
131+ [%typed text=@t]
132+ %submit
133+ [%toggled id=@ud]
134+ [%got todos=(list item.todo)]
135+ [%acked err=(unit @t)]
136+
137+++ init |= ts=(list item.todo)
138+ [todos=ts draft="" error=~]
139+
140+++ update |= [=msg m=model]
141+ ?- msg
142+ [%typed t]
143+ ?- (gth (lent (tuba (trip t))) 80)
144+ %.y [m(draft=t error=`"Too long") ~]
145+ %.n [m(draft=t error=~) ~]
146+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
147+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
148+ [%got ts] [m(todos=ts) ~]
149+ [%acked err] [m(error=err) ~]
150+
151+++ subs |= m=model
152+ ~[[%watch (todos.todo |=%got)]]
153+
154+++ view |= m=model
155+ column ~[gap+%s2] ~[
156+ heading 2 "Todos"
157+ each (turn todos.m row-of)
158+ row ~[gap+%s1] ~[
159+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
160+ button "Add" %submit
161+ el ~[tone+%danger] (text (fall error.m ""))
162+
163+++ row-of |= it=item.todo
164+ [id.it (toggle done.it text.it [%toggled id.it])]
165+#### /ui/todo-list/jibb rename-init-sample
166+/= todo /ui/api/todo
167+
168+++ main (program init update view subs)
169+
170++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
171++$ msg
172+ [%typed text=@t]
173+ %submit
174+ [%toggled id=@ud]
175+ [%got todos=(list item.todo)]
176+ [%acked err=(unit @t)]
177+
178+++ init |= items=(list item.todo)
179+ [todos=items draft="" error=~]
180+
181+++ update |= [=msg m=model]
182+ ?- msg
183+ [%typed t]
184+ ?- (gth (lent (tuba (trip t))) 80)
185+ %.y [m(draft=t error=`"Too long") ~]
186+ %.n [m(draft=t error=~) ~]
187+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
188+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
189+ [%got ts] [m(todos=ts) ~]
190+ [%acked err] [m(error=err) ~]
191+
192+++ subs |= m=model
193+ ~[[%watch (todos.todo |=%got)]]
194+
195+++ view |= m=model
196+ column ~[gap+%s2] ~[
197+ heading 2 "Todos"
198+ each (turn todos.m row-of)
199+ row ~[gap+%s1] ~[
200+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
201+ button "Add" %submit
202+ el ~[tone+%danger] (text (fall error.m ""))
203+
204+++ row-of |= t=item.todo
205+ [id.t (toggle done.t text.t [%toggled id.t])]
206+#### /ui/todo-list/jibb rename-subs-sample
207+/= todo /ui/api/todo
208+
209+++ main (program init update view subs)
210+
211++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
212++$ msg
213+ [%typed text=@t]
214+ %submit
215+ [%toggled id=@ud]
216+ [%got todos=(list item.todo)]
217+ [%acked err=(unit @t)]
218+
219+++ init |= ts=(list item.todo)
220+ [todos=ts draft="" error=~]
221+
222+++ update |= [=msg m=model]
223+ ?- msg
224+ [%typed t]
225+ ?- (gth (lent (tuba (trip t))) 80)
226+ %.y [m(draft=t error=`"Too long") ~]
227+ %.n [m(draft=t error=~) ~]
228+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
229+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
230+ [%got ts] [m(todos=ts) ~]
231+ [%acked err] [m(error=err) ~]
232+
233+++ subs |= mdl=model
234+ ~[[%watch (todos.todo |=%got)]]
235+
236+++ view |= m=model
237+ column ~[gap+%s2] ~[
238+ heading 2 "Todos"
239+ each (turn todos.m row-of)
240+ row ~[gap+%s1] ~[
241+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
242+ button "Add" %submit
243+ el ~[tone+%danger] (text (fall error.m ""))
244+
245+++ row-of |= t=item.todo
246+ [id.t (toggle done.t text.t [%toggled id.t])]
247+#### /ui/todo-list/jibb unused-helper
248+/= todo /ui/api/todo
249+
250+++ main (program init update view subs)
251+
252++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
253++$ msg
254+ [%typed text=@t]
255+ %submit
256+ [%toggled id=@ud]
257+ [%got todos=(list item.todo)]
258+ [%acked err=(unit @t)]
259+
260+++ init |= ts=(list item.todo)
261+ [todos=ts draft="" error=~]
262+
263+++ update |= [=msg m=model]
264+ ?- msg
265+ [%typed t]
266+ ?- (gth (lent (tuba (trip t))) 80)
267+ %.y [m(draft=t error=`"Too long") ~]
268+ %.n [m(draft=t error=~) ~]
269+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
270+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
271+ [%got ts] [m(todos=ts) ~]
272+ [%acked err] [m(error=err) ~]
273+
274+++ subs |= m=model
275+ ~[[%watch (todos.todo |=%got)]]
276+
277+++ view |= m=model
278+ column ~[gap+%s2] ~[
279+ heading 2 "Todos"
280+ each (turn todos.m row-of)
281+ row ~[gap+%s1] ~[
282+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
283+ button "Add" %submit
284+ el ~[tone+%danger] (text (fall error.m ""))
285+
286+++ row-of |= t=item.todo
287+ [id.t (toggle done.t text.t [%toggled id.t])]
288+
289+++ count |= m=model
290+ (lent todos.m)
291+#### /ui/todo-list/jibb unused-helper-mold
292+/= todo /ui/api/todo
293+
294+++ main (program init update view subs)
295+
296++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
297++$ msg
298+ [%typed text=@t]
299+ %submit
300+ [%toggled id=@ud]
301+ [%got todos=(list item.todo)]
302+ [%acked err=(unit @t)]
303+
304+++ init |= ts=(list item.todo)
305+ [todos=ts draft="" error=~]
306+
307+++ update |= [=msg m=model]
308+ ?- msg
309+ [%typed t]
310+ ?- (gth (lent (tuba (trip t))) 80)
311+ %.y [m(draft=t error=`"Too long") ~]
312+ %.n [m(draft=t error=~) ~]
313+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
314+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
315+ [%got ts] [m(todos=ts) ~]
316+ [%acked err] [m(error=err) ~]
317+
318+++ subs |= m=model
319+ ~[[%watch (todos.todo |=%got)]]
320+
321+++ view |= m=model
322+ column ~[gap+%s2] ~[
323+ heading 2 "Todos"
324+ each (turn todos.m row-of)
325+ row ~[gap+%s1] ~[
326+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
327+ button "Add" %submit
328+ el ~[tone+%danger] (text (fall error.m ""))
329+
330+++ row-of |= t=item.todo
331+ [id.t (toggle done.t text.t [%toggled id.t])]
332+
333++$ flag ?
334+#### /ui/todo-list/jibb swap-model-fields
335+/= todo /ui/api/todo
336+
337+++ main (program init update view subs)
338+
339++$ model [draft=@t todos=(list item.todo) error=(unit @t)]
340++$ msg
341+ [%typed text=@t]
342+ %submit
343+ [%toggled id=@ud]
344+ [%got todos=(list item.todo)]
345+ [%acked err=(unit @t)]
346+
347+++ init |= ts=(list item.todo)
348+ [draft="" todos=ts error=~]
349+
350+++ update |= [=msg m=model]
351+ ?- msg
352+ [%typed t]
353+ ?- (gth (lent (tuba (trip t))) 80)
354+ %.y [m(draft=t error=`"Too long") ~]
355+ %.n [m(draft=t error=~) ~]
356+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
357+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
358+ [%got ts] [m(todos=ts) ~]
359+ [%acked err] [m(error=err) ~]
360+
361+++ subs |= m=model
362+ ~[[%watch (todos.todo |=%got)]]
363+
364+++ view |= m=model
365+ column ~[gap+%s2] ~[
366+ heading 2 "Todos"
367+ each (turn todos.m row-of)
368+ row ~[gap+%s1] ~[
369+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
370+ button "Add" %submit
371+ el ~[tone+%danger] (text (fall error.m ""))
372+
373+++ row-of |= t=item.todo
374+ [id.t (toggle done.t text.t [%toggled id.t])]
375+#### /ui/todo-list/jibb init-cast-body
376+/= todo /ui/api/todo
377+
378+++ main (program init update view subs)
379+
380++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
381++$ msg
382+ [%typed text=@t]
383+ %submit
384+ [%toggled id=@ud]
385+ [%got todos=(list item.todo)]
386+ [%acked err=(unit @t)]
387+
388+++ init |= ts=(list item.todo)
389+ ^- model [ts "" ~]
390+
391+++ update |= [=msg m=model]
392+ ?- msg
393+ [%typed t]
394+ ?- (gth (lent (tuba (trip t))) 80)
395+ %.y [m(draft=t error=`"Too long") ~]
396+ %.n [m(draft=t error=~) ~]
397+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
398+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
399+ [%got ts] [m(todos=ts) ~]
400+ [%acked err] [m(error=err) ~]
401+
402+++ subs |= m=model
403+ ~[[%watch (todos.todo |=%got)]]
404+
405+++ view |= m=model
406+ column ~[gap+%s2] ~[
407+ heading 2 "Todos"
408+ each (turn todos.m row-of)
409+ row ~[gap+%s1] ~[
410+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
411+ button "Add" %submit
412+ el ~[tone+%danger] (text (fall error.m ""))
413+
414+++ row-of |= t=item.todo
415+ [id.t (toggle done.t text.t [%toggled id.t])]
416+#### /ui/todo-list/jibb init-positional
417+/= todo /ui/api/todo
418+
419+++ main (program init update view subs)
420+
421++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
422++$ msg
423+ [%typed text=@t]
424+ %submit
425+ [%toggled id=@ud]
426+ [%got todos=(list item.todo)]
427+ [%acked err=(unit @t)]
428+
429+++ init |= ts=(list item.todo)
430+ [ts "" ~]
431+
432+++ update |= [=msg m=model]
433+ ?- msg
434+ [%typed t]
435+ ?- (gth (lent (tuba (trip t))) 80)
436+ %.y [m(draft=t error=`"Too long") ~]
437+ %.n [m(draft=t error=~) ~]
438+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
439+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
440+ [%got ts] [m(todos=ts) ~]
441+ [%acked err] [m(error=err) ~]
442+
443+++ subs |= m=model
444+ ~[[%watch (todos.todo |=%got)]]
445+
446+++ view |= m=model
447+ column ~[gap+%s2] ~[
448+ heading 2 "Todos"
449+ each (turn todos.m row-of)
450+ row ~[gap+%s1] ~[
451+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
452+ button "Add" %submit
453+ el ~[tone+%danger] (text (fall error.m ""))
454+
455+++ row-of |= t=item.todo
456+ [id.t (toggle done.t text.t [%toggled id.t])]
457+#### /ui/todo-list/jibb second-sub-every
458+/= todo /ui/api/todo
459+
460+++ main (program init update view subs)
461+
462++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
463++$ msg
464+ [%typed text=@t]
465+ %submit
466+ [%toggled id=@ud]
467+ [%got todos=(list item.todo)]
468+ [%acked err=(unit @t)]
469+ [%tick at=@da]
470+
471+++ init |= ts=(list item.todo)
472+ [todos=ts draft="" error=~]
473+
474+++ update |= [=msg m=model]
475+ ?- msg
476+ [%typed t]
477+ ?- (gth (lent (tuba (trip t))) 80)
478+ %.y [m(draft=t error=`"Too long") ~]
479+ %.n [m(draft=t error=~) ~]
480+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
481+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
482+ [%got ts] [m(todos=ts) ~]
483+ [%acked err] [m(error=err) ~]
484+ [%tick at] [m ~]
485+
486+++ subs |= m=model
487+ ~[[%watch (todos.todo |=%got)] [%every ~s30 |=%tick]]
488+
489+++ view |= m=model
490+ column ~[gap+%s2] ~[
491+ heading 2 "Todos"
492+ each (turn todos.m row-of)
493+ row ~[gap+%s1] ~[
494+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
495+ button "Add" %submit
496+ el ~[tone+%danger] (text (fall error.m ""))
497+
498+++ row-of |= t=item.todo
499+ [id.t (toggle done.t text.t [%toggled id.t])]
500+#### /ui/todo-list/jibb second-sub-watch
501+/= todo /ui/api/todo
502+
503+++ main (program init update view subs)
504+
505++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
506++$ msg
507+ [%typed text=@t]
508+ %submit
509+ [%toggled id=@ud]
510+ [%got todos=(list item.todo)]
511+ [%acked err=(unit @t)]
512+
513+++ init |= ts=(list item.todo)
514+ [todos=ts draft="" error=~]
515+
516+++ update |= [=msg m=model]
517+ ?- msg
518+ [%typed t]
519+ ?- (gth (lent (tuba (trip t))) 80)
520+ %.y [m(draft=t error=`"Too long") ~]
521+ %.n [m(draft=t error=~) ~]
522+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
523+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
524+ [%got ts] [m(todos=ts) ~]
525+ [%acked err] [m(error=err) ~]
526+
527+++ subs |= m=model
528+ ~[[%watch (todos.todo |=%got)] [%watch (todos.todo |=%got)]]
529+
530+++ view |= m=model
531+ column ~[gap+%s2] ~[
532+ heading 2 "Todos"
533+ each (turn todos.m row-of)
534+ row ~[gap+%s1] ~[
535+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
536+ button "Add" %submit
537+ el ~[tone+%danger] (text (fall error.m ""))
538+
539+++ row-of |= t=item.todo
540+ [id.t (toggle done.t text.t [%toggled id.t])]
541+#### /ui/todo-list/jibb subs-none
542+/= todo /ui/api/todo
543+
544+++ main (program init update view subs)
545+
546++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
547++$ msg
548+ [%typed text=@t]
549+ %submit
550+ [%toggled id=@ud]
551+ [%got todos=(list item.todo)]
552+ [%acked err=(unit @t)]
553+
554+++ init |= ts=(list item.todo)
555+ [todos=ts draft="" error=~]
556+
557+++ update |= [=msg m=model]
558+ ?- msg
559+ [%typed t]
560+ ?- (gth (lent (tuba (trip t))) 80)
561+ %.y [m(draft=t error=`"Too long") ~]
562+ %.n [m(draft=t error=~) ~]
563+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
564+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
565+ [%got ts] [m(todos=ts) ~]
566+ [%acked err] [m(error=err) ~]
567+
568+++ subs |=(m ~)
569+
570+++ view |= m=model
571+ column ~[gap+%s2] ~[
572+ heading 2 "Todos"
573+ each (turn todos.m row-of)
574+ row ~[gap+%s1] ~[
575+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
576+ button "Add" %submit
577+ el ~[tone+%danger] (text (fall error.m ""))
578+
579+++ row-of |= t=item.todo
580+ [id.t (toggle done.t text.t [%toggled id.t])]
581+#### /ui/todo-list/jibb sixth-msg
582+/= todo /ui/api/todo
583+
584+++ main (program init update view subs)
585+
586++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
587++$ msg
588+ [%typed text=@t]
589+ %submit
590+ [%toggled id=@ud]
591+ [%got todos=(list item.todo)]
592+ [%acked err=(unit @t)]
593+ %clear
594+
595+++ init |= ts=(list item.todo)
596+ [todos=ts draft="" error=~]
597+
598+++ update |= [=msg m=model]
599+ ?- msg
600+ [%typed t]
601+ ?- (gth (lent (tuba (trip t))) 80)
602+ %.y [m(draft=t error=`"Too long") ~]
603+ %.n [m(draft=t error=~) ~]
604+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
605+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
606+ [%got ts] [m(todos=ts) ~]
607+ [%acked err] [m(error=err) ~]
608+ %clear [m(todos=~) ~]
609+
610+++ subs |= m=model
611+ ~[[%watch (todos.todo |=%got)]]
612+
613+++ view |= m=model
614+ column ~[gap+%s2] ~[
615+ heading 2 "Todos"
616+ each (turn todos.m row-of)
617+ row ~[gap+%s1] ~[
618+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
619+ button "Add" %submit
620+ el ~[tone+%danger] (text (fall error.m ""))
621+
622+++ row-of |= t=item.todo
623+ [id.t (toggle done.t text.t [%toggled id.t])]
624+#### /ui/todo-list/jibb sixth-msg-button
625+/= todo /ui/api/todo
626+
627+++ main (program init update view subs)
628+
629++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
630++$ msg
631+ [%typed text=@t]
632+ %submit
633+ [%toggled id=@ud]
634+ [%got todos=(list item.todo)]
635+ [%acked err=(unit @t)]
636+ %clear
637+
638+++ init |= ts=(list item.todo)
639+ [todos=ts draft="" error=~]
640+
641+++ update |= [=msg m=model]
642+ ?- msg
643+ [%typed t]
644+ ?- (gth (lent (tuba (trip t))) 80)
645+ %.y [m(draft=t error=`"Too long") ~]
646+ %.n [m(draft=t error=~) ~]
647+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
648+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
649+ [%got ts] [m(todos=ts) ~]
650+ [%acked err] [m(error=err) ~]
651+ %clear [m(todos=~) ~]
652+
653+++ subs |= m=model
654+ ~[[%watch (todos.todo |=%got)]]
655+
656+++ view |= m=model
657+ column ~[gap+%s2] ~[
658+ heading 2 "Todos"
659+ each (turn todos.m row-of)
660+ row ~[gap+%s1] ~[
661+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
662+ button "Add" %submit
663+ button "Clear" %clear
664+ el ~[tone+%danger] (text (fall error.m ""))
665+
666+++ row-of |= t=item.todo
667+ [id.t (toggle done.t text.t [%toggled id.t])]
668+#### /ui/todo-list/jibb view-helper-title
669+/= todo /ui/api/todo
670+
671+++ main (program init update view subs)
672+
673++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
674++$ msg
675+ [%typed text=@t]
676+ %submit
677+ [%toggled id=@ud]
678+ [%got todos=(list item.todo)]
679+ [%acked err=(unit @t)]
680+
681+++ init |= ts=(list item.todo)
682+ [todos=ts draft="" error=~]
683+
684+++ update |= [=msg m=model]
685+ ?- msg
686+ [%typed t]
687+ ?- (gth (lent (tuba (trip t))) 80)
688+ %.y [m(draft=t error=`"Too long") ~]
689+ %.n [m(draft=t error=~) ~]
690+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
691+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
692+ [%got ts] [m(todos=ts) ~]
693+ [%acked err] [m(error=err) ~]
694+
695+++ subs |= m=model
696+ ~[[%watch (todos.todo |=%got)]]
697+
698+++ view |= m=model
699+ column ~[gap+%s2] ~[
700+ (title "Todos")
701+ each (turn todos.m row-of)
702+ row ~[gap+%s1] ~[
703+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
704+ button "Add" %submit
705+ el ~[tone+%danger] (text (fall error.m ""))
706+
707+++ row-of |= t=item.todo
708+ [id.t (toggle done.t text.t [%toggled id.t])]
709+
710+++ title |= words=@t
711+ heading 2 words
712+#### /ui/todo-list/jibb view-helper-error
713+/= todo /ui/api/todo
714+
715+++ main (program init update view subs)
716+
717++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
718++$ msg
719+ [%typed text=@t]
720+ %submit
721+ [%toggled id=@ud]
722+ [%got todos=(list item.todo)]
723+ [%acked err=(unit @t)]
724+
725+++ init |= ts=(list item.todo)
726+ [todos=ts draft="" error=~]
727+
728+++ update |= [=msg m=model]
729+ ?- msg
730+ [%typed t]
731+ ?- (gth (lent (tuba (trip t))) 80)
732+ %.y [m(draft=t error=`"Too long") ~]
733+ %.n [m(draft=t error=~) ~]
734+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
735+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
736+ [%got ts] [m(todos=ts) ~]
737+ [%acked err] [m(error=err) ~]
738+
739+++ subs |= m=model
740+ ~[[%watch (todos.todo |=%got)]]
741+
742+++ view |= m=model
743+ column ~[gap+%s2] ~[
744+ heading 2 "Todos"
745+ each (turn todos.m row-of)
746+ row ~[gap+%s1] ~[
747+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
748+ button "Add" %submit
749+ (error-line m)
750+
751+++ row-of |= t=item.todo
752+ [id.t (toggle done.t text.t [%toggled id.t])]
753+
754+++ error-line |= m=model
755+ el ~[tone+%danger] (text (fall error.m ""))
756+#### /ui/todo-list/jibb inline-row-of
757+/= todo /ui/api/todo
758+
759+++ main (program init update view subs)
760+
761++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
762++$ msg
763+ [%typed text=@t]
764+ %submit
765+ [%toggled id=@ud]
766+ [%got todos=(list item.todo)]
767+ [%acked err=(unit @t)]
768+
769+++ init |= ts=(list item.todo)
770+ [todos=ts draft="" error=~]
771+
772+++ update |= [=msg m=model]
773+ ?- msg
774+ [%typed t]
775+ ?- (gth (lent (tuba (trip t))) 80)
776+ %.y [m(draft=t error=`"Too long") ~]
777+ %.n [m(draft=t error=~) ~]
778+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
779+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
780+ [%got ts] [m(todos=ts) ~]
781+ [%acked err] [m(error=err) ~]
782+
783+++ subs |= m=model
784+ ~[[%watch (todos.todo |=%got)]]
785+
786+++ view |= m=model
787+ column ~[gap+%s2] ~[
788+ heading 2 "Todos"
789+ each (turn todos.m |=(t=item.todo [id.t (toggle done.t text.t [%toggled id.t])]))
790+ row ~[gap+%s1] ~[
791+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
792+ button "Add" %submit
793+ el ~[tone+%danger] (text (fall error.m ""))
794+#### /ui/todo-list/jibb view-local-rows
795+/= todo /ui/api/todo
796+
797+++ main (program init update view subs)
798+
799++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
800++$ msg
801+ [%typed text=@t]
802+ %submit
803+ [%toggled id=@ud]
804+ [%got todos=(list item.todo)]
805+ [%acked err=(unit @t)]
806+
807+++ init |= ts=(list item.todo)
808+ [todos=ts draft="" error=~]
809+
810+++ update |= [=msg m=model]
811+ ?- msg
812+ [%typed t]
813+ ?- (gth (lent (tuba (trip t))) 80)
814+ %.y [m(draft=t error=`"Too long") ~]
815+ %.n [m(draft=t error=~) ~]
816+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
817+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
818+ [%got ts] [m(todos=ts) ~]
819+ [%acked err] [m(error=err) ~]
820+
821+++ subs |= m=model
822+ ~[[%watch (todos.todo |=%got)]]
823+
824+++ view |= m=model
825+ ++ rows (turn todos.m row-of)
826+ column ~[gap+%s2] ~[
827+ heading 2 "Todos"
828+ each rows
829+ row ~[gap+%s1] ~[
830+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
831+ button "Add" %submit
832+ el ~[tone+%danger] (text (fall error.m ""))
833+
834+++ row-of |= t=item.todo
835+ [id.t (toggle done.t text.t [%toggled id.t])]
836+#### /ui/todo-list/jibb drop-each
837+/= todo /ui/api/todo
838+
839+++ main (program init update view subs)
840+
841++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
842++$ msg
843+ [%typed text=@t]
844+ %submit
845+ [%toggled id=@ud]
846+ [%got todos=(list item.todo)]
847+ [%acked err=(unit @t)]
848+
849+++ init |= ts=(list item.todo)
850+ [todos=ts draft="" error=~]
851+
852+++ update |= [=msg m=model]
853+ ?- msg
854+ [%typed t]
855+ ?- (gth (lent (tuba (trip t))) 80)
856+ %.y [m(draft=t error=`"Too long") ~]
857+ %.n [m(draft=t error=~) ~]
858+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
859+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
860+ [%got ts] [m(todos=ts) ~]
861+ [%acked err] [m(error=err) ~]
862+
863+++ subs |= m=model
864+ ~[[%watch (todos.todo |=%got)]]
865+
866+++ view |= m=model
867+ column ~[gap+%s2] ~[
868+ heading 2 "Todos"
869+ row ~[gap+%s1] ~[
870+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
871+ button "Add" %submit
872+ el ~[tone+%danger] (text (fall error.m ""))
873+
874+++ row-of |= t=item.todo
875+ [id.t (toggle done.t text.t [%toggled id.t])]
876+#### /ui/todo-list/jibb update-helper-cmd
877+/= todo /ui/api/todo
878+
879+++ main (program init update view subs)
880+
881++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
882++$ msg
883+ [%typed text=@t]
884+ %submit
885+ [%toggled id=@ud]
886+ [%got todos=(list item.todo)]
887+ [%acked err=(unit @t)]
888+
889+++ init |= ts=(list item.todo)
890+ [todos=ts draft="" error=~]
891+
892+++ update |= [=msg m=model]
893+ ?- msg
894+ [%typed t]
895+ ?- (gth (lent (tuba (trip t))) 80)
896+ %.y [m(draft=t error=`"Too long") ~]
897+ %.n [m(draft=t error=~) ~]
898+ %submit [m(draft="") ~[(add-cmd draft.m)]]
899+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
900+ [%got ts] [m(todos=ts) ~]
901+ [%acked err] [m(error=err) ~]
902+
903+++ subs |= m=model
904+ ~[[%watch (todos.todo |=%got)]]
905+
906+++ view |= m=model
907+ column ~[gap+%s2] ~[
908+ heading 2 "Todos"
909+ each (turn todos.m row-of)
910+ row ~[gap+%s1] ~[
911+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
912+ button "Add" %submit
913+ el ~[tone+%danger] (text (fall error.m ""))
914+
915+++ row-of |= t=item.todo
916+ [id.t (toggle done.t text.t [%toggled id.t])]
917+
918+++ add-cmd |= d=@t
919+ (poke.todo [%add d] |=%acked)