Monoid instances by tails

:
s/X/ `mappend`/
s/\(\(.\).*\)_/\1\2/
t
h
/,/s/.*( /instance (/p
/z1/d
g
s/.//
s/)/,_)/g
s/^$/abcdefghijklmnopqrstuvwxyz# => Monoid# where\n    mempty =#\n   #X# =#\n/
s/#/ (_)/g
s/_/ Monoid _/
s//mempty/3
s//_1/3
s//_2/4
s//_1X _2/5
b

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

download

return to the top page