| How are type families worse than fundeps? That's a pretty ridiculous assertion; the things you can do with fundeps are strictly fewer than the things you can do with type families. > The principled approach You're dead wrong. The principled approach here is dependent types and full-featured type-level functions. Fundeps are a hack that let you implement a small subset of such functions (while type families gets us a bit closer to the ideal). > they have unacceptable limitations as a large-scale program structuring construct. Such as? > And instead use an ML-style module system for that purpose. How about we just use C macros for parametricity? ML-style modules have their uses, but they aren't nearly as elegant as a clean type-level solution. |
It's not about how much you can do (otherwise, just use a dynamic language, you can do everything, even shoot yourself in the foot!), it's about whether the result makes sense, and how much effort it takes to make sense of it.
> You're dead wrong. The principled approach here is dependent types and full-featured type-level functions. Fundeps are a hack that let you implement a small subset of such functions (while type families gets us a bit closer to the ideal).
You wanna play the dependent type theory card? Type families as provided in Haskell are incompatible with univalence.
Please kindly provide the isomorphism between `Int` and `String`.Case analysis only makes sense when performed on the cases of an inductive type, which the kind of all types is not.
> Such as?
The insistence on globally unique instances?
> How about we just use C macros for parametricity?
What does this even mean?
> ML-style modules have their uses, but they aren't nearly as elegant as a clean type-level solution.
See here for how modular type classes, as proposed for ML, would actually prevent the issues caused by Haskell-style type classes: http://blog.ezyang.com/2014/09/open-type-families-are-not-mo...