Skip to content

Instantly share code, notes, and snippets.

View mielientiev's full-sized avatar

Ihor Mielientiev mielientiev

View GitHub Profile
@notxcain
notxcain / Logger.scala
Created June 7, 2018 14:12
Logger[F[_]]
import cats.Applicative
import cats.effect.Sync
import com.evotor.common.logging.Logger.Level
import org.slf4j.LoggerFactory
import scala.reflect.ClassTag
trait Logger[F[_]] {
def log(level: Level.Value, msg: => String, throwable: Throwable): F[Unit]
@SystemFw
SystemFw / RankN shift-and-shiftback.md
Last active June 1, 2019 03:15
Cats-effect, blocking, RankN-types.

cats-effect

The cats-effect project defines a purely functional effect type (IO[A]), and associated typeclasses defining its behaviour. The ones we care about for this example are:

trait Sync[F[_]] extends MonadError[F, Throwable] {
   def delay[A](a: => A): F[A]
   ...
}