haskell / haskell/haskell-mode
Issue with haskell-process-auto-import-loaded-modules
- Dominant language
- Emacs Lisp
- Stars
- 1.4k
- Forks
- 354
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 2
Description
I have a [package](https://github.com/haskell-streaming/streaming-process) with two modules:
* `Streaming.Process`
* `Streaming.Process.Lifted`
Both modules export the same functions, but with different types.
If I try and work on a new module in that package that imports and uses `Streaming.Process.Lifted` (but _not_ `Streaming.Process`) with `haskell-process-auto-import-loaded-modules` enabled, then this occurs (from `*haskell-process-log*`):
```
-> :load "/Users/ivan/Haskell/streaming-process/src/Streaming/Process/GPG.hs"
<- [1 of 3] Compiling Streaming.Process ( src/Streaming/Process.hs, interpreted )
<- [2 of 3] Compiling Streaming.Process.Lifted ( src/Streaming/Process/Lifted.hs, interpreted )
<- [3 of 3] Compiling Streaming.Process.GPG ( /Users/ivan/Haskell/streaming-process/src/Streaming/Process/GPG.hs, interpreted )
-> :m + Streaming.Process Streaming.Process.GPG Streaming.Process.Lifted
```
I'm not sure why `Streaming.Process` is imported there (I guess because it's transitively imported by `Streaming.Process.Lifted`?) but it means that trying to use a function that's imported from both modules fails:
```
λ> :t withStreamingOutput
:1:1: error:
Ambiguous occurrence ‘withStreamingOutput’
It could refer to either ‘Streaming.Process.Lifted.withStreamingOutput’,
imported from ‘Streaming.Process.Lifted’
(and originally defined
at src/Streaming/Process/Lifted.hs:106:1-19)
or ‘Streaming.Process.withStreamingOutput’,
imported from ‘Streaming.Process’
(and originally defined at src/Streaming/Process.hs:111:1-19)
```
Contributor guide
Assessment
This issue has not been assessed yet.