Monoid instances by ush

#define p(s,f)for(printf(s" ("),i=n;i--;)printf(#f"c",96+n-i,i?44:41);
i;main(n){for(;n++<26;){p(!i*2+"\n\ninstance",Monoid %c%-2)p("=> Monoid",%c%)p(" where\n    mempty =",mempty%2$)p("\n   ",%c1%)p(" `mappend`",%c2%)p(" =",%c1 `mappend` %1$c2%)}}

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

download

return to the top page