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 cats.Monad | |
import cats.data.{Chain, Ior} | |
import cats.mtl.MonadChronicle | |
import cats.syntax.applicative._ | |
import cats.syntax.functor._ | |
import cats.mtl.instances.chronicle._ | |
import cats.syntax.traverse._ | |
import cats.instances.list._ | |
def func[F[_]: Monad](n: Int)(implicit F: MonadChronicle[F, Chain[Int]]): F[Int] = |
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 cats.Monad | |
import cats.data.StateT | |
import cats.effect.{IO, Sync} | |
import cats.mtl.MonadState | |
import cats.syntax.show._ | |
import cats.instances.int._ | |
import cats.syntax.flatMap._ | |
import cats.syntax.functor._ | |
import cats.syntax.applicative._ | |
import cats.syntax.traverse._ |
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 cats.FlatMap | |
import cats.data.Kleisli | |
import cats.syntax.flatMap._ | |
import cats.syntax.functor._ | |
import cats.effect.Sync | |
import cats.mtl.ApplicativeAsk | |
import monix.eval.Task | |
type Config = Map[String, String] |
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 cats.FlatMap | |
import cats.data.{Chain, WriterT} | |
import cats.mtl.FunctorTell | |
import cats.syntax.flatMap._ | |
import cats.syntax.functor._ | |
import cats.data.Chain._ | |
import cats.effect.{IO, Sync} | |
import cats.mtl.instances.listen._ | |
import Chain.one |
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 scalaz.zio.console.Console | |
import scalaz.zio._ | |
// "org.scalaz" %% "scalaz-zio" % "1.0-RC3" | |
sealed trait AppError | |
case object NoValue extends AppError | |
trait Logger { val logger: Logger.Service } | |
object Logger { |
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 scalaz.zio.{App, IO, ZIO} | |
import scala.io.StdIn | |
// "org.scalaz" %% "scalaz-zio" % "1.0-RC3" | |
object SimpleMain extends App { | |
sealed trait AppError | |
case object NoValue extends AppError | |
def valueOf(key: String): ZIO[Map[String, String], AppError, String] = |
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
name := "doobie_test" | |
version := "0.1" | |
scalaVersion := "2.12.8" | |
resolvers += Resolver.sonatypeRepo("snapshots") | |
scalacOptions ++= Seq( | |
"-encoding", "utf8", |
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 withhttp4s | |
import cats.effect.{ContextShift, IO} | |
import doobie.specs2.IOChecker | |
import org.specs2.mutable.Specification | |
object MyServiceSpec extends Specification with IOChecker { | |
import scala.concurrent.ExecutionContext.Implicits.global | |
implicit val cs: ContextShift[IO] = IO.contextShift(global) |
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 withhttp4s | |
import cats.effect.{IO, IOApp} | |
import cats.implicits._ | |
import org.http4s.{HttpApp, HttpRoutes} | |
import org.http4s.implicits._ | |
import org.http4s.server.blaze._ | |
import cats.effect._ | |
import doobie._ | |
import doobie.implicits._ |
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 doobie_top | |
import doobie._ | |
import doobie.implicits._ | |
import cats.effect._ | |
import monix.eval.{Task, TaskApp} | |
case class Country(code: String, name: String, population: Long) | |
object SimpleSampleMain extends TaskApp { |