bmiCalculator :: IO () bmiCalculator = do putStrLn "Please input your weight" weight <- readLn putStrLn "Please input your height" height <- readLn let bmi = weight / height^2 putStrLn $ case () of _ | bmi <= 17.5 -> "stuff goes here" | bmi <= 20.7 -> "..." | otherwise -> "..." {- a much better variant: extract bmi calculation into its own function -} showBmi :: Double -> Double -> String showBmi weight height | bmi <= 17.5 = "stuff goes here" | bmi <= 20.7 = "..." | otherwise = "..." where bmi = weight / height^2 bmiCalculator :: IO () bmiCalculator = do putStrLn "Please input your weight" weight <- readLn putStrLn "Please input your height" height <- readLn putStrLn $ showBmi weight height