Get the latest tech news
Haskell: A Great Procedural Language
Table of Contents - Side effects as first class values - De-mystifying do blocks - Functions that operate on side effects - Leaning into the first classiness of effects - Things you never need to care about - Appendix A: Avoiding success and uselessness - Appendix B: Why fmap maps over both side effects and lists - Appendix C: Foldable and Traversable There are many catchphrases about Haskell. - Haskell is useless.
First we create a list by repeating the same side effect object an infinite number of times. We used list functions ( repeat, take 20) to manipulate a data structure of side effect objects as if they were regular values – because they are! This is a kind of meta programming, except it’s not using a special macro language but performed at the level of regular values.
Or read this on Hacker News