SLIDE 1
Basics of Functional Programming
1 / 12
Basics of Functional Programming 1 / 12 A Motivating Example: Cafe - - PowerPoint PPT Presentation
Basics of Functional Programming 1 / 12 A Motivating Example: Cafe 1 class Cafe { 2 def buyCoffee(cc: CreditCard): Coffee = { 3 val cup = new Coffee() 4 cc.charge(cup.price) 5 cup 6 } 7 } Bad because card is charged as a side
1 / 12
2 / 12
3 / 12
4 / 12
5 / 12
6 / 12
7 / 12
8 / 12
9 / 12
10 / 12
11 / 12
12 / 12