2

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?

stites
  • 4,903
  • 5
  • 32
  • 43
Jo0o0
  • 531
  • 2
  • 18
  • 31

3 Answers3

4

You need to install the readline-package with

cabal install readline
shang
  • 24,642
  • 3
  • 58
  • 86
3

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?

Community
  • 1
  • 1
prosseek
  • 182,215
  • 215
  • 566
  • 871
2

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

stites
  • 4,903
  • 5
  • 32
  • 43
fatuhoku
  • 4,815
  • 3
  • 30
  • 70