:i doesn't work for ~
Prelude> :set -XTypeOperators
Prelude> :i (~)
<interactive>:1:2: parse error on input ‘~’
Prelude> :k (~)
(~) :: k -> k -> Constraint
Trac metadata
Trac field | Value |
---|---|
Version | 7.11 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | hvr |
Operating system | |
Architecture |
- Show closed items
Relates to
- #100569.0.1
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Thomas Miedema mentioned in issue #9194 (closed)
mentioned in issue #9194 (closed)
- Richard Eisenberg mentioned in issue #10056 (closed)
mentioned in issue #10056 (closed)
- David Feuer changed weight to 5
changed weight to 5
- David Feuer added GHCi Tbug Trac import labels
added GHCi Tbug Trac import labels
- Developer
See ticket:10056#comment:95839. The last point there explains, essentially, why this is happening. Both #10056 (closed) and this ticket have the same resolution.
I'm not quite labeling this a duplicate of #10056 (closed), because this is worth a separate regression test.
Trac metadata
Trac field Value Related → #10056 (closed) - Maintainer
- Ryan Scott mentioned in issue #12023 (closed)
mentioned in issue #12023 (closed)
- Ryan Scott mentioned in issue #14316 (closed)
mentioned in issue #14316 (closed)
- Maintainer
Trac metadata
Trac field Value Related #10056 (closed) → #10056 (closed), #12023 (closed) - Maintainer
After some digging, it turns out that the reason this doesn't work is because the
identifier
parser production doesn't catch(~)
. It turns out that this patch:diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index c6face8..06a5722 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -629,6 +629,8 @@ identifier :: { Located RdrName } | qconop { $1 } | '(' '->' ')' {% ams (sLL $1 $> $ getRdrName funTyCon) [mj AnnOpenP $1,mu AnnRarrow $2,mj AnnCloseP $3] } + | '(' '~' ')' {% ams (sLL $1 $> $ eqTyCon_RDR) + [mop $1,mj AnnTilde $2,mcp $3] } ----------------------------------------------------------------------------- -- Backpack stuff
Is enough to make
:info (~)
go through:λ> :info (~) class (a ~ b) => (~) (a :: k) (b :: k) -- Defined in ‘Data.Type.Equality’ instance [incoherent] forall k (a :: k) (b :: k). (a ~ b) => a ~ b -- Defined in ‘Data.Type.Equality’
(The pretty-printing of the class definition of
(~)
is gnarly, though—I'm still figuring out how to work around that.) - Maintainer
Then again, it turns out that the
:info
output for(~~)
is similarly broken:GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci λ> import Data.Type.Equality λ> :i (~~) class ((a :: k0) ~~ (b :: k1)) => (~~) (a :: k0) (b :: k1) -- Defined in ‘GHC.Types’
- Developer
Both
:info
s look correct to me. Turn on-fprint-equality-relations
to get better output. I don't know how to do better, given-fprint-equality-relations
. - Maintainer
In that case, let's do this!
Trac metadata
Trac field Value Differential revisions - → D4877 - Ryan Scott mentioned in commit f4dce6cf
mentioned in commit f4dce6cf
- Ryan Scott changed milestone to %8.6.1
changed milestone to %8.6.1
- Maintainer
This could be merged to GHC 8.6 if desired.
Trac metadata
Trac field Value Test case - → ghci/scripts/T10059 - Ryan Scott added 1 deleted label
added 1 deleted label
- Ben Gamari closed
closed
- Maintainer
This is in 8.6.
Trac metadata
Trac field Value Resolution Unresolved → ResolvedFixed - Ben Gamari removed 1 deleted label
removed 1 deleted label
- Ben Gamari added Pnormal label
added Pnormal label