Challenge 1: Resolving haskell2-2's Own Challenge 3 Scenario for Real — Possible Solution ==================================================================== Main.hs: findUser :: Int -> Maybe String findUser 5 = Just "alice@example.com" findUser _ = Nothing findOrderByEmail :: String -> Maybe String findOrderByEmail "alice@example.com" = Just "Order #42" findOrderByEmail _ = Nothing findRecentOrder :: Int -> Maybe String findRecentOrder userId = findUser userId >>= \email -> findOrderByEmail email main :: IO () main = do print (findRecentOrder 5) -- successful chain print (findRecentOrder 99) -- fails at the first step Output: Just "Order #42" Nothing Explanation: findRecentOrder 5 first calls findUser 5, which succeeds with Just "alice@example.com". >>= unwraps that real email string and passes it to the lambda, which calls findOrderByEmail with the actual value -- exactly the dependency haskell2-2's own Applicative example couldn't express. findRecentOrder 99 fails at the very first step: findUser 99 is Nothing, so >>= short-circuits immediately, never even calling the lambda or reaching findOrderByEmail at all. WHY THIS WORKS AS AN ANSWER ------------------------------ This implements the exact user-lookup-then-email-lookup chain the chapter names as resolving haskell2-2's own unresolved example, demonstrating both the successful dependent chain and the short- circuit-on-failure case.