Skip to content

Instantly share code, notes, and snippets.

View kitlangton's full-sized avatar
🤠

Kit Langton kitlangton

🤠
View GitHub Profile
@kitlangton
kitlangton / streaming-event.ts
Created March 18, 2026 20:23
Lazy shared Effect stream from Bus.subscribeAll with CLI subscriber demo
import { Bus } from "@/bus"
import { BusEvent } from "@/bus/bus-event"
import { Instance } from "@/project/instance"
import { Effect, Fiber, Layer, ManagedRuntime, Queue, ServiceMap, Stream } from "effect"
import * as readline from "node:readline"
import z from "zod"
import { Log } from "../util/log"
export namespace EventStream {
const log = Log.create({ service: "streaming-event" })
import { AnimatePresence, motion } from "motion/react"
type BlurTransitionProps = {
text: string
className?: string
}
export function BlurTransition({ text, className = "" }: BlurTransitionProps) {
return (
<AnimatePresence mode="popLayout">
package tttt
// Awesome 😄 That looks great. It maintains all of the properties of the Frank (or, Langton style 😛) encoding—where one can recurse with different handlers and short-circuit trivially—without losing the tail-recursive stack safety. And I fully trust you when it comes to the JIT-ability of it all!
// The only issues are minor UX ones, in that it could be confusing for the user to know whether to call
import izumi.reflect.Tag
type Id[T] = T
type Const[T] = [U] =>> T
type MX[T] = Any
@kitlangton
kitlangton / kyo.scala
Last active March 19, 2024 23:55
Kyo (Alt. Encoding Explorations)
package zero
import izumi.reflect.Tag
import Kyo.*
import scala.collection.View.FlatMap
type Id[T] = T
type Const[T] = [U] =>> T
type MX[T] = Any
@kitlangton
kitlangton / zero.scala
Created March 10, 2024 13:55
zero.scala
import izumi.reflect.Tag
import <.Handler
opaque type <[+A, -S] = Zero[A, S]
inline implicit def toZero[A, S](v: A): A < S = Zero.Succeed(v)
inline implicit def fromZero[A, S](zero: Zero[A, S]): A < S = zero
object < :
import Zero.*
package book
object WithoutTypeParams:
sealed trait Expr
case class IntExpr(int: Int) extends Expr:
def add(other: IntExpr): IntExpr = IntExpr(int + other.int)
case class BoolExpr(bool: Boolean) extends Expr
case class IfThenElseExpr(cond: BoolExpr, thenExpr: Expr, elseExpr: Expr) extends Expr
import zio._
import java.io.IOException
import java.time.LocalDateTime
//
// Meetup.com
//
// Notifications
// notify every user who is subbed to an upcoming event
package zio.http.api.internal
sealed trait Box[A] extends Product with Serializable { self =>
def zip[B](that: Box[B])(implicit zipper: Zipper[A, B]): Box[zipper.Out] =
Box.Zip[A, B, zipper.Out](self, that, zipper)
def map[B](f: A => B)(implicit tupleSize: TupleSize[B]): Box[B] =
Box.Map(self, f, tupleSize)
def tupleSize: Int = self match {
import zio.{RuntimeFlags => _, _}
import scala.annotation.implicitNotFound
// # ANNOUNCEMENTS
// - NEXT WEEK (Friday, 16th) : Akka to ZIO Demo
// - NEXT, NEXT WEEK (Friday, 23rd): Akka to ZIO Panel
// # ZIO API Design Techniques
What a beautiful file.
That's great.
One more line will do.