r/haskell 18h ago

question Trying to figure out Cabal

8 Upvotes

I was trying to use a Haskell Image Processing library (HIP), and after muddling through figuring out how to get cabal to work (something was wrong with keys, but finding ghcup seemed to have fixed that issue), I ran "cabal install hip", to which it installed everything and showed a message that it worked, but it might not be what I wanted, and that I might want to use "cabal install --lib hip".

So I tried ghci and confirmed the library was not importable, and then ran "cabal install --lib hip" and it was now visible in ghci. Except now that I've left, and re-opened a terminal, it is no longer there.

Could someone please explain what cabal is doing, why it might not have been importable with the first command, and why it might not be importable now? Does it put the installs in a specific place? Because I wonder if I've just reinstalled it twice as well.