Challenge 2: summarizeList Using an As-Pattern — Possible Solution ==================================================================== Main.hs: summarizeList :: [Int] -> String summarizeList [] = "The list is empty." summarizeList full@(x:_) = "The list " ++ show full ++ " starts with " ++ show x main :: IO () main = do putStrLn (summarizeList []) putStrLn (summarizeList [10, 20, 30]) Output: The list is empty. The list [10,20,30] starts with 10 Explanation: full@(x:_) binds TWO things at once from a single successful match: full captures the entire matched list (used later via show full to print [10,20,30]), while x simultaneously captures just the head (10). Neither binding requires re-matching the list a second time or reconstructing it from x -- both are available directly from the one pattern match, exactly the convenience the chapter's own firstTwo example demonstrates. The empty-list case is handled separately as its own equation, since [] never matches the (x:_) pattern at all. WHY THIS WORKS AS AN ANSWER ------------------------------ This uses an as-pattern to bind both the whole list and its head in one match, matching the chapter's own firstTwo shape, with a separate equation correctly handling the empty-list case the as-pattern alone can't cover.