I hereby claim:
- I am lutzh on github.
- I am lutzh (https://keybase.io/lutzh) on keybase.
- I have a public key whose fingerprint is 0792 9D85 E164 3F6E 9D9A FA9A 7BD5 61B6 49B0 0F70
To claim this, I am signing this object:
➜ ~ brew --config | |
HOMEBREW_VERSION: 0.9.5 | |
ORIGIN: https://github.com/Homebrew/homebrew.git | |
HEAD: b984d3e996321207b35af391d5f1f6ef2aaa1774 | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: 8-core 64-bit sandybridge | |
OS X: 10.9.2-x86_64 |
def connections(from: Station, to: Station, departureTime: Time): Set[Seq[Hop]] = { | |
require(from != to) | |
def connections(from: Station, departureTime: Time, visitedStations: Set[Station]): Set[Seq[Hop]] = | |
{ | |
val hopsFrom: Set[Hop] = hops.getOrElse(from, Set[Hop]()) | |
hopsFrom.filter(hop => hop.departureTime >= departureTime) | |
.filterNot(hop => visitedStations.contains(hop.to)) | |
.flatMap(hop => |
/* | |
* Copyright © 2012 Typesafe, Inc. All rights reserved. | |
*/ | |
package com.typesafe.training.scalatrain | |
object TestData { | |
val munich = Station("Munich") |
trait A { | |
def action() = println("a") | |
} | |
trait B extends A { | |
override def action() = println("b") | |
} | |
trait C { | |
def action() = println("c") |
I hereby claim:
To claim this, I am signing this object:
Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
// Start Scala | |
// :paste the following: | |
object Currencies { | |
sealed trait Rate { | |
def to(currency: Rate, amount: Double): Money | |
} |