2013-05-22 03:04:05 +00:00
|
|
|
# Happy Haskell Programming
|
2015-12-16 20:49:53 +00:00
|
|
|
[![Build Status](https://travis-ci.org/kazu-yamamoto/ghc-mod.svg?branch=master)](https://travis-ci.org/kazu-yamamoto/ghc-mod)
|
2013-05-22 03:04:05 +00:00
|
|
|
|
2014-02-01 04:02:09 +00:00
|
|
|
Please read: [http://www.mew.org/~kazu/proj/ghc-mod/](http://www.mew.org/~kazu/proj/ghc-mod/)
|
2013-05-22 03:04:05 +00:00
|
|
|
|
2014-05-19 07:42:34 +00:00
|
|
|
## Using the stable version
|
|
|
|
|
2014-09-12 05:02:34 +00:00
|
|
|
The Emacs front-end is available from
|
2015-11-01 13:57:14 +00:00
|
|
|
[*stable* MELPA](https://stable.melpa.org/). This package should
|
2014-09-12 05:02:34 +00:00
|
|
|
always be compatible with the latest version of ghc-mod from hackage.
|
|
|
|
|
|
|
|
To use stable *stable* MELPA add this to your `.emacs`:
|
2014-05-19 07:25:38 +00:00
|
|
|
|
|
|
|
```elisp
|
|
|
|
(require 'package)
|
2014-09-12 05:02:34 +00:00
|
|
|
(add-to-list 'package-archives
|
2015-11-01 13:57:14 +00:00
|
|
|
'("melpa" . "https://stable.melpa.org/packages/"))
|
2014-05-19 07:25:38 +00:00
|
|
|
(package-initialize)
|
|
|
|
```
|
|
|
|
|
2014-09-12 05:02:34 +00:00
|
|
|
With this configuration you can install the Emacs front end from MELPA (the
|
|
|
|
package is called `ghc` there, not `ghc-mod`) and install the
|
|
|
|
`ghc-mod`/`ghc-modi` binaries from hackage by doing:
|
2014-05-19 07:25:38 +00:00
|
|
|
|
|
|
|
```shell
|
2014-09-12 05:02:34 +00:00
|
|
|
% cabal update && cabal install ghc-mod
|
2014-05-19 07:25:38 +00:00
|
|
|
```
|
2014-05-19 07:35:38 +00:00
|
|
|
|
2014-12-16 20:34:04 +00:00
|
|
|
### Nix & NixOS
|
|
|
|
|
2015-08-28 12:16:14 +00:00
|
|
|
`ghc-mod` works fine for users of Nix who follow a recent version of the
|
|
|
|
package database such as the `nixos-15.09` or `nixos-unstable` channel. Just
|
|
|
|
include the package `ghc-mod` into your `ghcWithPackages` environment like any
|
|
|
|
other library. The [Nixpkgs Haskell User's
|
|
|
|
Guide](http://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download-by-type/doc/manual#users-guide-to-the-haskell-infrastructure)
|
2015-09-24 01:20:53 +00:00
|
|
|
covers this subject in great detail.
|
2014-12-16 20:34:04 +00:00
|
|
|
|
2014-09-12 05:02:34 +00:00
|
|
|
## Using the development version
|
|
|
|
|
|
|
|
The easiest way to hack on ghc-mod is compile it, then add `dist/build/ghc-mod`
|
|
|
|
and `dist/build/ghc-modi` to your `PATH` and add the `elisp/` directory to your
|
|
|
|
Emacs `load-path`.
|
|
|
|
|
|
|
|
Make sure you're not using the MELPA version of `ghc.el` otherwise you might get
|
|
|
|
all sorts of nasty conflicts.
|
|
|
|
|
|
|
|
|
2015-03-03 11:18:54 +00:00
|
|
|
## Custom ghc-mod cradle
|
|
|
|
|
2015-09-07 01:49:12 +00:00
|
|
|
To customize the package databases used by `ghc-mod`, put a file called `ghc-mod.package-db-stack` beside the `.cabal` file with the following syntax:
|
2015-03-03 11:18:54 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
temp directory root
|
|
|
|
package db 1
|
|
|
|
...
|
|
|
|
package db n
|
|
|
|
```
|
|
|
|
|
|
|
|
each package database line is either a *path* to a package database, or `global` or `user`.
|
|
|
|
|
2014-09-12 05:02:34 +00:00
|
|
|
## IRC
|
2014-05-19 07:35:38 +00:00
|
|
|
|
2014-09-12 05:02:34 +00:00
|
|
|
If you have any problems, suggestions, comments swing by
|
2015-03-28 01:35:36 +00:00
|
|
|
[\#ghc-mod (web client)](https://kiwiirc.com/client/irc.freenode.org/ghc-mod) on
|
|
|
|
Freenode. If you're reporting a bug please also create an issue
|
2015-05-24 19:58:24 +00:00
|
|
|
[here](https://github.com/kazu-yamamoto/ghc-mod/issues) so we have a way to contact
|
2015-03-28 01:35:36 +00:00
|
|
|
you if you don't have time to stay.
|
2015-03-05 15:52:11 +00:00
|
|
|
|
|
|
|
Do hang around for a while if no one answers and repeat your question if you
|
2015-03-28 01:35:36 +00:00
|
|
|
still haven't gotten any answer after a day or so. You're most likely to get an
|
|
|
|
answer during the day in GMT+1.
|