Haskell

Haskell is Article description::a purely-functional programming language.

Available ebuild repositories

 * Gentoo-Haskell ebuild repository. The most important part is that this repository requires a specific unmasking procedure to prevent blockers.

Compiler and interpreter

 * The probably most important and up-to-date Haskell-implementation is the Glasgow Haskell Compiler (GHC). You can install it with:
 * The package also includes an interpreter called GHCI (except on the ARM-architecture).
 * 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:

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

Updating Haskell packages
Sometimes:

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:

Unless  is approved sometimes we have sub-slot blockers (when updating ghc or some specific package there are a list of blockers) this issue could be solved via running:

Hoogle with local installation
The Hoogle ebuild is currently only available in the official gentoo-haskell ebuild repository. So add that first.

In order to get the an offline installation of all hoogle data, you need to enable the,  , and   USE flag values.

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

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

(It's normal for  to output a bunch of junk. Redirect  to  if you add it to your e.g. .)

At this point, you should be able to use Hoogle from the command-line. For example, the following will search for the  function:

Integration with GHCi
If you'd like to use Hoogle within GHCi, you can do it with a little modification to your local file. Add the following:

Now, within GHCi, you should have access to two new commands,  and. The first will perform a normal Hoogle search and print the output:

The second will display the Haddock documentation for the method:

HLint
HLint checks and simplifies the Haskell source code! Install it with:

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

For GNU Emacs:

for XEmacs.

Then, you can configure it with.

ghc-mod
The official Gentoo Haskell ebuild repository provides an ebuild for ghc-mod, an extension of Haskell mode. Add the repository with:

Then, install the ebuild:

Haskell-Mode for Vim
There's also a Haskell-Mode for Vim.

Haskell ebuilds failing with out of memory error
When MAKEOPTS is set to allow parallel jobs, ghc may fail in Haskell ebuilds with. To fix this, lower the amount of jobs set in MAKEOPTS, or do not allow parallel jobs at all. MAKEOPTS can be overridden for failing ebuilds as described in Overriding environment variables per package.

External resources

 * The and  channels on code.freenode.net.