Skip to content

Instantly share code, notes, and snippets.

View taisukeoe's full-sized avatar

Taisuke Oe taisukeoe

  • Japan Scala Association, Inc.
  • Tokyo
  • X @OE_uia
View GitHub Profile
@smarter
smarter / gadt.md
Last active March 6, 2024 23:33
GADTs in Scala

Generalized Algebraic Data Types in Scala

Basic GADTs

Here's an ADT which is not a GADT, in Haskell:

data Expr = IntExpr Int | BoolExpr Bool
@milessabin
milessabin / gist:cadd73b7756fe4097ca0
Last active September 16, 2019 13:44
A new approach to encoding dependently-typed chained implicits, using singleton types ...
object Demo {
// A couple of type classes with type members ...
trait Foo[T] {
type A
}
object Foo {
implicit val fooIS = new Foo[Int] { type A = String }
}