[commit: ghc] master: Support wild cards in data/type family instances (d9d2102)
git at git.haskell.org
git at git.haskell.org
Mon Aug 3 13:36:44 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/d9d2102ea7f6da1bc3a69fa469b89ea843cb8b02/ghc
>---------------------------------------------------------------
commit d9d2102ea7f6da1bc3a69fa469b89ea843cb8b02
Author: Thomas Winant <thomas.winant at cs.kuleuven.be>
Date: Mon Aug 3 14:57:40 2015 +0200
Support wild cards in data/type family instances
Handle anonymous wild cards in type or data family instance
declarations like
unnamed type variables. For instance (pun intented):
type family F (a :: *) (b :: *) :: *
type instance F Int _ = Int
Is now the same as:
type family F (a :: *) (b :: *) :: *
type instance F Int x = Int
Note that unlike wild cards in partial type signatures, no errors (or
warnings
with -XPartialTypeSignatures) are generated for these wild cards, as
there is
nothing interesting to report to the user, i.e. the inferred kind.
Only anonymous wild cards are supported here, named and
extra-constraints wild
card are not.
Test Plan: pass new tests
Reviewers: goldfire, austin, simonpj, bgamari
Reviewed By: simonpj, bgamari
Subscribers: goldfire, thomie
Differential Revision: https://phabricator.haskell.org/D1092
GHC Trac Issues: #3699, #10586
>---------------------------------------------------------------
d9d2102ea7f6da1bc3a69fa469b89ea843cb8b02
compiler/rename/RnSource.hs | 9 +++++-
compiler/typecheck/TcTyClsDecls.hs | 35 ++++++++++++++++++++--
docs/users_guide/7.12.1-notes.xml | 9 ++++++
docs/users_guide/glasgow_exts.xml | 31 +++++++++++++++++++
.../should_compile/DataFamilyInstanceLHS.hs | 13 ++++++++
.../should_compile/DataFamilyInstanceLHS.stderr | 16 ++++++++++
.../should_compile/TypeFamilyInstanceLHS.hs | 9 ++++++
.../should_compile/TypeFamilyInstanceLHS.stderr | 13 ++++++++
testsuite/tests/partial-sigs/should_compile/all.T | 2 ++
.../NamedWildcardInDataFamilyInstanceLHS.hs | 10 +++++++
.../NamedWildcardInDataFamilyInstanceLHS.stderr | 4 +++
.../NamedWildcardInTypeFamilyInstanceLHS.hs | 5 ++++
.../NamedWildcardInTypeFamilyInstanceLHS.stderr | 4 +++
.../should_fail/WildcardInTypeFamilyInstanceLHS.hs | 8 -----
.../WildcardInTypeFamilyInstanceLHS.stderr | 6 ----
testsuite/tests/partial-sigs/should_fail/all.T | 3 +-
16 files changed, 159 insertions(+), 18 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d9d2102ea7f6da1bc3a69fa469b89ea843cb8b02
More information about the ghc-commits
mailing list