Skip to content

Instantly share code, notes, and snippets.

@thunklife
Created October 9, 2013 16:00
Show Gist options
  • Select an option

  • Save thunklife/6903584 to your computer and use it in GitHub Desktop.

Select an option

Save thunklife/6903584 to your computer and use it in GitHub Desktop.
A newbie's attempt at FizzBuzz as a list comprehension in Haskell.
fizzBuzz :: [Integer] -> [String]
fizzBuzz list = [if mod el 15 == 0 then "FIZZBUZZ" else if mod el 3 == 0 then "FIZZ" else if mod el 5 == 0 then "BUZZ" else show el | el <- list]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment