Skip to content

Instantly share code, notes, and snippets.

@SystemFw
SystemFw / semiauto.scala
Created July 13, 2017 13:15
Shapeless semiautomatic derivation
object Module {
import shapeless._
sealed trait Decode[A] {
def decode(s: String): Option[A]
}
object Decode {
def dummy[A]: Decode[A] = new Decode[A] {
def decode(s: String) = Option.empty[A]
}
@SystemFw
SystemFw / Logging.scala
Last active July 13, 2017 13:22
Logging failures on Task
import scalaz.{-\/, \/-}
import scalaz.concurrent.Task
import scalaz.syntax.monad._
/*
* Easily adaptable to Monix, cats, fs2, cats-effect and so on
*/
object Logger {
sealed trait Level
object Level {