Monoid instances by I., S.

m=:'Monoid '&,
e=:'mempty'
a=:,' `mappend` '&,
c=:'(',')'_1}[:,','S=:,.&
i=:5{.LF
stdout;}.('instance ';m"0(c#~1 j.','=c@:);' => ';m@c;' where';i;e;' = ';c@:(e"0);i;('1'S a&c'2'S);' = ';c@('1'S a"1'2'S);2#LF"_)\26$97}.a.

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page