This file contains 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
//> using scala "2" | |
//> using lib "eu.timepit::refined:0.10.1" | |
import eu.timepit.refined.auto._ | |
import eu.timepit.refined.types.string._ | |
import eu.timepit.refined.types.numeric._ | |
case class OrderLine(product: NonEmptyString, quantity: PosInt) | |
OrderLine("100", 10) |
This file contains 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
//> using scala "2" | |
//> using lib "org.typelevel::cats-core:2.8.0" | |
//> using lib "eu.timepit::refined:0.10.1" | |
//> using lib "io.circe::circe-core:0.14.2" | |
//> using lib "io.circe::circe-parser:0.14.2" | |
//> using lib "io.circe::circe-generic:0.14.2" | |
//> using lib "io.circe::circe-refined:0.14.2" | |
import cats.data.NonEmptyList |
This file contains 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
//> using lib "org.typelevel::cats-effect:3.3.12" | |
//> using lib "co.fs2::fs2-core:3.3.0" | |
package net.michalp.playground | |
import cats.effect.IO | |
import cats.effect.IOApp | |
import cats.effect.std.Queue | |
import cats.effect.std.QueueSink | |
import cats.effect.std.QueueSource |
This file contains 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
//> using scala "3" | |
//> using lib "org.typelevel::cats-effect:3.3.12" | |
//> using lib "co.fs2::fs2-core:3.3.0" | |
package net.michalp.conway | |
import cats.effect.IO | |
import cats.effect.IOApp | |
import fs2.Stream |
This file contains 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
//> using scala "2.13" | |
sealed trait SampleTrait | |
case class SampleValue(v: String) extends SampleTrait | |
object SampleSingleton extends SampleTrait | |
def f[X <: SampleTrait](x: X): Unit = | |
println(x) | |
def g[X](x: X)(implicit ev: X <:< SampleTrait): Unit = |
This file contains 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
//> using dep "org.typelevel::kittens:3.0.0" | |
//> using dep "org.typelevel::cats-core:2.9.0" | |
import cats.Show | |
import cats.implicits.given | |
import cats.derived.* | |
case class Person(name: String, surname: String, age: Int) | |
given Show[Person] = semiauto.show |
This file contains 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
//> using scala "3.3.0" | |
//> using dep "org.typelevel::cats-effect:3.5.1" | |
//> using dep "com.softwaremill.sttp.tapir::tapir-core:1.6.0" | |
//> using dep "com.softwaremill.sttp.tapir::tapir-cats:1.6.0" | |
//> using dep "com.softwaremill.sttp.tapir::tapir-swagger-ui-bundle:1.6.0" | |
import cats.effect.ExitCode | |
import cats.effect.IO | |
import cats.effect.IOApp |
This file contains 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
//> using scala "3.3.0" | |
//> using dep "org.typelevel::cats-effect:3.5.1" | |
//> using dep "com.softwaremill.sttp.tapir::tapir-core:1.6.0" | |
//> using dep "com.softwaremill.sttp.tapir::tapir-cats:1.6.0" | |
//> using dep "com.softwaremill.sttp.tapir::tapir-http4s-server:1.6.0" | |
//> using dep "com.softwaremill.sttp.tapir::tapir-swagger-ui-bundle:1.6.0" | |
//> using dep "org.http4s::http4s-ember-server:0.23.22" | |
//> using dep "org.slf4j:slf4j-simple:1.7.36" | |
import cats.effect.ExitCode |
This file contains 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
//> using scala "3.3.0" | |
//> using dep "dev.optics::monocle-core:3.2.0" | |
//> using dep "dev.optics::monocle-macro:3.2.0" | |
import monocle.syntax.all._ | |
case class Product(id: String, name: String, price: Double) | |
case class Shelf(id: String, product: Product) | |
case class Display(id: String, kind: "Ambient" | "Chilled", shelves: List[Shelf] ) | |
case class Alley(id: String, displays: List[Display]) |
This file contains 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
//> using scala "2" | |
//> using dep "org.scalameta::scalameta:4.8.14" | |
import scala.meta._ | |
import scala.meta.dialects.Scala3 | |
object Codegen { | |
def codeWithInline = | |
source""" | |
object Generated { |