On Tue, May 5, 2009 at 3:27 PM, Luke Palmer <lrpalmer@gmail.com> wrote:
On Sun, May 3, 2009 at 11:27 AM, Tobias Olausson <tobsan@gmail.com> wrote:Hello!
I have a program that is using ST.Strict, which works fine.
However, the program needs to be extended, and to do that,
lazy evaluation is needed. As a result of that, I have switched
to ST.Lazy to be able to do stuff like
foo y = do
x <- something
xs <- foo (y+1)
return (x:xs)
As Ryan points out, this will not do what you want. But that is incidental, not essential:fmap (x:) $ foo (y+1)
foo y = do
x <- something