<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 29, 2024 at 1:15 PM Volker Wysk <<a href="mailto:post@volker-wysk.de">post@volker-wysk.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> The proper way to work with libraries outside of a project is "cabal repl"<br>
> or "stack ghci" as appropriate. For quick one-offs with cabal, you can use<br>
> e.g. `cabal repl -b HsShellScript`. (I don't know the stack equivalent,<br>
> sorry.)<br>
<br>
What do you mean by "libraries outside of a project"? The library is one<br>
project by itself. I don't (?) have any libraries outside of projects (that<br>
I know of).<br></blockquote><div><br></div><div>Cabal and stack are designed around the notion of projects, defined by a cabal file (or `package.yaml` if you use Hpack), `stack.yaml` for stack, optional `cabal.project` for cabal. Projects are sandboxed such that the package(s) in the project use consistent versions of all dependencies.</div><div><br></div><div>Neither tool handles use outside of a project well, although stack has a global configuration (whose use for this is deprecated iirc) and cabal uses ghc's environment files when requested. So something that isn't really intended for use as part of a project isn't well handled by either one.</div><div> </div><div>The biggest problem with both stack's global configuration and cabal's use of environment files is the need for manual management when new versions of packages are released: neither tool currently gives you any way to manage either, and having multiple versions of a package in either invites trouble. I can't speak for stack, but cabal devs are aware of the problem and considering how best to deal with it (see for example <a href="https://github.com/haskell/cabal/issues/9581">https://github.com/haskell/cabal/issues/9581</a>).</div></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div></div>