Challenge 1: fmap Over Just, Nothing, and a List — Possible Solution ==================================================================== Main.hs: main :: IO () main = do print (fmap (*2) (Just 21)) print (fmap (*2) Nothing :: Maybe Int) print (fmap (*2) [1, 2, 3, 4]) Output: Just 42 Nothing [2,4,6,8] Explanation: fmap (*2) (Just 21) applies the doubling function to the value INSIDE the Just, producing Just 42 without any manual unwrapping. fmap (*2) Nothing has nothing to apply the function to at all -- the function is simply never called, and the result stays Nothing, exactly the "safely does nothing" behavior the chapter describes. fmap (*2) over the list doubles every element, the same behavior Haskell's own built-in map would give for a plain list -- confirming fmap is a genuine generalization, not a different behavior for lists specifically. WHY THIS WORKS AS AN ANSWER ------------------------------ This applies fmap to all three of the chapter's own example types (Just, Nothing, and a list), demonstrating the "safely does nothing" Nothing case explicitly rather than skipping it.