News for hackers. Stuff that matters.
Re:FizzBuzz in Haskell [pdf] by bradrn on Monday November 21, 2022 @09:36PM (#33701051)
A minor comment, but I’d reformat this a bit to make its structure clearer:

    fizzbuzz n = go id (show n)
      where
        go = test 3 "fizz" . test 5 "buzz"

        test d s x =
          if n `mod` d == 0 
          then const (s ++ x "")
          else x

There are no comments on this comment yet.