2
votes

When I try to execute :load hello.hs in ghci, I get the following error:

Could not find module "System.Console.Readline"

Since this is a System module, I thought this would work. How do I fix this?

3
If you're just using readline because it's the first you've heard of then look at / consider using haskeline too. - Thomas M. DuBuisson

3 Answers

3
votes

You need to install the readline-package with

cabal install readline
3
votes

When you want to use brew for deadline on Mac OS X.

  1. Install readline: brew install readline
  2. cabal install readline --extra-include-dirs=/usr/local/Cellar/readline/6.3.8/include/ --extra-lib-dirs=/usr/local/Cellar/readline/6.3.8/lib/ --configure-option=--with-readline-includes=/usr/local/Cellar/readline/6.3.8/inc‌​lude/ --configure-option=--with-readline-libraries=/usr/local/Cellar/readline/6.3.8/lib/

Reference: How do you install the haskell readline library on Mac OSX?

2
votes

Depending on your system, you will want to install the readline Haskell package.

To do so, make sure that you have GNU readline actually installed via apt-get (Ubuntu), macports (Mac OSX), Cygwin (Windows?), or whatever your favourite package manager is on your platform.

If you have Haskell's cabal installed, simply run cabal install readline and hopefully everything will compile, and you can try and run your hello.hs again!

If you don't have cabal, it's a sort of command line interface for grabbing and managing packages from HackageDB. Follow the instructions on haskell.org/cabal to get cabal. It's pretty handy to have, if not essential :D