Using stack version 1.9.3 and GHCI version 8.6.3, I follow these steps:
create a new project with
stack new "myproject"
cd
into myprojectrun
stack install regex
which returns the following
base-compat-0.10.5: using precompiled package hashable-1.2.7.0: using precompiled package time-locale-compat-0.1.1.5: using precompiled package utf8-string-1.0.1.1: using precompiled package regex-base-0.93.2: using precompiled package unordered-containers-0.2.9.0: using precompiled package regex-pcre-builtin-0.94.4.8.8.35: using precompiled package regex-tdfa-1.2.3.2: using precompiled package regex-tdfa-text-1.0.0.3: using precompiled package regex-1.0.2.0: using precompiled package Completed 10 action(s).
At this point I assume the regex package is correctly installed.
But then in my code when I try to import the regex package with import Text.RE
I get the following error
Could not load module ‘Text.RE’ It is a member of the hidden package ‘regex-1.0.2.0’. You can run ‘:set -package regex’ to expose it. (Note: this unloads all the modules in the current scope.) Use -v to see a list of the files searched for.
What am I missing out on ?