1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
[type just_ [kind val]] [type none_ [kind]] [def just [val] [just_ 1 val]] [def just.val [x] [just_.val x]] [def none [] [none_ 0]] [def has_value [x] [just_.kind x]] [def Maybe.>>= [a f] [if [has_value a] [f [just.val a]] a]] [def Maybe.return [x] [just x]]