[Haskell-cafe] Global Package Install

Tom Ellis tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk
Sun Mar 21 08:40:39 UTC 2021


On Thu, Feb 18, 2021 at 09:15:53PM +0000, Richard Eisenberg wrote:
> > On Feb 18, 2021, at 3:48 PM, Viktor Dukhovni <ietf-dane at dukhovni.org> wrote:
> > 
> >    $ cabal repl -v0 -z --repl-options -package=iproute --repl-options -XOverloadedStrings
> 
> Yes, but it's so, so much easier just to say `ghci`. And then I can
> pass lots of options to `ghci` directly when I want to. And I don't
> have to spend time writing and maintaining wrapper scripts.

I was reminded of this thread because I just saw yet another post
(this time on Haskell Discourse) from a user confused about how the
v1-style global package database is supposed to work these days.

In this thread we had a few people mention that they prefer the
"global package database" style.  I'd like to improve my understanding
of why people prefer that style.  I believe it was only Richard who
explained his rationale (above).

For me personally, "global package database" style was useful because
I could "cabal install" a package and then "ghc" or "ghci" would have
it immediately available.  However, I have since given up trying to
get that style to work and now I use the "--build-depends" or "create
a temporary cabal package" approach[0].

So what are the benefits of the "global package database" workflow
style?  Is it just that

  cabal -z repl --package QuickCheck --repl-options="whatever"

is more of a pain to type than

  ghci "whatever"

and that creating a .cabal file and running "cabal build" is more of a
pain than typing "ghc", or is there something fundamental that the
"global package database" supports that cabal v2-style does not?

Tom




[0] http://h2.jaguarpaw.co.uk/posts/how-i-use-cabal/


More information about the Haskell-Cafe mailing list