Challenge 1: Applying a Wrapped Function With <*> — Possible Solution ==================================================================== Main.hs: main :: IO () main = do print (Just (*2) <*> Just 10) print (Nothing <*> Just 10 :: Maybe Int) Output: Just 20 Nothing Explanation: Just (*2) <*> Just 10 has BOTH the function and the value wrapped in Just -- exactly the case fmap alone can't handle. <*> unwraps the function from the first Just, unwraps the value from the second, and applies one to the other, rewrapping the result as Just 20. When the function side is Nothing instead, there is no function to apply at all -- <*> short-circuits immediately to Nothing, the same "safely does nothing" behavior fmap showed for a Nothing VALUE in the previous chapter, just now on the function side instead. WHY THIS WORKS AS AN ANSWER ------------------------------ This demonstrates <*> with both a genuinely successful case (wrapped function, wrapped value, both Just) and the Nothing-short-circuits case, covering both real behaviors the chapter's own Just (+3) <*> Just 5 example implies but doesn't show explicitly.