3 ms·
What's the difference in motivation between doing things this way vs with functional dependencies?
by imh 9y ago
What's the difference in motivation between doing things this way vs with functional dependencies?
- evincarofautumn 9y agoType families are more general than fundeps, and can lead to simpler code with fewer extensions—FunctionalDependencies requires MultiParamTypeClasses, and often FlexibleInstances, FlexibleContexts, and UndecidableInstances. Fundeps are pretty clear for some simple examples (e.g., a container’s element type is uniquely determined by the container type), but in general I find it easier to think in terms of type-level functions than dependencies between types.