<div dir="ltr">I believe the particular feature you are talking about is a feature of GHC. Whether a suggestion is show or not merely depends on whether GHC sees the package in question in its package database(s).<br><br>If you are using stack, then you can look at one of your LTS 9 projects, and run<br><br><font face="monospace, monospace">stack exec -- ghc-pkg list</font><br><br>In order to see the list of installed packages. (I think something like `cabal exec ghc-pkg list` should do the same for a cabal project.)<br><br>Identify the packages you tend to use, go into one of your LTS 10 projects, and `stack install pkg1 pkg2 ...`<br><br>Note that with stack, each minor version of LTS has its own package database, so packages locally installed into lts-10.1 will not necessarily be available in your local instance of lts-10.2. Repeat stack install to taste.<input name="virtru-metadata" type="hidden" value="{"email-policy":{"state":"closed","expirationUnit":"days","disableCopyPaste":false,"disablePrint":false,"disableForwarding":false,"expires":false,"isManaged":false},"attachments":{},"compose-window":{"secure":false}}"><div><br></div><div>tl;dr the trick is to set up your package database so that GHC knows what to suggest for you</div><div class="gmail_extra" style="display:block"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">-- Dan Burton</div></div>
<br><div class="gmail_quote">On Wed, Jan 24, 2018 at 5:12 PM, Rick Owens <span dir="ltr"><<a href="mailto:rick@owensmurray.com" target="_blank">rick@owensmurray.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Dear Haskell Café,</div><div><br></div><div>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).</div><div><br></div><div>In the past, with lts-9.* and below, when I started cranking on some code and writing a bunch of imports:</div><div><br></div><div>> import Control.Monad.Trans.Class (MonadTrans)</div><div>> import Data.Map (Map)</div><div><br></div><div>I would try to build first without updating the cabal file build-depends, and I would get something like the following error messages:</div><div><br></div><div>> /path/to/Module.hs:48:1: error:</div><div>> Failed to load interface for ‘Data.Map’</div><div>> It is a member of the hidden package ‘containers-0.5.7.1’.</div><div>> Perhaps you need to add ‘containers’ to the build-depends in your .cabal file.</div><div>> Use -v to see a list of the files searched for.</div><div>></div><div>> /path/to/Module.hs:21:1: error:</div><div>> Failed to load interface for ‘Control.Monad.Trans.Class’</div><div>> It is a member of the hidden package ‘transformers-0.5.2.0’.</div><div>> Perhaps you need to add ‘transformers’ to the build-depends in your .cabal file.</div><div>> Use -v to see a list of the files searched for.</div><div><br></div><div><br></div><div>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.</div><div><br></div><div>With lts-10.*, however, the analogous error message looks like this:</div><div><br></div><div>> /path/to/Module.hs:9:1: error:</div><div>> Could not find module ‘Data.DoubleWord’</div><div>> Use -v to see a list of the files searched for.</div><div>> |</div><div>> 9 | import Data.DoubleWord (Word256(Word256), Word128(Word128))</div><div>> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<wbr>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div><div><br></div><div>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?</div><div><br></div><div>Thanks,</div><div><br></div><div>-Rick Owens</div><div><br></div><div><br></div></div></div><div><br></div></div>
<br>______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.<br></blockquote></div><br></div></div>