
19 Feb
2010
19 Feb
'10
5:17 p.m.
On Fri, Feb 19, 2010 at 4:10 PM, Mikhail Novikov
Maybe I should look into ST monad for this. :) I am still interested if there is a way to make this kind of functions in purely functional way.
I *think* the answer to your question is "no". You can write imperative code in Haskell (via ST and IO), and you can write functional code that gets equivalent results to a given chunk of imperative code, but you can't directly translate imperative code to functional code, since they're two qualitatively different things. It's like asking to express a square in terms of a circle -- you can come up with a circle that has the same area, but it's definitely *not* a square. :-)