[Haskell-beginners] import not working

Travis Cardwell travis.cardwell at extrema.is
Sun Jun 6 00:32:25 UTC 2021


The `stack ghci` command does not load extra packages such as those
installed "globally."  This is a good thing, IMHO.  You can instruct
the command to load specific packages using the `--package` option.

Example:

    stack repl --package safe

Example using your file:

    stack repl --package safe GalaxyBeing.hs

Note that your email indicates usage of the `Safe` package (uppercase),
but that package is deprecated in favor of the `safe` package
(lowercase).  I mention it in case it is not intentional.

* <https://hackage.haskell.org/package/safe>
* <https://hackage.haskell.org/package/Safe>

You may want to create a project that is just for testing.  You can then
specify which Stack snapshot to use in `stack.yaml` and which packages
to use in `package.yaml`.

    stack new experiment

Travis


More information about the Beginners mailing list