I hereby claim:
- I am agile-jordi on github.
- I am jordipradel (https://keybase.io/jordipradel) on keybase.
- I have a public key ASCTV_oEP96p1Tu6xD0CI_aTtgPXhVJAm0w-xXApTw0Sego
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| package com.agilogy.talks.errorhandling.extra | |
| import com.agilogy.talks.errorhandling.Email | |
| import scala.language.higherKinds | |
| import scala.util.{Failure, Success, Try} | |
| case class IllegalEmail(email:String) extends Exception | |
| sealed trait ErrorHandlingStyle{ |
| package ut | |
| import com.agilogy.talks.errorhandling.Email | |
| import com.agilogy.talks.errorhandling.extra._ | |
| import org.scalatest.FreeSpec | |
| import scala.util.{Failure, Success} | |
| class ChooseYourOwnStyleTest extends FreeSpec { |
| object TypeConstraints{ | |
| // Define some hierarchy | |
| trait Pet | |
| class Dog(name:String) extends Pet | |
| object Dog{ | |
| def apply(name:String):Dog = new Dog(name) | |
| } | |
| case class Alsatian(name:String) extends Dog(name) | |
| case class Cat(name:String) extends Pet |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| // With an enumeration like... | |
| // object Color extends Enumeration{...} | |
| // Create a format (or reads or writes) like this: | |
| // val fmt = EnumJson.enumFormat(Color); | |
| // The implementation | |
| object EnumJson { | |
| def enumReads[E <: Enumeration](enum: E): Reads[E#Value] = new Reads[E#Value] { |