Skip to content

Import error message when using PackageImports

Motivation

When using PackageImports import error messages can be improved.

Example:

Test.hs:3:1-22: error:
    Could not find module ‘Data.Map’
    Perhaps you meant
      Data.Map (needs flag -package-key containers-0.6.2.1)
  |
3 | import "base" Data.Map
  | ^^^^^^^^^^^^^^^^^^^^^^

The message doesn't clearly communicate that the problem is Data.Map can be found in containers not base

Proposal

If the import error is caused by a package name package specific information should be included in the error message.

Possibly like this:

Test.hs:3:1-22: error:
    Could not find module ‘Data.Map’ in "base"
    Perhaps you meant
      Data.Map in "containers" (needs flag -package-key containers-0.6.2.1)
  |
3 | import "base" Data.Map
  | ^^^^^^^^^^^^^^^^^^^^^^
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information