differentiation by henkma

m@main=getLine>>=putStrLn.init.f>>m
f i=do(n,x:y)<-reads$i++"0";n%y
n%('^':a:b:c)=shows(n*read[a])"x"++([1|a>'2']>>['^',pred a])++b:f c
n%_=show$n*10

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

download

return to the top page