This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package writer | |
import cats.Monoid | |
case class Writer[A, D](value: A, message: D)(implicit m: Monoid[D]) { | |
def flatMap[B](f: A => Writer[B, D]): Writer[B, D] = f(value) match { | |
case Writer(result, d) => Writer(result, m.combine(message, d)) | |
} | |
def map[B](f: A => B): Writer[B, D] = Writer[B, D](f(value), message) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.concurrent.{ExecutionContext, Future} | |
import scala.util.Try | |
import cats.implicits._ | |
import simulacrum.typeclass | |
sealed trait Error | |
case class SomethingWrong(e: Throwable) extends Error | |
@typeclass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt.Keys._ | |
import sbt._ | |
import sbtdocker.DockerPlugin.autoImport._ | |
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._ | |
lazy val resolversSettings = ... | |
lazy val versions = ... | |
lazy val dependenciesSettings = ... |