I hereby claim:
- I am calvinlfer on github.
- I am calvinlfer (https://keybase.io/calvinlfer) on keybase.
- I have a public key ASA7CwvEM3dYYzgHu4ZtBrxdSZBngyS79VoMI9x_ZKOnRAo
To claim this, I am signing this object:
| package dev.zio.schema.example.example8.advanced | |
| import dev.zio.schema.example.example8.Json | |
| import zio.Chunk | |
| import zio.schema.{Schema, StandardType} | |
| import java.util.UUID | |
| import scala.collection.immutable.ListMap | |
| trait FasterDecoder[A] { self => |
| import zio.Chunk | |
| import zio.schema._ | |
| import zio.prelude._ | |
| import scala.collection.immutable.ListMap | |
| trait Decoder[+A] { | |
| def decode(in: Json): Either[String, A] | |
| } |
| import cats.effect._ | |
| import com.datastax.oss.driver.api.core.CqlSession | |
| import com.datastax.oss.driver.api.core.`type`.UserDefinedType | |
| import com.datastax.oss.driver.api.core.cql.BoundStatement | |
| import com.datastax.oss.driver.api.core.data.UdtValue | |
| import com.datastax.oss.driver.internal.core.`type`.{DefaultListType, DefaultSetType} | |
| import com.ringcentral.cassandra4io.CassandraSession | |
| import com.ringcentral.cassandra4io.cql._ | |
| import java.net.InetSocketAddress |
| package io.kaizensolutions.jsonschema | |
| import io.circe.Json | |
| import io.circe.syntax._ | |
| import magnolia.{CaseClass, Magnolia} | |
| import scala.language.experimental.macros | |
| trait JsonSchema[A] { | |
| def generate: Json = Json.fromFields(JsonSchema.schema +: intermediate) |
| import scala.compiletime._ | |
| import zio.prelude._ | |
| package safer: | |
| type Digit5OrMore = Digit5OrMore.Type | |
| object Digit5OrMore extends Subtype[Int]: | |
| private inline def check(i: Int): Boolean = i >= 5 | |
| private inline def renderError(i: Int): String = s"input $i must be at least 5" | |
| inline def compiletime(inline i: Int): Digit5OrMore = |
| import better.files._ | |
| import zio._ | |
| import zio.console._ | |
| object DeduplicateByHash extends App { | |
| override def run(args: List[String]): URIO[zio.ZEnv, ExitCode] = { | |
| val program = | |
| for { | |
| raw <- Task.fromEither( | |
| Either.cond( |
| object PrimeExample extends IOApp { | |
| override def run(args: List[String]): IO[ExitCode] = { | |
| val simplePrimes: Stream[Pure, Int] = | |
| Stream | |
| .iterate(1)(_ + 1) | |
| .flatMap(candidate => | |
| Stream | |
| .range(2, candidate - 1) // can further optimize using sqrt(candidate) | |
| .exists(i => candidate % i == 0) |
| // Unhappy with the default behavior of a particular datatype? | |
| // You can override it as you wish, you must write a Diff and merge for the datatype you wish to override | |
| final case class Address( | |
| streetNumber: Int, | |
| streetName: String, | |
| city: String, | |
| country: String | |
| ) |
I hereby claim:
To claim this, I am signing this object:
| object ecommerce_marketing { | |
| type Event = Map[Attribute, Value] | |
| sealed trait Attribute | |
| object Attribute { | |
| case object EventType extends Attribute | |
| case object UserName extends Attribute | |
| case object ShoppingCartId extends Attribute | |
| case object Email extends Attribute | |
| case object WebSession extends Attribute |