In scala, given a `trait Alg[F[_]] { ... }` the `trait Initial[+A] { def inst[F[_]](F: Alg[F]): F[A]` encoding works nicer than GADTs
@pchiusano @viktorklang I'm probably going to get it for this, but this looks like a nice encoding of the visitor pattern. /cc @nuttycom
-
-
@pchiusano@viktorklang@nuttycom s/run/accept, s/Alg/Visitor, with type ({ type f[x] = MyReturnType })#f -
@tixxit Visitor pattern kinda sorta like CPS / dual of pattern matching. But details matter - in visitor, it's all void + side effects. - 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.