In scala, given a `trait Alg[F[_]] { ... }` the `trait Initial[+A] { def inst[F[_]](F: Alg[F]): F[A]` encoding works nicer than GADTs
-
-
Replying to @pchiusano
@pchiusano Interesting. Can you Gist a comparison?1 reply 0 retweets 0 likes -
Replying to @viktorklang
Finally tagless encoding of GADTs in Scala: https://gist.github.com/pchiusano/10678834 … /cc
@viktorklang2 replies 4 retweets 12 likes -
Replying to @pchiusano
@pchiusano@viktorklang I'm probably going to get it for this, but this looks like a nice encoding of the visitor pattern. /cc@nuttycom1 reply 0 retweets 0 likes -
Replying to @tixxit
@pchiusano@viktorklang@nuttycom s/run/accept, s/Alg/Visitor, with type ({ type f[x] = MyReturnType })#f1 reply 0 retweets 0 likes -
Replying to @pchiusano
@pchiusano Visitor pattern doesn't imply void/side effects. Biggest difference is parameterization of data type by constructor + F[_]1 reply 0 retweets 0 likes
@pchiusano I'm just trying to have fun, no need to shut down the discussion like this. I'll stop replying.
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.