path-dependent types in Scala

0
Travis Brown @travisbrown

@GabrielG439 @jco @econlon But all this is only true if the static type of `t` is unrefined (in which case the `Out` is useless, anyway).

2015-11-07 01:35:48
Gabriella Gonzalez @GabriellaG439

@jco @econlon @travisbrown So the point is that existential quantification is okay, but you can't have a top-level function like "hey"

2015-11-07 01:36:29
Travis Brown @travisbrown

@GabrielG439 @jco @econlon The compiler is perfectly happy to track `Out` in a type refinement, in which case it knows more than existence…

2015-11-07 01:36:52
Travis Brown @travisbrown

@GabrielG439 @econlon But you can!—e.g. Shapeless is entirely built on methods like @jco's `hey`. This is what path-dependent types do.

2015-11-07 01:40:14
Gabriella Gonzalez @GabriellaG439

@travisbrown @econlon @jco Interesting. I'll have to study this more. Thanks for explaining that :)

2015-11-07 01:44:32
Travis Brown @travisbrown

@GabrielG439 @jco @econlon I'd be curious to see an example where using a type parameter allows better type inference than a type member.

2015-11-07 01:46:27