Created
February 24, 2009 21:32
-
-
Save p3t0r/69796 to your computer and use it in GitHub Desktop.
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
def priceCalculator(tax: Double=>Double, reduction: Double=>Double, price:Double, shipping:Double) = tax(reduction(price + shipping)) | |
def reducationCalculator(price:Double) = if(price > 50) price - 10 else price | |
val withTax = priceCalculator(_*1.19,_: Double=>Double, _:Double, _:Double) | |
val withTaxAndReduction = withTax(reducationCalculator(_), _:Double, _:Double) | |
println(withTaxAndReduction(97.5, 2.5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment