Skip to content

Instantly share code, notes, and snippets.

@yitznewton
Created March 3, 2014 16:34
Show Gist options
  • Select an option

  • Save yitznewton/9328773 to your computer and use it in GitHub Desktop.

Select an option

Save yitznewton/9328773 to your computer and use it in GitHub Desktop.
Mad haskell
bmiTell :: (RealFloat a) => a -> a -> String
bmiTell weight height
| bmi <= skinny = "You're underweight, you emo, you!"
| bmi <= normal = "You're supposedly normal. Pffft, I bet you're ugly!"
| bmi <= fat = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
where bmi = weight / height ^ 2
skinny = 18.5
normal = 25.0
fat = 30.0
@yitznewton
Copy link
Author

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