Skip to content

Instantly share code, notes, and snippets.

@lyricallogical
Forked from konn/FizzBuzz.hs
Created October 10, 2011 15:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyricallogical/1275549 to your computer and use it in GitHub Desktop.
Save lyricallogical/1275549 to your computer and use it in GitHub Desktop.
コンパイル通るか知りません こんな感じのほうが人間に優しいのでは…!
fizzbuzz = zipWith max (map show [0..]) fb
where
fb = zipWith (++) f b
f = cycle ["Fizz", "", ""]
b = cycle ["Buzz", "", "", "", ""]
main = mapM_ putStrLn $ tail $ fizzBuzz
@suztomo
Copy link

suztomo commented Oct 10, 2011

StringとMaybeは同じ型ではないのでauxの定義で型エラーがおきるのではないでしょうか。コンパイルしてませんが。

@lyricallogical
Copy link
Author

ほんとですね、うっかりしてました。

@lyricallogical
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment