Last active
December 7, 2017 11:41
-
-
Save HomMarkHunt/a6336a5cb7a2972da8ad494d8de47f6c to your computer and use it in GitHub Desktop.
fp-scala-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cafe { | |
def buyCoffee(cc: CreditCard): Coffee = { | |
val cup = new Coffee() | |
cc.charge(cup.price) // 副作用 | |
cup | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment