Church Numerals in ski by notogawa

data E=L{(%)::(E->E)}|N{n::Int}
m@main=getLine>>=print.n.head.foldr(#)[L(N.(+1).n),N 0].("``"++)>>m
's'#l=L(\x->L$L. \y z->x%z%(y%z)):l
'k'#l=L(L. const):l
'i'#l=L id:l
_#(f:x:t)=f%x:t

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

download

return to the top page