Haskell

From Gentoo Wiki
Jump to: navigation, search

Haskell is a purely-functional programming language.

Contents

Gentoo and Haskell

Compiler and interpreter

  • The probably most important and up-to-date Haskell-implementation is the Glasgow Haskell Compiler (GHC). You can install it with:
root # emerge --ask dev-lang/ghc
The package also includes an interpreter called GHCI (except on the ARM-architecture).
  • Furthermore, there's Hugs, an (meanwhile (almost) out-dated) interpreter for Haskell98. You can install it with:
root # emerge --ask dev-lang/hugs98

Cabal

With cabal you can package and build libraries and programs. Install it with:

root # emerge --ask dev-haskell/cabal-install

Updating Haskell packages

Sometimes:

root # emerge -auvDN --keep-going world

has trouble figuring out how to update Haskell packages. Providing emerge with the full list of dev-haskell packages that have upgrades available can sometimes help:

root # eix-update
root # emerge -av --oneshot --keep-going `eix --only-names --upgrade -C dev-haskell`
root # haskell-updater

Hoogle with local installation

The Hoogle ebuild is currently only available in the offical gentoo-haskell overlay. So add that first.

root # layman -a gentoo-haskell

In order to get the an offline installation of all hoogle data, you need to enable the "doc","hscolour" and "hoogle" use flag.

root # echo "dev-haskell/* doc hoogle hscolour" >> /etc/portage/package.use

Enable the relevant use flags for hoogle to store all data local, and emerge hoogle

root # echo "dev-haskell/hoogle fetchdb fetchdb-ghc localdb" >> /etc/portage/package.use
root # emerge --ask dev-haskell/hoogle

After emerging haskell packages, the hoogle database of the locally installed packages is updated by running:

root # hoogle-build-localdb

HLint

HLint checks and simplifies your haskell source code! Install it with:

root # layman -a gentoo-haskell
root # emerge --ask dev-haskell/hlint

Editor plugins

Emacs

Haskell Mode

The Haskell-Mode for (X)Emacs makes programming easier; install it with

root # emerge --ask app-emacs/haskell-mode

for GNU Emacs, or with

root # emerge --ask app-xemacs/haskell-mode

for XEmacs.

Then, you can configure it with M-x customize-group RET haskell RET.

ghc-mod

The official gentoo haskell overlay provides an ebuild for ghc-mod, an extension of Haskell mode. Add the overlay with

root # layman -a gentoo-haskell

Then, install the ebuild

root # emerge --ask app-emacs/ghc-mod

Haskell-Mode for Vim

There's also a Haskell-Mode for Vim.

IRC

For further information and individual help, visit #haskell or #gentoo-haskell on irc.freenode.net.

Personal tools
Namespaces

Variants
Actions
Gentoo Websites logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Navigation
Toolbox
Categories