Re:Basic Type-Level Programming in Haskell
by imh on Friday April 28, 2017 @11:31AM
(#14220203)
What's the difference in motivation between doing things this way vs with functional dependencies?
[ Parent
| on HN ]
Re:Basic Type-Level Programming in Haskell
by evincarofautumn on Friday April 28, 2017 @05:00PM
(#14223006)
Type 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.