I'm new to Haskell, and have found the :type
command in the ghci
REPL to be really useful for interactively figuring out how things work. So far I've only used things from the base package, but now I'd like to use something from distributive
with the :type
command in the REPL.
How in the world do I do this? If it matters, I'm on macOS and have done brew install ghc cabal-install
. But nothing I've tried will either install or import the distributive
package, and the error messages are not very good. I've found lots of related questions and documentation, but nothing shows a worked example, and I'm unable to infer what commands to use.
CodePudding user response:
I eventually figured this out. The missing pieces were needing to first update cabal
(even though I had just installed it), and to use --lib
as an argument when installing:
brew install ghc cabal-install
cabal update
cabal install --lib distributive
ghci
import Data.Distributive