Map, filter, fold
Three fundamental higher-order functions: map applies function to each element, filter selects elements, fold aggregates values. These operations work on collections enabling functional data processing.
Formula
fold(f, accumulator, list) → single value
Real World
An online shop like ASOS calculates a basket total by using map to apply discounts to each item price, filter to remove out-of-stock items, and fold to sum the remaining prices.
Exam Focus
Trace through a worked example showing input list, intermediate result, and final output for each operation to gain full method marks.
How well did you know this?