14

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?

Daisha Lynn
  • 459
  • 1
  • 4
  • 16
  • If you are under linux you can actually install iHaskell without building it from source, as specified in the jupyter documentation: https://github.com/jupyter/jupyter/wiki/Jupyter-kernels#repository – Hoff Aug 21 '17 at 16:16
  • I'm willing use Linux to get this. Does anyone have full end-to-end instructions on how to get this working on Ubuntu? Do I need to install Anaconda? – Daisha Lynn Aug 21 '17 at 21:35

2 Answers2

14

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

James Brock
  • 3,236
  • 1
  • 28
  • 33
t2o2
  • 345
  • 3
  • 11
3

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.

James Brock
  • 3,236
  • 1
  • 28
  • 33