[Haskell-cafe] mapM is supralinear?
es at ertes.de
Fri Sep 9 10:12:19 CEST 2011
Roman Cheplyaka <roma at ro-che.info> wrote:
> > In general it's a bad idea to use mapM over IO.
> Could you explain why?
Most applications don't require loading the entire result into memory,
so a combinator like foldM is more appropriate. You should use mapM
over IO only, when the list is short, or when there is really no way
around loading everything into memory.
nightmare = unsafePerformIO (getWrongWife >>= sex)
More information about the Haskell-Cafe