I've been able to use the Data.Tuple.Extra
module after installing the extra
package by stack build extra
. But the same doesn't apply to the Data.List.Unique
module (https://hackage.haskell.org/package/Unique-0.4.7.8/docs/Data-List-Unique.html). According to the website, it's included in package Unique
. So, I installed it with
$ stack build Unique
The installation seems to have been successful because I didn't see any error messages. But
$ cat try.hs
import Data.List.Unique
main = do putStrLn "hello"
$ stack runghc try.hs
try.hs:1:1: error:
Could not find module ‘Data.List.Unique’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
1 | import Data.List.Unique
| ^^^^^^^^^^^^^^^^^^^^^^^
$
The output from stack runghc -v try.hs
is too big for me to analyze . . .
Note: I've modified the question to focus on the installation and use of modules. Following the answers provided below, I'm able to run the program using an option. Still, it would be nice if one wouldn't need to use a package option.
Unique
as a dependency of it only once, in the project configuration file, as opposed to every time you want to run it..stack/global-project/stack.yaml
. Then I'm stuck. Do you know which document should I look at? A simple "packages:\n - Unique" doesn't work --- stack tries to find a directory named "Unique".