Skip to content

"lacks an accompanying binding" warning should suggest alternative spellings

Someone was just confused by the error message

src/Foo.hs:390:1: error:
    The type signature for 'fooBarBaz'
      lacks an accompanying binding
    |
390 | fooBarBaz :: MonadIO m => Int -> Int -> IO Int
    | ^^^^^^^^^^^^^^^^^^

when they wrote this code:

fooBarBaz :: Int -> Int -> IO m
fooBarbaz a b = do …

They would have had a better time if GHC would include the usual “did you mean…” list of similar names in this error message.

Bonus points if this lists only includes names bound in the same scope that don't have a type signature yet.

Edited by Sebastian Graf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information