Search code examples
ipythonjupyter-notebookjupyterihaskell

Can IHaskell and IPython coexist?


I have IPython and IPython Notbook installed and am working my way through the IHaskell installation instructions. I have all the IHaskell prerequisites installed, but before I commit to the final step of installing IHaskell itself with

cabal install ihaskell --reorder-goals

I want to confirm one — perhaps obvious — thing: Will I still be able to use Python Notebooks? The instructions following the step above seem to say that simply entering

ipython notebook

will run Haskell rather than Python, as if Haskell has replaced Python in IPython Notebooks. Is this the case? How do I specify whether I want to run Haskell or Python in a notebook, or in IPython itself for that matter? Can I switch freely between the two?


OS X 10.10.4; Xcode 6.4; CLT: 6.4.0.0.1; Clang: 6.1; Haskell Platform 7.10.2-a. Python 2.7.10 (Homebrew). Using Homebrew in general, but, following what appears to be Homebrew's recommendation, not for Haskell.


Solution

  • Like other kernels, IHaskell can be added to IPython/Jupyter without interfering with other kernels. Once added Notebooks will recognize the language used in (suitably tagged) notebooks and will add an entry to the 'New' notebook menu that allows selection of the language to be used for new notebooks.

    Each kernel will have its own command for adding itself to IPython/Jupyter. For IHaskell this is simply

    ihaskell install