FizzBuzz: Difference between revisions

→‎{{header|Haskell}}: Simplified first example
(→‎{{header|Haskell}}: Simplified first example)
Line 576:
Variant directly implementing the specification:
 
<lang haskell>outputmain x= |mapM_ x3(putStrLn && x5 =. fizzbuzz) "FizzBuzz"[1..100]
| x3 = "Fizz"
| x5 = "Buzz"
| otherwise = show x
where
x3 = x `mod` 3 == 0
x5 = x `mod` 5 == 0
 
fizzbuzz x
main = mapM_ (putStrLn . output) [1..100]
x3 =| x `mod` 315 == 0 = "FizzBuzz"
| x3 x `mod` 3 == 0 = "Fizz"
| x5 x `mod` 5 == 0 = "Buzz"
| otherwise = show x
</lang>
 
Anonymous user