[GHC] #13415: Instance declarations don't recognize named wildcards
GHC
ghc-devs at haskell.org
Mon Mar 20 09:15:53 UTC 2017
#13415: Instance declarations don't recognize named wildcards
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.4.1
Component: Compiler (Type | Version: 8.0.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Poor/confusing | Unknown/Multiple
error message | Test Case:
Blocked By: | Blocking:
Related Tickets: #13324 | Differential Rev(s): Phab:D3332
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
I feel like we might not be on the same page here, so let me try to clear
things up.
I might be operating under a misconception here, but isn't it impossible
to properly detect wildcards in a type (and integrate it with
`-XPartialTypeSignatures`) unless it's a `LHsSigWcType`? That is why the
error message you get when you use named wildcards in instance contexts
currently is so bizarre--it doesn't even properly //detect// that it's a
wildcard, but instead misinterprets it as a type variable (leading to the
not-quite-on-the-mark `-XConstraintKinds` error).
So given this, if we are to be able to support `-XPartialTypeSignatures`
eventually, we need to first transition from the use of `LHsSigType` in
instance declarations to `LHsSigWcType`. I chose to do this first in its
own Diff since:
* It's far easier than adding `-XPartialTypeSignatures` support all in ome
go. This is an easily identifiable and necessary component that still
requires changing quite a few files, so splitting this task out will make
the Diff(s) that //do// deal with `-XPartialTypeSignatures` support less
noisy.
* It requires a Haddock change, which is somewhat ugly, and I'd rather get
it out of the way upfront.
* It has the immediate benefit of getting GHC to recognize named wildcards
in instance declarations, as noted above.
Does that make sense?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13415#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list