Composition Calculus by Defenestrator

data F=C(F->F)|L[Char]
f(C a)b=a b
f(L".")b=C(\c->C(\d->f b(f c d)))
f(L a)(L b)=L$"("++a++" "++b++")"
t(L s)=s;main@m=getLine>>=putStrLn.t.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