replace last occurrence FIXED by henkma

m@main=getLine>>=putStrLn.f.words>>m
f[x,y,t]|a:b<-t,z<-f[x,y,b],z/=b=a:z|x<t,x++"~">t=y++drop(length x)t|0<1=t

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

download

return to the top page