Skip to content

Instantly share code, notes, and snippets.

@mtsmfm
Last active January 2, 2016 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtsmfm/8233718 to your computer and use it in GitHub Desktop.
Save mtsmfm/8233718 to your computer and use it in GitHub Desktop.
greet :: String -> String
greet name
| name == "Juan" = niceGreeting ++ " " ++ name
| otherwise = badGreeting ++ " " ++ name
where niceGreeting = "Hello! So very nice to see you,"
badGreeting = "Oh! Pfft. It's you."
greet' :: String -> String
greet' "Juan" = niceGreeting ++ " " ++ "Juan"
where niceGreeting = "Hello! So very nice to see you,"
greet' name = badGreeting ++ " " ++ name
where badGreeting = "Oh! Pfft. It's you."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment