Skip to content
This repository

Emacs mode for Haskell

Add sexp-based collapsing support in REPL

@hvr This is a little bit more lightweight, but probably more reliable
than my old approach. This is just simply looks for "nodeish" things
like { [ ( and then collapses them to their end by sexp-forward.

I was playing around with haskell-names which produces rather large
ADT values, so this makes inspecting it handy.
latest commit 35527f964b
Chris Done chrisdone authored
Octocat-spinner-32 examples Comment out `haskell-process-type` setting June 22, 2013
Octocat-spinner-32 snippets Another attempt at removing EOF newline. February 17, 2014
Octocat-spinner-32 tests Add some unit-tests for `haskell-str-literal-{encode,decode}` July 08, 2013
Octocat-spinner-32 .gitignore Add support for embedding git version in texinfo manual July 04, 2013
Octocat-spinner-32 .travis.yml Rename `test` Makefile target to `check` June 09, 2013
Octocat-spinner-32 Makefile Add sexp-based collapsing support in REPL April 13, 2014
Octocat-spinner-32 NEWS Update NEWS with 13.10 changes December 11, 2013
Octocat-spinner-32 README.md Major overhaul of `README.md` removing config instructions July 27, 2013
Octocat-spinner-32 ghc-core.el Add .dump-simpl files to ghc-core auto-mode-alist March 16, 2014
Octocat-spinner-32 haskell-align-imports.el Make haskell-align-imports-padding a total function April 02, 2014
Octocat-spinner-32 haskell-bot.el Add haskell-bot.el, for interacting with locally installed lambdabot December 11, 2013
Octocat-spinner-32 haskell-c.el Remove trailing whitespaces July 14, 2013
Octocat-spinner-32 haskell-cabal.el Allow whitespace before settings. January 20, 2014
Octocat-spinner-32 haskell-checkers.el Unify Elisp boilerplate headers July 14, 2013
Octocat-spinner-32 haskell-collapse.el Add sexp-based collapsing support in REPL April 13, 2014
Octocat-spinner-32 haskell-compat.el Fix indentation in all .el files December 11, 2013
Octocat-spinner-32 haskell-compile.el Use && instead of ; because this works on Windows, too (refs #232) January 31, 2014
Octocat-spinner-32 haskell-debug.el Fix haskell-debug for recent prompt handling changes. April 07, 2014
Octocat-spinner-32 haskell-decl-scan.el Fix indentation in all .el files December 11, 2013
Octocat-spinner-32 haskell-doc.el Fix indentation in all .el files December 11, 2013
Octocat-spinner-32 haskell-font-lock.el Fix indentation in all .el files December 11, 2013
Octocat-spinner-32 haskell-indent.el Fix indentation in all .el files December 11, 2013
Octocat-spinner-32 haskell-indentation.el Declare 'delete-active-region' in haskell-indentation February 25, 2014
Octocat-spinner-32 haskell-interactive-mode.el Add sexp-based collapsing support in REPL April 13, 2014
Octocat-spinner-32 haskell-menu.el Switch to session's buffer on RET in `haskell-menu` July 24, 2013
Octocat-spinner-32 haskell-mode-pkg.el.in Add new `make package` target for creating ELPA packages June 01, 2013
Octocat-spinner-32 haskell-mode.el Only save again after stylish if necessary. April 06, 2014
Octocat-spinner-32 haskell-mode.texi Add new Haskell compilation sub-mode September 01, 2013
Octocat-spinner-32 haskell-move-nested.el Fix indentation in all .el files December 11, 2013
Octocat-spinner-32 haskell-navigate-imports.el Make navigate-imports a bit more useful in absense of import list January 20, 2014
Octocat-spinner-32 haskell-package.el Remove trailing whitespaces July 14, 2013
Octocat-spinner-32 haskell-presentation-mode.el Fix undefined reference to shm-display-quarantine in haskell-present January 15, 2014
Octocat-spinner-32 haskell-process.el Strip newlines from haskell-process-do-type April 08, 2014
Octocat-spinner-32 haskell-session.el Replace completing-read-function with custom for haskell-mode February 25, 2014
Octocat-spinner-32 haskell-show.el Fix indentation in all .el files December 11, 2013
Octocat-spinner-32 haskell-simple-indent.el Stick with indent-spaces name instead of tab-width December 11, 2013
Octocat-spinner-32 haskell-sort-imports.el Unify Elisp boilerplate headers July 14, 2013
Octocat-spinner-32 haskell-str.el Fix indentation in all .el files December 11, 2013
Octocat-spinner-32 haskell-string.el Move string function to the, er, other, string module. July 07, 2013
Octocat-spinner-32 haskell-unicode-input-method.el Fix indentation in all .el files December 11, 2013
Octocat-spinner-32 haskell-utils.el Enhance `haskell-process-do-info` to support import statements July 20, 2013
Octocat-spinner-32 haskell-yas.el Unify Elisp boilerplate headers July 14, 2013
Octocat-spinner-32 inf-haskell.el Fix internal GHC module translation November 12, 2013
Octocat-spinner-32 logo.svg Use notifications.el rather than notify.el (as it ships with Emacs) August 08, 2012
Octocat-spinner-32 w3m-haddock.el More liberal source match March 09, 2014
README.md

Haskell Mode for Emacs

Build Status

This is the Haskell mode package for Emacs. Its use should be mostly self-explanatory if you're accustomed to Emacs.

When Emacs is started up, it normally loads the Emacs initialization file usually called ~/.emacs, ~/.emacs.el, or ~/.emacs.d/init.el; with ~ standing for for your home directory. This file should contain all of your personal customisations written as a series of Emacs Lisp commands. In the following sections, this file will simply be referred to as the .emacs file.

Installation

GNU Emacs version 23 or later is officially supported. It may work with other Emacsen, but we don't have the resources to support other versions.

There are many ways to install haskell-mode. The following sections describe the most common ones; pick the one that you're most comfortable with.

package.el-based Installation

This is the recommended way

package.el is the new built-in package manager included in Emacs 24.x. On Emacs 23.x you will need to download package.el yourself and place package.el somewhere in your load-path.

Marmalade

Stable releases of haskell-mode are available on Marmalade.

If you're not already using Marmalade, add the following snippet to your .emacs and evaluate it with M-x eval-buffer:

(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)

Refresh the package index by M-x package-refresh-contents and install haskell-mode via M-x package-install [RET] haskell-mode.

Alternatively, you can also download the .tar file via the Download link at http://marmalade-repo.org/packages/haskell-mode and install the package .tar-file via M-x package-install-file

MELPA

Unstable snapshots can be installed via the MELPA community maintained repository.

For MELPA the code you need to add is:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)

Refresh the package index by M-x package-refresh-contents and install haskell-mode via M-x package-install [RET] haskell-mode.

el-get based Installation

el-get is another popular package manager for Emacs. If you're an el-get user just do M-x el-get-install to get haskell-mode installed.

Emacs Prelude

haskell-mode is bundled with Emacs Prelude. If you're a Prelude user you can start using it right away.

Debian

If you are using Debian, you can install an older version (e.g. Wheezy ships with version 2.8.0) of haskell-mode with a command like:

$ apt-get install haskell-mode

Installation from Git

This installation method requires more work and recommended for haskell-mode developers/contributors only as it allows to load haskell-mode directly from the checked out Git working copy. If you just want to use bleeding edge versions of haskell-mode please use the MELPA installation method described above.

  • git clone https://github.com/haskell/haskell-mode.git into a suitable directory, e.g. ~/lib/emacs/haskell-mode/ where ~ stands for your home directory.

  • Assuming you have unpacked the various haskell-mode modules (haskell-mode.el and the rest) in the directory ~/lib/emacs/haskell-mode/, you need generate the autoloads file (haskell-mode-autoloads.el) by either

    • Invoking make haskell-mode-autoloads.el, or make all (use this to perform byte-compilation and Info manual generation)

    • From inside Emacs, M-x update-directory-autoloads and answering the question for the folder with ~/lib/emacs/haskell-mode/ and the question for the output-file with ~/lib/emacs/haskell-mode/haskell-mode-autoloads.el

    and then adding the following command to your .emacs:

    (add-to-list 'load-path "~/lib/emacs/haskell-mode/")
    (require 'haskell-mode-autoloads)
    (add-to-list 'Info-default-directory-list "~/lib/emacs/haskell-mode/")
    
  • After updating your haskell-mode working directory, you need to re-run make all or M-x update-directory-autoloads.

Basic Configuration

For setup instructions, please consult the new integrated haskell-mode Info manual which can be accessed after installation via M-x info-display-manual [RET] haskell-mode. Alternatively, you can also direct your browser to the latest online HTML version.

Support

Contributing

For submitting pull requests, please see the wiki page on contributing. You don't have to follow this guide, but please make sure your pull requests are at least properly rebased and up to date.

Something went wrong with that request. Please try again.