Skip to content

Instantly share code, notes, and snippets.

@JacobLeach
Created December 8, 2015 00:17
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 JacobLeach/2d22e1a7fbc0471aefed to your computer and use it in GitHub Desktop.
Save JacobLeach/2d22e1a7fbc0471aefed to your computer and use it in GitHub Desktop.
bmiTell :: (RealFloat a) => a -> a -> String
bmiTell weight height
| bmi <= 18.5 = "You're underweight, you emo, you!"
| bmi <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!"
| bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
where bmi = weight / height ^ 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment