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 cats_effect_typeclass_exericise.concurrent_effect | |
| import java.time.format.DateTimeFormatter | |
| import cats.data.{Chain, EitherT, WriterT} | |
| import cats.effect._ | |
| import scala.language.higherKinds | |
| object Util { |
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 ex01 | |
| import cats.Monad | |
| import scala.annotation.tailrec | |
| sealed trait Coin | |
| case object Heads extends Coin | |
| case object Tails extends Coin |
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 observable | |
| import cats.effect.ExitCode | |
| import monix.eval.{Task, TaskApp} | |
| import monix.execution.Ack | |
| import monix.execution.Ack.{Continue, Stop} | |
| import monix.reactive.{Consumer, Observable, Observer} | |
| import scala.concurrent.Future | |
| import scala.concurrent.duration._ |
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 qiita_sample1 | |
| import cats.effect.{ExitCode, IO, IOApp} | |
| import cats.free.Free | |
| import hammock._ | |
| import hammock.apache.ApacheInterpreter | |
| object SimpleMain extends IOApp { | |
| val program: Free[HttpF, HttpResponse] = Hammock | |
| .request(Method.GET, uri"http://httpbin.org/get", Map()) |
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 qiita_sample1 | |
| import cats.{InjectK, ~>} | |
| import cats.effect.{ExitCode, Sync} | |
| import cats.free.Free | |
| import cats.syntax.either._ | |
| import iota.TListK.::: | |
| import iota.{CopK, TNilK} | |
| object Console { |
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 { |
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 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
| 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
| 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] = |