O'Reilly logo
  • Chris Pickett thinks this is interesting:

If we wanted to, we could even go a bit overboard and write our function like this:

bmiTell :: Double -> Double -> 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

From

Cover of Learn You a Haskell for Great Good!

Note

I don't know if this is overboard, seems like it greatly increases the readability.