Search code examples
jupyterjupyter-irkernelihaskell

Haskell under Jupyter


The Internet is strangely absent of instructions on how to get Haskell running under the Jupyter environment. Any documentation that leads you toward this requires you to compile from source, however when attempting to do so, all sorts of build errors occur.

It seems odd that an environment that would certainly give Haskell so much exposure is strangely not exercised by enough people that there would be some decent documentation. Yet, the language is supposedly is supported.

Has anyone gotten this to work?


Solution

  • Here's what I've done to get it up and running in Linux (Lubuntu 16.0)

    Prerequisites:

    sudo apt-get install -y python3-pip git libtinfo-dev libzmq3-dev libcairo2-dev libpango1.0-dev libmagic-dev libblas-dev liblapack-dev
    

    Setup IHaskell locally

    git clone https://github.com/gibiansky/IHaskell.git
    cd IHaskell
    pip3 install -r requirements.txt
    curl -sSL https://get.haskellstack.org/ | sh
    stack install gtk2hs-buildtools
    stack setup
    stack install
    

    Install Haskell kernal for IPython

    stack exec -- ihaskell install --stack
    

    Run Haskell in Jupyter

    stack exec jupyter -- notebook
    

    More details in: https://github.com/gibiansky/IHaskell