Created
February 18, 2013 09:42
-
-
Save beranradek/4976246 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
// Posčítání cen automobilů, jejichž výrobcem je Porsche: | |
case class CarModel(carMaker: CarMaker.Value, name: String, price: Option[Int]) | |
val models: List[CarModel] = List(...) | |
models.view.filter(_.carMaker == CarMaker.Porsche).map(_.price.getOrElse(0)).sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment