How to list the global packages installed by `stack`?

Viewed 4348

I want to check if some package is installed globally by stack. How to do that?

1 Answers

Just to make visible, that there is already an answer from user2407038...

Command

The following command lists all packages, including the installed ones

stack exec ghc-pkg -- list

Output

Created the following output for ghc 8.8.4 (private output is kept private):

C:\Users\Joerg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.4\lib\package.conf.dCabal-3.0.1.0
    Win32-2.6.1.0
    array-0.5.4.0
    base-4.13.0.0
    binary-0.8.7.0
    bytestring-0.10.10.1
    containers-0.6.2.1
    deepseq-1.4.4.0
    directory-1.3.6.0
    filepath-1.4.2.1
    (ghc-8.8.4)
    ghc-boot-8.8.4
    ghc-boot-th-8.8.4
    ghc-compact-0.1.0.0
    ghc-heap-8.8.4
    ghc-prim-0.5.3
    ghci-8.8.4
    haskeline-0.7.5.0
    hpc-0.6.0.3
    integer-gmp-1.0.2.0
    libiserv-8.8.4
    mtl-2.2.2
    parsec-3.1.14.0
    pretty-1.1.3.6
    process-1.6.9.0
    rts-1.0
    stm-2.5.0.0
    template-haskell-2.15.0.0
    text-1.2.4.0
    time-1.9.3
    transformers-0.5.6.2
    xhtml-3000.2.2.1

C:\sr\snapshots\...
    ...
C:\...\...\.stack-work\install\...\pkgdb
    ...

Source

https://docs.haskellstack.org/en/stable/GUIDE/#different-databases

Related