On Wed, Sep 21, 2011 at 6:04 AM, Ketil Malde <[email protected]> wrote:
> Tim Docker <[email protected]> writes:
>
>>         mapM_ applyAction sas
>
> Maybe you could try a lazy version of mapM?  E.g., I think this would do
> it:

Another option is to use a version of mapM that accumulates the result
on the heap.  Maybe this would do the trick:

mapM' f = go []
  where
    go acc [] = return (reverse acc)
    go acc (a:as) = do {x <- a; go (x:acc) as}

HTH,

-- 
Felipe.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to