Skip to content

Error message suggests applying (non-existant) function to more arguments

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> 
Trac metadata
Trac field Value
Version 8.5
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information