3 ms·
Dependent types to the rescue! Unfortunately dependent types are incredibly difficult to get working (Scala's type system is already turing complete (and can h
by octo_t 13y ago
Dependent types to the rescue!
Unfortunately dependent types are incredibly difficult to get working (Scala's type system is already turing complete (and can handle path-dependent types) and true dependent types would make reasoning about nigh-on impossible).
I would argue that you're dealing with a sub-typing problem here, Email <: String, LongLat <: (Int, Int)*
* I would say in Scala:
case class LongLat(longitude: Int, Latitude: Int)
- islon 13y agoScala doesn’t support dependent types AFAIK
- octo_t 13y agohttp://stackoverflow.com/questions/2693067/what-is-meant-by-scalas-path-dependent-types http://stackoverflow.com/questions/2693067/what-is-meant-by-... they are kinda cool, but also limited as hell.
- andrewcooke 13y agoif it's type system is turing complete, how can it not? presumably it just doesn't have a short syntax for them? if so, given what i know of the rest of scala, i'm surprised one can't be defined...