highlights from Odersky's keynote
A lot of awesome slides @ http://www.slideshare.net/Odersky
Dependent Object Types calculus paper
highlights from Jonas Boner's keynote
Link to CRDT paper
In general terms, the CALM principle says that:
Link to CALM paper
More awesome slides @ http://www.slideshare.net/helenaedelson Reference implementation https://github.com/killrweather/killrweather
def f1: Future[Option[Int]] = ???
def f2: Future[Option[Int]] = ???
def f3: Future[Option[Int]] = ???
val result = for{
a <- OptionT(f1)
b <- OptionT(f2)
c <- OptionT(f3)
} yield a + b + c
val finOption: Future[Option[Int]] = result.run
def f1: Future[String \/ Int] = ???
def f2: Option[Int] = ???
def f3: Future[Int] = ???
val result = for{
a <- EitherT(f1)
b <- EitherT(Future(f2 \/> "B is missing"))
c <- EitherT(f3.map(v => \/.right(v))
} yield a + b + c
val finEither: Future[String \/ Int] = result.run
case class FutureOption[A](contents: Future[Option[A]]){
def flatMap[B](fn: A => FutureOption[B]) = FutureOption{
contents.flatMap{
case Some(value) => fn(value).contents
case None => Future.successful(None)
}
}
def map[B](fn: A => B) = FutureOption{
contents.map{ option =>
option.map(fn)
}
}
}
Great slides on this topic here
dcos package install spark
dcos package install hdfs
Slides available here
//product type: A has a B and C final case class A(b: B, c: C) //sum type: A is a B or C sealed trait A final case class B() extends A final case class C() extends A
//Example: a Calculation either succesfull and has value or failed and has an error
sealed trait Calculation
final case class Success(value: Int) extends Calculation
final case class Failure(msg: String) extends Calculation
//pattern matching
sealed trait A {
def doSomething: H = {
this match {
case B(d, e) => doB(d, e)
case C(f, g) => doC(f, g)
}
}
}
final case class B(d: D, e: E) extends A
final case class C(f: F, g: G) extends A
//polymorphism
sealed trait A {
def doSomething: H
}
final case class B(d: D, e: E) extends A {
def doSomething: H =
doB(d, e)
}
final case class C(f: F, g: G) extends A {
def doSomething: H =
doC(f, g)
}
sealed trait Calculation {
def add(value: Int): Calculation =
this match {
case Success(v) => Success(v + value)
case Failure(msg) => Failure(msg)
}
}
final case class Success(value: Int) extends Calculation
final case class Failure(msg: String) extends Calculation
sealed trait A {
def doSomething: H = {
this match {
case B(d, e) => doB(d, e)
case C(f, g) => doC(f, g)
}
}
}
final case class B(d: D, e: E) extends A
final case class C(f: F, g: G) extends A
sealed trait A {
def fold(doB: (D, E) => H, doC: (F, G) => H): H = {
this match {
case B(d, e) => doB(d, e)
case C(f, g) => doC(f, g)
}
}
}
final case class B(d: D, e: E) extends A
final case class C(f: F, g: G) extends A
sealed trait Result[A] {
def fold[B](s: A => B, f: B): B =
this match {
Success(v) => s(v)
Failure() => f
}
}
final case class Success[A](value: A) extends Result[A]
final case class Failure[A]() extends Result[A]
Code and presentation available here
Awesome approach to replace CRUD with storing WAL and snapshots to represent domain entities state and persist it in Cassandra
Slides available here
Videos and slides avalable @ Parleys
Some other links to slides @ cakesolutions blog