Currently kind-projector allows
val g = λ[Id ~> Option].run(x => Some(x))
to be rewritten as
val g = new (Id ~> Option) {
def run[A](x: Id[A]): Option[A] = Some(x)
}
I was wondering if there could be an alternative syntax that rewrites to
object g extends (Id ~> Option) {
def apply[A](x: Id[A]): Option[A] = Some(x)
// if possible it should allow rewrite to other method names as well:
// def run[A](x: Id[A]): Option[A] = Some(x)
}
in situations where the singleton type g.type is required.
i.e. in Shapeless
the[Case1.Aux[g.type, Id[Int], Option[Int]]]
should compile.