Haskell under Jupyter

7.7k views Asked by At

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?

2

There are 2 answers

0
t2o2 On BEST ANSWER

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

0
James Brock On

Here is a Community Jupyter Docker Stacks image for IHaskell. If you have Docker installed, then you can run a Haskell Jupyter notebook with one command.