While trying to debug a different question, I installed a package that seems to conflict with some of my other installed packages.
I ran
$ stack install regex-pcre-text
regex-pcre-builtin-0.94.4.8.8.35: configure
regex-tdfa-1.2.3.1: download
regex-pcre-builtin-0.94.4.8.8.35: build
regex-tdfa-1.2.3.1: configure
regex-tdfa-1.2.3.1: build
regex-pcre-builtin-0.94.4.8.8.35: copy/register
regex-tdfa-1.2.3.1: copy/register
regex-tdfa-text-1.0.0.3: download
regex-tdfa-text-1.0.0.3: configure
regex-tdfa-text-1.0.0.3: build
regex-tdfa-text-1.0.0.3: copy/register
regex-pcre-text-0.94.0.1: download
regex-pcre-text-0.94.0.1: configure
regex-pcre-text-0.94.0.1: build
regex-pcre-text-0.94.0.1: copy/register
Completed 4 action(s).
I can no longer simply import
Text.Regex.PCRE
When I try, I now see:
$ stack ghci
Prelude> :set -XOverloadedStrings
Prelude> import Text.Regex.PCRE
Yields
<no location info>: error:
Ambiguous module name ‘Text.Regex.PCRE’:
it was found in multiple packages:
regex-pcre-0.94.4 regex-pcre-builtin-0.94.4.8.8.35
I would like to revert my installation to the earlier state such that code on my machine that imports Text.Regex.PCRE
without qualification continues to work as it used to.
However, it looks like stack does not have a clear uninstall:
$ stack uninstall regex-pcre-text
Error: stack does not manage installations in global locations. The only global mutation stack performs is executable copying. For the default executable destination, please run stack path --local-bin
I hesitate to simply run this stack path --local-bin
because I don't know what it's going to do, or whether it can be reversed (which was my error in installing the above package in the first place). What is the right fix for my import problem?
Update 1
I tried suggestions here:
$ ghc-pkg unregister regex-pcre-text
ghc-pkg: cannot find package regex-pcre-text
$ stack exec ghc-pkg unregister regex-pcre-text
ignoring (possibly broken) abi-depends field for packages