On Sun, May 3, 2009 at 11:27 AM, Tobias Olausson <[email protected]> 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:
foo y = do
x <- something
fmap (x:) $ foo (y+1)
Luke
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe