2.1 Why immutability?2.1.1 Correctness2.1.2 Historical preservation2.1.3 Security2.1.4 Safer multithreading2.1.5 Memoization for time performance2.1.6 Persistence for space performance2.1.7 The functional programming attitude2.2 An immutable stack2.3 A covariant immutable stack2.4 A queue, a queue, an immutable queue2.5 Mutable wrappers2.6 Undo and redo2.6.1 Create an army of clones2.6.2 Use a different data structure and the command pattern2.6.3 Undo and redo with mutable-over-immutable data structures2.7 The Hughes list: Build it cheap, pay for it later2.7.1 Reverse redux2.7.2 Currying and partial application2.7.3 Implementing the Hughes list2.7.4 Complexity of the Hughes list2.7.5 Where is the data in this data structure?2.7.6 A couple more performance considerations2.7.7 Reverse a linked list