| > 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. 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. type instance Foo Bool = Int
type instance Foo YesNo = String
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... |
Hi. As someone that knows type theory and knows homotopy type theory and also knows Haskell well I would pose the following question to you: what purpose on god's green earth would be served by introducing univalence directly to haskell?
(Oh, and furthermore, you realize that fundeps have precisely the same issues in this setting?)
Contrariwise, don't you find it _useful_ that we can have two monoids, say And and Or, which have different `mappend` behaviour?
Now, can you imagine having that feature and _also_ respecting the idea that set-isomorphic things should be indistinguishable? How?