Instantly share code, notes, and snippets.

View TupleSum.scala
object TupleSum extends App {
// Monoids aren't démodé and thursday are the new fridays
val l = List(
1 -> 1,
2 -> 3,
3 -> 3)
//println(l.sum)
View card.scala
package scalera
package object card {
sealed trait Suit
object Suit {
lazy val values = List(Spades, Diamonds, Hearts, Clubs)
}
case object Spades extends Suit
case object Diamonds extends Suit
View TypeClassApproach.scala
object TypeClassApproach extends App {
// The logic ...
trait StreamT[T]{
def values: Stream[T]
}
object StreamT {
View Boot.scala
package scalera.twitter
import org.apache.spark.streaming.dstream.DStream
import twitter4j.Status
object Boot extends Analytics{
// Set checkpoint dir
ssc.checkpoint("/tmp")