[Haskell-cafe] ANN: cabal-ghci 0.1

Etienne Laurin etienne at atnnn.com
Fri Sep 9 08:06:17 CEST 2011


Hello fellow hackers.

Here is a helpful package I wrote to ease the development of projects
using cabal.

It includes a :cabalset ghci command to set ghci options for your
project, and a cabal-ghci executable to launch ghci with those
options.

Do you get errors when loading your project into ghci?

Prelude> a ← return 1
<interactive>:1:3: Not in scope: `←'

Prelude> :load Main
    Could not find module `Main':
      it is not a module in the current program, or in any known package.

cabalset fixes these problems for you.

Prelude> :cabalset
:set "-i/home/atnnn/up1/src/dist/build/autogen"
:set "-i/home/atnnn/up1/src/web"
:set "-XUnicodeSyntax"
:set "-Wall"

Prelude> a ← return 1
<interactive>:1:12:
    Warning: Defaulting the following constraint(s) to type `Integer'
               (Num t0) arising from the literal `1'

Prelude> :load Main
Ok, modules loaded: Main, Application, Handlers.

This works from any sub-directory of your project and accepts the
following arguments:
-fflag    enable flag
-f-flag   disable flag
exec      load options for the exec executable

To install:
$ cabal update
$ cabal install cabal-ghci
$ cat >> ~/.ghci
:m + Distribution.Dev.Interactive
:def cabalset cabalSet
:cabalset
:m - Distribution.Dev.Interactive
^D

Etienne Laurin



More information about the Haskell-Cafe mailing list