Oleg Nizhnik
@odomontois.bsky.social
17 followers
19 following
5 posts
Scala dev simping category theorists, enjoying inappropriate CS
Posts
Media
Videos
Starter Packs
Oleg Nizhnik
@odomontois.bsky.social
· Oct 2
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
Oleg Nizhnik
@odomontois.bsky.social
· Sep 30
Oleg Nizhnik
@odomontois.bsky.social
· Sep 22
Scastie - An interactive playground for Scala.
def foo(src: String): Option[List[Int] -> Int] = None
def traverse[A, B](xs: List[A], f: A => Option[B]): Option[List[B]] = None
val weird = for
actions <- traverse(List[String](), foo)
_ = acti...
scastie.scala-lang.org
Oleg Nizhnik
@odomontois.bsky.social
· Sep 22
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
Oleg Nizhnik
@odomontois.bsky.social
· Sep 8