Composition Calculus by tanakh

data T=T:.T|L[Char]
p(l:.r)='(':p l++' ':p r++")"
p(L s)=s
f(L".":.a:.b:.c)=a:.(b:.c)
f(a:.b)=f a:.f b
f a=a
main@m=getLine>>=putStrLn.p.f.foldl1((f.).(:.)).map L .words>>m

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

download

return to the top page