[commit: ghc] master: Clarify comment about data family arities (c6d4219)
git at git.haskell.org
git at git.haskell.org
Mon Jul 31 12:32:50 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/c6d4219ae46cddd63aa2b5762efaf99f815009a4/ghc
>---------------------------------------------------------------
commit c6d4219ae46cddd63aa2b5762efaf99f815009a4
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date: Mon Jul 31 08:29:48 2017 -0400
Clarify comment about data family arities
as requested in #14045.
[skip ci] comments only
>---------------------------------------------------------------
c6d4219ae46cddd63aa2b5762efaf99f815009a4
compiler/types/FamInstEnv.hs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs
index f40dabe..b9aa439 100644
--- a/compiler/types/FamInstEnv.hs
+++ b/compiler/types/FamInstEnv.hs
@@ -162,6 +162,11 @@ Over-saturation is also possible:
see Note [Eta reduction for data families]. Accordingly, the FamInst
is never over-saturated.
+Why can we allow such flexibility for data families but not for type families?
+Because data families can be decomposed -- that is, they are generative and
+injective. A Type family is neither and so always must be applied to all its
+arguments.
+
Note [Eta reduction for data families]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider this
More information about the ghc-commits
mailing list