I hereby claim:
- I am emotecontrol on github.
- I am robertdecaire (https://keybase.io/robertdecaire) on keybase.
- I have a public key ASDrQ6TveXWU5zeDDjjyV8BqGVR0m2CMzwQ77wtuVgBgJwo
To claim this, I am signing this object:
val p: Option[Int] = None | |
p.get | |
// java.util.NoSuchElementException: None.get |
val o1 = Some("hello") | |
val o2 = None | |
val o3 = Some("world") | |
val o4 = for { | |
a <- o1 | |
b <- o2 | |
c <- o3 |
val o1 = Some("hello") | |
val o2 = None | |
val o3 = o1.flatMap(a => o2.map(b => a + " " + b)) | |
// o3: Option[String] = None |
val o1 = Some("hello") | |
val o2 = Some("world") | |
val o3 = o1.flatMap(a => o2.map(b => a + " " + b)) | |
// o3: Option[String] = Some(hello world) |
val op = Option("hello") | |
// op: Option[String] = Some(hello) | |
val some = Some("hello") | |
// some: Some[String] = Some(hello) | |
val none = None | |
// none: None.type = None |
// given some function 'combine' that can take three values and combine them into one: | |
def combine(a: A, b: A, c: A): A | |
// this for-comprehension | |
for { | |
a <- m1 | |
b <- m2 | |
c <- m3 | |
} yield combine(a,b,c) |
val list = List(1,2) | |
val mappedList = list.map(makeListOfDoubles) | |
// mappedList: List[List[Double]] = List(List(1.0), List(2.0)) |
val list = List.apply(1) | |
// list: List[Int] = List(1) | |
val list2 = List(1) | |
// list2: List[Int] = List(1) | |
def makeListofDoubles(int: Int): List[Double] = { | |
List(int.toDouble) | |
} |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object: