[GHC] #11712: Very confusing error message with -fprint-explicit-kinds

#11712: Very confusing error message with -fprint-explicit-kinds -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- While trying to work out a type error I encountered the following, {{{ compiler/utils/Binary.hs:607:59: error: • Could not deduce: (~) * * arg * from the context: (~) * k (arg -> res) ... }}} Note how in the first line `(~)` is applied to four arguments whereas on the second it is applied to three. In general, it would be nice if we could make equalities a bit more readable, perhaps special-casing them in the pretty-printer as, {{{ (a :: k) ~ (b :: k') }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11712 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11712: Very confusing error message with -fprint-explicit-kinds -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by bgamari: @@ -11,1 +11,3 @@ - the second it is applied to three. + the second it is applied to three. Presuambly this is due to the former + being kind heterogeneous, so at very least I'd think that `~~` should be + used here. New description: While trying to work out a type error I encountered the following, {{{ compiler/utils/Binary.hs:607:59: error: • Could not deduce: (~) * * arg * from the context: (~) * k (arg -> res) ... }}} Note how in the first line `(~)` is applied to four arguments whereas on the second it is applied to three. Presuambly this is due to the former being kind heterogeneous, so at very least I'd think that `~~` should be used here. In general, it would be nice if we could make equalities a bit more readable, perhaps special-casing them in the pretty-printer as, {{{ (a :: k) ~ (b :: k') }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11712#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11712: Very confusing error message with -fprint-explicit-kinds -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Yes, that looks terribly inconsistent. I like printing equalities as `(a :: k) ~ (b :: k')`, at least with `-fprint-explicit-kinds`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11712#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11712: Very confusing error message with -fprint-explicit-kinds -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): The reason for the inconsistency is because, without `-fprint-equality- relations`, all of `(~)`, `(~~)`, and `(~#)` render as `(~)`. In a program that doesn't mention equality (or mentions only `(~)`), any of these may appear. In order not to scare users with three equality relations, I taught GHC to print just one. But I'm very uncertain about this decision. I asked on devs a while ago, and the best suggestion there was to render the heterogeneous ones as heterogeneous when, in fact, the kinds on their sides differ -- but only then. Perhaps I'll implement that alongside the other suggestion here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11712#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11712: Very confusing error message with -fprint-explicit-kinds
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 8.0.1
Component: Compiler (Type | Version: 7.10.3
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#11712: Very confusing error message with -fprint-explicit-kinds -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11712#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11712: Very confusing error message with -fprint-explicit-kinds -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged as 37dc43f152941595f882b0a5009088303102ea6b. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11712#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC