Excellent video explaining GADTs in Haskell (apfelmus.nfshost.com) 22 points by johngunderman 16y ago ↗ HN
[–] vito 16y ago ↗ Note that his definition for `eq` using phantom types does not compile. It has two different notions of `a`: Int and Bool, but the type constructor for Eq only has one: Expr a -> Expr a -> Expr a.Other than that, a great overview!
[–] tumult 16y ago ↗ You can actually encode his example in just regular Haskell98 using type classes, without having to use GADTs: http://www.cs.rutgers.edu/~ccshan/tagless/jfp.pdfThough, it comes with some loss of clarity. And might hurt your brain.
3 comments
[ 0.21 ms ] story [ 15.0 ms ] threadOther than that, a great overview!
Though, it comes with some loss of clarity. And might hurt your brain.