Skip to content

Instantly share code, notes, and snippets.

View satorg's full-sized avatar

Sergey Torgashov satorg

View GitHub Profile

2025-08-20 Original post.

2025-08-24 I'd like to refine the terminology used. The pattern demonstrated here is most accurately described as "polymorphism over effects, (using Higher-Kinded Types)".

It's important to distinguish this from other related concepts. Although it bears a strong resemblance to the Tagless Final pattern, this approach is distinct, and as a tight (not vendor free) integration with Kyo. Furthermore, please note that it is not "Effect Polymorphism," which is an alternate and less precise phrasing.

Thanks a lot to all of you for the valuable feedback!


@kubukoz
kubukoz / .scalafmt.conf
Last active December 5, 2025 20:00
How to disable significant indentation in Scala
runner.dialect = scala3
runner.dialectOverride.allowSignificantIndentation = false
# allows `if x then y`
runner.dialectOverride.allowQuietSyntax = true
@ChristopherDavenport
ChristopherDavenport / Lock.scala
Last active October 11, 2021 13:10
Reentrant Lock
import cats._
import cats.syntax.all._
import cats.data._
import cats.effect._
import cats.effect.syntax.all._
import cats.effect.std.Semaphore
trait Lock[F[_]]{ self =>
def lock: F[Unit]
def unlock: F[Unit]

Principled Meta Programming for Scala

This note outlines a principled way to meta-programming in Scala. It tries to combine the best ideas from LMS and Scala macros in a minimalistic design.

  • LMS: Types matter. Inputs, outputs and transformations should all be statically typed.

  • Macros: Quotations are ultimately more easy to deal with than implicit-based type-lifting

  • LMS: Some of the most interesting and powerful applications of meta-programming