Dear Haskell Café,
I am a long-time Haskell developer with a proliferation of private projects. I typically make very heavy use of stack and LTS. Today, I tried to bootstrap my first project using LTS-10.* (with GHC-8.2.2) and I ran into an interesting problem (for me).
In the past, with lts-9.* and below, when I started cranking on some code and writing a bunch of imports:
> import Control.Monad.Trans.Class (MonadTrans)
> import Data.Map (Map)
I would try to build first without updating the cabal file build-depends, and I would get something like the following error messages:
> /path/to/Module.hs:48:1: error:
> Failed to load interface for ‘Data.Map’
> It is a member of the hidden package ‘containers-0.5.7.1’.
> Perhaps you need to add ‘containers’ to the build-depends in your .cabal file.
> Use -v to see a list of the files searched for.
>
> /path/to/Module.hs:21:1: error:
> Failed to load interface for ‘Control.Monad.Trans.Class’
> It is a member of the hidden package ‘transformers-0.5.2.0’.
> Perhaps you need to add ‘transformers’ to the build-depends in your .cabal file.
> Use -v to see a list of the files searched for.
This was good because the error contained a suggested solution which contained the missing package, and I could sort of lazily add the build-depends I needed without having to memorize a (Module -> Package) mapping. I even had developer tooling to do it automatically.
With lts-10.*, however, the analogous error message looks like this:
> /path/to/Module.hs:9:1: error:
> Could not find module ‘Data.DoubleWord’
> Use -v to see a list of the files searched for.
> |
> 9 | import Data.DoubleWord (Word256(Word256), Word128(Word128))
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I am wondering, is there a way to bring back the solution suggestion? Not having access to it has made me realize how heavily I was using that feature. What do others think about this missing bit of supplemental error information?
Thanks,
-Rick Owens