Created
July 13, 2021 08:14
-
-
Save aerphanas/17780b61e3b6cc7994970a90b1339dc0 to your computer and use it in GitHub Desktop.
get bmi on haskell kg and cm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bmi :: (RealFloat a) => a -> a -> String | |
| bmi weight height | |
| | weight / (height / 100)^2 <= 18.5 = "You're underweight, you emo, you!" | |
| | weight / (height / 100)^2 <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!" | |
| | weight / (height / 100)^2 <= 30.0 = "You're fat! Lose some weight, fatty!" | |
| | otherwise = "You're a whale, congratulations!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment