IHaskell/README.md

93 lines
3.3 KiB
Markdown
Raw Normal View History

2017-03-11 20:31:06 -05:00
![jupyter](https://i.imgur.com/S16l2Hw.png) ![IHaskell](https://i.imgur.com/qhXXFbA.png) [![Build Status](https://travis-ci.org/gibiansky/IHaskell.svg?branch=master)](https://travis-ci.org/gibiansky/IHaskell)
2013-12-12 17:21:15 -08:00
2015-03-25 21:56:27 -07:00
# IHaskell
> You can now try IHaskell directly in your browser at [try.jupyter.org](https://try.jupyter.org).
2016-01-26 00:24:38 -08:00
>
2016-02-08 21:32:24 -08:00
> Alternatively, watch a [talk and demo](http://begriffs.com/posts/2016-01-20-ihaskell-notebook.html) showing off IHaskell features.
IHaskell is a kernel for the [Jupyter project](http://ipython.org), which allows you to use Haskell inside Jupyter frontends (including the console and notebook).
2014-01-09 20:37:23 -05:00
2015-03-25 22:02:40 -07:00
For a tour of some IHaskell features, check out the [demo Notebook](http://nbviewer.ipython.org/github/gibiansky/IHaskell/blob/master/notebooks/IHaskell.ipynb). More example notebooks are available on the [wiki](https://github.com/gibiansky/IHaskell/wiki).
The [wiki](https://github.com/gibiansky/IHaskell/wiki) also has more extensive documentation of IHaskell features.
2013-10-21 13:18:59 -07:00
![IPython Console](https://raw.github.com/gibiansky/IHaskell/master/images/ihaskell-console.png)
![IPython Notebook](https://raw.github.com/gibiansky/IHaskell/master/images/ihaskell-notebook.png)
2017-03-11 20:31:06 -05:00
### Interactive In-Browser Notebook
2014-01-05 14:49:40 -05:00
2014-03-02 13:21:02 -08:00
**Note:** IHaskell does not support Windows. To use on Windows, install
Virtualbox, install Ubuntu or another Linux distribution, and proceed with the
install instructions.
2014-03-02 13:21:02 -08:00
2017-03-11 20:31:06 -05:00
# Installation
2014-05-18 14:29:28 -07:00
2017-03-11 20:31:06 -05:00
## Linux
2017-03-11 20:31:06 -05:00
Some prerequisites; adapt to your distribution.
2015-03-25 21:56:27 -07:00
2015-07-17 20:49:41 +01:00
```bash
2017-03-12 20:07:16 -04:00
sudo apt-get install -y python3-pip git libtinfo-dev libzmq3-dev libcairo2-dev libpango1.0-dev
2015-07-17 20:49:41 +01:00
```
2013-10-21 13:18:59 -07:00
```bash
2017-03-11 20:31:06 -05:00
pip3 install -r requirements.txt
curl -sSL https://get.haskellstack.org/ | sh
2017-03-12 20:07:16 -04:00
git clone https://github.com/abarbu/IHaskell
cd IHaskell
2017-03-11 20:31:06 -05:00
stack install gtk2hs-buildtools
stack install --fast
stack exec ihaskell -- install
2013-10-21 13:18:59 -07:00
```
2017-03-11 20:31:06 -05:00
## Mac
2014-05-19 22:52:11 -07:00
2017-03-12 20:07:16 -04:00
These haven't been tested and there may be some missing required packages. But
they will be soon.
2014-05-19 22:52:11 -07:00
```bash
2017-03-11 20:31:06 -05:00
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install python3
brew install zeromq
curl -sSL https://get.haskellstack.org/ | sh
2017-03-12 20:07:16 -04:00
git clone https://github.com/abarbu/IHaskell
cd IHaskell
2017-03-11 20:31:06 -05:00
stack install gtk2hs-buildtools
stack install --fast
stack exec ihaskell -- install
2014-05-19 22:52:11 -07:00
```
2017-03-11 20:31:06 -05:00
# Running
2013-10-31 10:59:16 -04:00
```bash
2017-03-11 20:31:06 -05:00
stack exec jupyter -- notebook
2013-10-31 10:59:16 -04:00
```
2017-03-11 20:31:06 -05:00
## Where are my packages?
2017-03-11 20:31:06 -05:00
Stack manages separate environments for every package. By default your notebooks
will only have access to a few packages that happen to be required for
ihaskell. To make packages available add them to the stack.yaml in the ihaskell
directory and run `stack solver && stack install`.
2013-10-31 10:59:16 -04:00
2017-03-11 20:31:06 -05:00
Packages should be added to the `packages:` section and can take the following
form
([reproduced here from the stack documentation](https://github.com/commercialhaskell/stack/blob/master/doc/yaml_configuration.md#packages)). If
you've already installed a package by `stack install` you can simply list its
name even if it's local.
2014-01-03 00:10:15 -05:00
```
2017-03-11 20:31:06 -05:00
- package-name
- location: .
- location: dir1/dir2
- location: https://example.com/foo/bar/baz-0.0.2.tar.gz
- location: http://github.com/yesodweb/wai/archive/2f8a8e1b771829f4a8a77c0111352ce45a14c30f.zip
- location:
git: git@github.com:commercialhaskell/stack.git
commit: 6a86ee32e5b869a877151f74064572225e1a0398
- location:
hg: https://example.com/hg/repo
commit: da39a3ee5e6b4b0d3255bfef95601890afd80709
2014-01-03 00:10:15 -05:00
```