This post uses the excellent Ammonite REPL for Scala REPL.
Thank you, Li Haoyi, for building it!
This post uses the excellent Ammonite REPL for Scala REPL.
Thank you, Li Haoyi, for building it!
@ import $ivy.`org.typelevel::cats-effect:0.10.1` | |
import $ivy.$ | |
@ import cats.effect.IO, cats.implicits._ | |
import cats.effect.IO, cats.implicits._ | |
@ val foo: IO[Either[String, Int]] = IO(throw new RuntimeException("!")) | |
foo: IO[Either[String, Int]] = Delay(ammonite.$sess.cmd2$$$Lambda$2001/359985955@1bbfd42f) | |
@ foo.attempt |
(1) Creating an Engineering Career Ladder | |
* he rolled out two career ladders in his experience | |
* he disputes that any company truly has a "flat org" | |
* notes that Senior Level Engineer is the anchor | |
* messaging is critical, e.g. important to announce promotions since it indicates importance of career ladder | |
* comments that general feedback, "you're doing great" isn't worth much. He suggests giving specific feedback on positives or needs-improvement | |
* Talked about 3 ladders: | |
- simple | |
- snowflake |
@ val x: Kleisli[Task, String \/ Int, Boolean] = Kleisli {
case -\/(_) => Task.now(true)
case \/-(_) => Task.now(false)
}
x: Kleisli[Task, String \/ Int, Boolean] = Kleisli(ammonite.$sess.cmd5$$$Lambda$2811/243334301@38171f9)
@ val x: Kleisli[Task, String, Boolean] = Kleisli { _ => Task.now(true) }
x: Kleisli[Task, String, Boolean] = Kleisli(ammonite.$sess.cmd6$$$Lambda$2832/1335778574@1bde703a)
@ import $ivy.`org.typelevel::cats-effect:0.10.1` | |
@ import cats._, cats.data._, cats.implicits._, cats.effect._ | |
@ def lift(i: Int): IO[Int] = Timer[IO].sleep(1.second) >> IO { | |
println(Thread.currentThread.getName + "At time = " + java.time.Instant.now) | |
i | |
} |
After scouring the internet and piece-mealing together the correct way to do this, here is a step-by-step, all-in-one-place guide to making logback STFU when running your unit tests.
Save the following as logback-test.xml
under src/test/resources
:
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%msg%n</pattern>
import $ivy.`com.beachape::enumeratum-circe:1.5.17` | |
import enumeratum._ | |
sealed trait Color extends EnumEntry; case object Color extends Enum[Color] with CirceEnum[Color] { | |
case object Red extends Color | |
case object Green extends Color | |
case object Blue extends Color |
$cat app/Main.hs
module Main where
{-# LANGUAGE ExtendedDefaultRules #-}
import Control.Monad.Trans.List
import Conduit
import Control.Applicative
import Control.Arrow | |
import Control.Monad | |
-- Prelude Control.Monad Control.Arrow> :t (|||) | |
-- (|||) :: ArrowChoice a => a b d -> a c d -> a (Either b c) d | |
-- Prelude Control.Monad Control.Arrow> :k ArrowChoice | |
-- ArrowChoice :: (* -> * -> *) -> Constraint |