Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Indeed. The source code of mapM_ is literally:

   mapM_ f as      =  sequence_ (map f as)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: