[GHC] #14798: Error message suggests applying (non-existant) function to more arguments

#14798: Error message suggests applying (non-existant) function to more arguments -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Poor/confusing Unknown/Multiple | error message Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Applying a constraint that doesn't hold fails, this is expected {{{ $ ~/code/qc-ghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci GHCi, version 8.5.20180128: http://www.haskell.org/ghc/ :? for help Prelude> :set -XGADTs -XConstraintKinds -XTypeApplications Prelude> data Dict c where Dict :: c => Dict c Prelude> data A Prelude> :t Dict @(Eq A) <interactive>:1:1: error: No instance for (Eq A) arising from a use of ‘Dict’ }}} but for `(Eq (Int -> Int))` GHC additionally suggests maybe applying a function (what function?) to more arguments {{{ Prelude> :t Dict @(Eq (Int -> Int)) <interactive>:1:1: error: No instance for (Eq (Int -> Int)) arising from a use of ‘Dict’ (maybe you haven't applied a function to enough arguments?) Prelude> }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14798 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14798: Error message suggests applying (non-existant) function to more arguments -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): This makes sense to me: the user might have written something like `pow 5 == 10` where `pow :: Int -> Int -> Int`. Of course, the error message is silly in your case, but I think it would be useful in the common case and is phrased appropriately so be wrong sometimes. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14798#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC