3 ms·
I wasn't contradicting you but trying to reinforce the point that there's an equivalence between "impure" functions and pure functions that produce actions (hav
by tmoertel 13y ago
I wasn't contradicting you but trying to reinforce the point that there's an equivalence between "impure" functions and pure functions that produce actions (having impure effects if sequenced). In particular, I wanted to highlight that (mapM_ print) is not somehow more impure than (map print). Many people seem to believe that it is.
- chongli 13y agoIndeed. The source code of mapM_ is literally: mapM_ f as = sequence_ (map f as)