This problem is known already for some time but is there any final solution?
I tried to build a program with cabal to use Colourista - no success.
Next I tried that with some success using stack, It seems to have corrupted some other packages or their modules. The business using :set -package text for example is no real solution for issue, not loading module Data.Text as it works only interactively with ghci, needing set procedure again, everytime just before manual loading :l .
I used the following code to test running Colourista.
module Main
where
import Colourista
import qualified Data.Text as Text
main = successMessage $ Text.pack "Hi, this is Colourista in Haskell all set up! However, the module Data.Text cannot be loaded from the hidden package text!"
At first it fails in loading the modules. Next, it continues succesfully after manual set.
At last, even Colourista will show correctly the text in color.
% ghci HiddenPackage.hs
Loaded package environment from /Users/xyz/.ghc/aarch64-darwin-9.4.8/environments/default
GHCi, version 9.4.8: https://www.haskell.org/ghc/ :? for help
[1 of 2] Compiling Main ( HiddenPackage.hs, interpreted )
HiddenPackage.hs:6:1: error:
Could not load module âData.Textâ
It is a member of the hidden package âtext-2.0.2â.
You can run â:set -package textâ to expose it.
(Note: this unloads all the modules in the current scope.)
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
6 | import qualified Data.Text as Text
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, no modules loaded.
ghci> :set -package text
package flags have changed, resetting and loading new packages...
ghci> :l HiddenPackage.hs
[1 of 2] Compiling Main ( HiddenPackage.hs, interpreted )
Ok, one module loaded.
ghci> main
â Hi, this is Colourista in Haskell all set up! However, the module Data.Text cannot be loaded from the hidden package text!
ghci>
The error of hidden package is back as soon as quitted from ghci.
Then you canât even compile the programs with hidden packages because ghc will stop due to error.
This error is comparable to kind of coputer virus violating system function seriously.
Shall I clean/purge, reload and install Haskell completely to get rid of the hidden (corrupted?) packages or is there a quick solution.