Created
June 17, 2014 04:24
-
-
Save dsugden/c967226c2ed88bb87d07 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
case class Better(total : List[Int]) | |
object Better{ | |
def sum(i:Int)(b:Better):(Better,Int) = { | |
val result = if(b.total.length > 1) 99 else b.total.sum | |
val newBetter = b.copy(total = i :: b.total) | |
(newBetter, result) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment