I'm new to Haskell stack and wondering how to find out the name of the package that contains a particular module.
Currently, I want to use Data.Tuple.Extra(fst3) ( https://hackage.haskell.org/package/extra-1.7.9/docs/Data-Tuple-Extra.html ) and want to know what I should write below
$ stack install ????
I've already installed the tuple package, which, however, doesn't seem to include the Extra part.
All the Internet resources about the installation of a package I've found so far say something along the lines of "To use Blahblah.Anything.Something, you need to install the foofoo package" . . . How can one know? I searched Stackage but it shows only the documentation of Data.Tuple.Extra and I still fail to find the name of the package.
Edit: As K.A.Buhr notes in her/his answer, stack install is the wrong command for the above case. Use stack build instead.
When browsing package documentation in Hackage, the top-left portion of the page header will always give the package, version number, and description. On the page you link, it's here:
You can also use the "Contents" link in the top-right to go to the main page for the
extrapackage, which gives its full list of modules, licensing, links to the package home page and bug tracker, and so on.As a side note,
stack install extrais technically the wrong command to "install" this package. If you want to make theextrapackage available for use within the Stack global project, the correct command isstack build extra. If you want to useextrawithin a stack project, then you want to addextrato the dependencies in your package'sxxx.cabalorpackage.yamlfile instead and runstack build(no arguments) to build and install it for use in your project.In contrast, the
stack installcommand is equivalent tostack build --copy-binswhich copies any executables in the package to~/.local/binso they'll be in your path. See the Stack docs. It's intended to be used for installing programs written in Haskell that are distributed via Stack, so you can dostack install hlintto install thehlintlinter, for example.In this case, because the
extrapackage has no executables,stack install extraandstack build extrawill do the same thing, but it's better to get into the habit of usingstack buildwhen you aren't intending to install any package binaries, to avoid surprises.