Challenge 2: Checking a Partially Applied Function's Type in GHCi — Possible Solution ==================================================================== GHCi session: Prelude> let add :: Int -> Int -> Int; add x y = x + y Prelude> :t (add 5) (add 5) :: Int -> Int -- add's real type is Int -> (Int -> Int) -- a function taking one Int -- and returning ANOTHER function of type Int -> Int. Applying add to -- just one argument, 5, fully satisfies that first arrow. What's left -- over -- what (add 5) actually evaluates to -- is exactly the second -- piece of that chain: a function of type Int -> Int, still waiting -- for one more Int before it produces a final Int. This is precisely -- why GHCi reports (add 5) :: Int -> Int rather than some kind of -- error or incomplete-call placeholder -- there's no such thing as an -- "incomplete call" in Haskell, only a real function value that -- happens to still expect more arguments. WHY THIS WORKS AS AN ANSWER ------------------------------ This uses GHCi's own :t command to inspect a partially applied function's real type, and the explanation correctly ties the result back to the chapter's own Int -> (Int -> Int) decomposition of the original two-argument signature.