Challenge 1: Attempting to Add getLine Directly to an Int — Possible Solution ==================================================================== Broken attempt — Main.hs: badFunction :: Int -> IO Int badFunction x = x + getLine Representative compile error: Main.hs:2:19: error: * Couldn't match expected type 'Int' with actual type 'IO String' * In the second argument of '(+)', namely 'getLine' In the expression: x + getLine Explanation: getLine's real type is IO String -- a description of an action that, WHEN RUN, will produce a String, not a String itself. The (+) operator requires both of its arguments to be actual numbers of the same numeric type; IO String is not a number at all, no matter how the expression is arranged. There is no direct way to "peek inside" an IO String to get the real String out without going through >>= or do-notation, and neither of those was used here -- x + getLine tries to add a number to an entire, still-wrapped IO action, which simply doesn't type-check, regardless of what x's own type is. WHY THIS WORKS AS AN ANSWER ------------------------------ This reproduces the exact type mismatch the chapter describes -- attempting to use an IO String as if it were already an unwrapped String -- and the explanation correctly identifies that no manual technique short of >>= or do-notation can extract the real value, matching the chapter's own "infection" claim.