Skip to content

Instantly share code, notes, and snippets.

@ymkjp
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save ymkjp/9721254 to your computer and use it in GitHub Desktop.

Select an option

Save ymkjp/9721254 to your computer and use it in GitHub Desktop.
How to write `where`'s indent
bmiTell :: Double -> Double -> String
bmiTell weight height
| bmi <= skinny = "You're underweight, you emo, you!"
| bmi <= normal = "You're supporsedly normal.\
\ Pfft, I bet you're ugly!"
| bmi <= fat = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
where -- To new line
bmi = weight / height ^ 2
skinny = 18.5
normal = 25.0
fat = 30.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment