The Neophyte's Guide to Scala(danielwestheide.com)
danielwestheide.com
The Neophyte's Guide to Scala
http://danielwestheide.com/scala/neophytes.html
8 comments
for anyone interested in learning Scala, i highly recommend this set of (~15 or so) blog posts. i started working through them in early 2013 as they were posted. The posts on path-dependent types and the post on type classes are particularly good. The author clearly has a deep understanding of the key parts of the language.
Found this site really useful when I was working with Scala. In particular I remember the descriptions of Option/Either/Try were very clear.
The author writes about “path-dependent types”, but all I can see is plain existentials.
a1.B and a2.B in the example are path-dependent types - you couldn't express them as just existentials (you could express the types of a1 and a2 as existentials, but you couldn't write "a1.b = Some(b1)" in a purely existential typing system - you need some way to "get the type out").
Not with Haskell-style (or, rather, System F-omega-style) existentials, sure. But why not with strong existentials, like what you get with first-class modules in OCaml or 1ML?
At that point this is just semantics. I find the phrase "path-dependent types" useful and intuitive (though admittedly easily confused with "dependent types"); maybe we could use that phrase to describe what OCaml has too?