Skip to content

haskell/haskell-mode

Folders and files

NameName
Last commit message
Last commit date
Mar 11, 2025
Nov 15, 2023
Apr 1, 2016
Aug 6, 2023
Aug 6, 2023
Jun 16, 2017
Sep 15, 2020
Jun 28, 2018
Jun 10, 2015
Nov 15, 2023
Nov 15, 2023
Nov 10, 2023
Mar 12, 2022
Sep 19, 2023
Jan 3, 2016
Mar 4, 2025
Mar 5, 2025
Nov 4, 2022
Apr 1, 2025
May 29, 2022
Jan 3, 2016
Nov 6, 2022
Apr 1, 2025
Jul 13, 2023
Feb 9, 2025
Feb 28, 2023
Mar 28, 2022
Jan 16, 2025
Mar 4, 2023
Nov 6, 2022
Apr 1, 2025
Nov 6, 2022
Mar 3, 2023
Sep 11, 2024
Dec 29, 2019
Apr 28, 2024
Jul 19, 2016
May 29, 2022
Sep 13, 2017
Jan 13, 2017
Nov 4, 2022
Feb 2, 2025
Jan 10, 2016
Dec 19, 2019
Mar 15, 2020
Nov 20, 2019
Apr 8, 2018
Apr 8, 2020
Nov 6, 2022
Apr 1, 2025
Apr 9, 2016
Feb 24, 2025
Aug 8, 2012
Apr 1, 2025

Repository files navigation

Haskell Mode for Emacs

This is an Emacs mode for editing, developing and debugging Haskell programs. Home page.

Build Status Melpa Status Melpa Stable Status Non-GNU ELPA Status License GPL3

I just want to thank everybody involved in one way or another with the Haskell Emacs tooling. It is one of the best language experiences I had in Emacs. -- cocreature, 2015-03-01

I've been using it for a long time and love it. Great work on haskell-mode! Keep up the good work! -- LukeHoersten, 2015-04-02

This sounds wonderful. Does anything similar exist for Vim? -- earldouglas, 2015-07-02

Users manual: latest version, older versions: 13.12, 13.14, 13.16, 13.18, 13.20.

Quick Installation

Make sure you have this in your init file (usually ~/.emacs). If you already have custom-set-variables, merge its contents:

(require 'package)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-archives
   (quote
    (("gnu" . "https://elpa.gnu.org/packages/")
     ("melpa" . "https://melpa.org/packages/")))))
(package-initialize)

Then run emacs, and evaluate:

M-x package-refresh-contents

and then follow by

M-x package-install RET haskell-mode

Voilà! haskell-mode is installed! You should be able to edit Haskell source code in color now.

Haskell-mode has much much more to offer but the above should get you going!

Advanced configuration

For setup instructions, please consult the 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 the online haskell-mode manual for setup and user guide.

Installation - more information

haskell-mode supports GNU Emacs version 25.1 or later.

haskell-mode is available from MELPA Stable (releases) and MELPA (git snapshots). The latter will generally be considerably more up-to-date, and is recommended for most users.

Other means of obtaining haskell-mode include el-get, Emacs Prelude and Debian package.

Installation from git repository

Running haskell-mode directly from sources is easy but requires a little preparation:

  • 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 to generate various files, the autoloads file (haskell-mode-autoloads.el) is one among them. Invoke:

make EMACS=/path/to/your/emacs

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/")

Installation from git repository on macOS

There are a couple of things to note if you want to install directly from git on macOS systems, as of version 10.13 High Sierra:

  • The version of makeinfo that is installed by default in /usr/bin is quite old and will cause the above make command to exit with an error. Installing the texinfo package using Homebrew will fix this. Be sure to follow the post-install instructions to add its bin directory to your shell's PATH variable.

  • If you are running an Emacs distribution packaged as a macOS application. such as the one available at https://emacsformacosx.com/, you'll need to add its executable to your PATH before the system's default Emacs version. That project's Tips and Tricks page has detailed instructions.

Contributing

If you followed the above you are just a couple of steps away from contributing to haskell-mode.

haskell-mode is actively seeking contributions from users of haskell-mode. For more information have a look at the wiki page on contributing.