Advertisement
Guest User

Untitled

a guest
Jun 1st, 2024
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. foobuzz n = f (n `mod` 3 == 0) (n `mod` 5 == 0)
  2.     where
  3.         f True True = "foobuzz"
  4.         f True _ = "foo"
  5.         f _ True = "buzz"
  6.         f _ _ = ""
  7.        
  8. foobuzz_if n = if n `mod` 15 == 0 then "foobuzz" else if n `mod` 5 == 0 then "buzz" else if n `mod` 3 == 0 then "foo" else ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement