Church Numerals in ski by hinoe

data E=L(E->E)|P|N Int
m@main=getLine>>=print.n.foldr(#)[P,N 0].("``"++)>>m
'`'#(a:b:t)=a!b:t
's'#l=L(\a->L(\b->L(\c->a!c!(b!c)))):l
'k'#l=L(L.(const)):l
'i'#l=L id:l
L a!b=a b
P!N i=N$i+1
n[N i]=i

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

download

return to the top page