[Haskell-cafe] Global Package Install

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

On Thu, Feb 18, 2021 at 03:35:10PM -0500, Viktor Dukhovni wrote:
> On Thu, Feb 18, 2021 at 12:22:52AM -0800, A. Mc. wrote:
> You can use "cabal repl -z" to run ghci with the Cabal "user" package
> database in scope:

I'm confused by this.  What is 'the Cabal "user" package database'?
The --help text says

 -z --ignore-project    Only include explicitlyspecified packages (and 'base').

I can't see any evidence locally that it brings any packages into
scope. Could you please clarify exactly what -z is doing in your
example below?



>     $ ghci
>     GHCi, version 9.0.1: https://www.haskell.org/ghc/  :? for help
>     λ> :set -package iproute
>     cannot satisfy -package iproute
>         (use -v for more information)
>     λ>
>     Leaving GHCi.
>     $ cabal repl -z
>     Resolving dependencies...
>     Build profile: -w ghc-9.0.1 -O1
>     In order, the following will be built (use -v for more details):
>      - fake-package-0 (lib) (first run)
>     Configuring library for fake-package-0..
>     Preprocessing library for fake-package-0..
>     Warning: No exposed modules
>     GHCi, version 9.0.1: https://www.haskell.org/ghc/  :? for help
>     Loaded GHCi configuration from /tmp/cabal-repl.-87318/setcwd.ghci
>     λ> :set -XOverloadedStrings
>     λ> :set -package iproute
>     package flags have changed, resetting and loading new packages...
>     λ> import Data.IP
>     λ> import Numeric
>     λ> showHex (fromIPv4w "") ""
>     "7f000001"

More information about the Haskell-Cafe mailing list