Oleg Nizhnik
odomontois.bsky.social
Oleg Nizhnik
@odomontois.bsky.social
Scala dev simping category theorists, enjoying inappropriate CS
Interestingly enough, the `transparent` modifier to an inline def can not only narrow the resulting type, but also widen it, if the widening implies extending the capture set.
scastie.scala-lang.org/Odomontois/6...
Scastie - An interactive playground for Scala.
import scala.annotation.tailrec //very poor performance pseudo monad sealed trait Tail[+A] { import Tail.* def flatMap[B](f: A => Tail[B]): Tail[B]^{this, f} = this match case Now(value) => ...
scastie.scala-lang.org
October 2, 2025 at 2:02 PM
The important lesson of the Coyoneda structure for scala is that whenever your datastructure has a Functor instance it could be covariant
September 30, 2025 at 1:29 PM
Encountered a weird behaviour of capture-checking treating a combination of java classes and generic synthax extensions
scastie.scala-lang.org/Odomontois/z...
Scastie - An interactive playground for Scala.
import cats.syntax.all.given val buf = StringBuffer() def foo(src: String): Either[String, StringBuffer -> Unit] = for x <- Right(1) yield _.append(x) val strs = List("a", "b", "c") val weird ...
scastie.scala-lang.org
September 22, 2025 at 3:14 PM