The short version is what Francesco said. The longer version is that with modern cabal (and stack), libraries are managed by cabal/stack and you don't normally install them directly. For the cases where you need a library to be available outside cabal's implicit sandboxing, there is `cabal install --lib`; but be aware that multiple versions of packages in the resulting environment may cause other build problems down the line, and it's on you to manage the environment file as needed. The proper way to work with libraries outside of a project is "cabal repl" or "stack ghci" as appropriate. For quick one-offs with cabal, you can use e.g. `cabal repl -b HsShellScript`. (I don't know the stack equivalent, sorry.)
This whole rigmarole is intended to avoid situations where multiple versions of libraries are in ghc's environment and it picks inconsistent versions, leading to the old "cabal hell".