https://michid.wordpress.com/2010/01/29/scala-type-level-enc...
I can't comment on the details, I'm more of of Clojure guy.