haskell / haskell/error-messages

GHC will recommend a module that is hidden

Open
#524 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
76
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Consider:

```
import Data.HashMap.Strict (HashMap, insert)

f :: (Eq k) => k -> v -> HashMap k v -> HashMap k v
f = insert
```

Error is:

```
• Could not deduce (hashable-1.3.5.0:Data.Hashable.Class.Hashable
k)
arising from a use of ‘insert’
```

The problem is `Data.Hashable.Class` is hidden, so if I add:

```
import Data.Hashable.Class (Hashable)
```

I get:

```
/home/noon/tmp/hbl/src/Main.hs:4:1: error:
Could not load module ‘Data.Hashable.Class’
it is a hidden module in the package ‘hashable-1.3.5.0’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
```

The actual fix here is to import `Data.Hashable (Hashable)`.

Maybe we could do some kind of best-effort to find a publicly-exposed version of the constraint?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.