u/Dr_Algin r/haskell • Recommends
Thought of this interesting FizzBuzz solution in Haskell!
I was watching Ben Awad's videolink to this video about writing FizzBuzz with Haskell and Vim, and that got me thinking about how I would actually do it. I was inspired by a Rust solution that I saw one time.
In this solution, I'm particularly happy about the function `mapM_`. If you don't know about it, it just maps a monadic action over a `Foldable`. There is also a `mapM` which returns the foldable type containing the result of each computation, but in this case we use the underscore version since we're only concerned with the side-effects of `putStrLn`.
Sometimes it's boring to sit for hours and sift through the docs to find functions l…