(comments)
原始链接: https://news.ycombinator.com/item?id=44071960
A Hacker News thread discusses using Monoids for FizzBuzz, inspired by a blog post. throwaway81523 criticizes the Monoid approach as overly complex and limiting, specifically for variations requiring spaces and an exclamation point. They suggest using lists and `intercalate` for better clarity and flexibility, providing a code snippet that handles Fizz, Buzz, and Bazz up to 110. kqr offers an alternative Monoid implementation using `newtype Words`, but concedes lists might be clearer. lgas shares a similar, simpler implementation from the past, noting its limitation to divisibility rules compared to the blog post's arbitrary predicates. The general consensus leans towards preferring lists over Monoids for this specific problem due to readability and adaptability.
reply