**How to get help:** Feel free to open an issue [on Github](https://github.com/gibiansky/IHaskell/issues?direction=desc&sort=updated&state=open) or join the [Gitter channel](https://gitter.im/gibiansky/IHaskell?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge).
**How to get help:** Feel free to open an issue [on Github](https://github.com/gibiansky/IHaskell/issues?direction=desc&sort=updated&state=open) or join the [Gitter channel](https://gitter.im/gibiansky/IHaskell?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge).
Arch Linux has a package for IHaskell: https://aur.archlinux.org/packages/ihaskell-git/
### Install Using Installation Scripts
### Install Using Installation Scripts
#### Ubuntu:
#### Ubuntu:
...
@@ -63,17 +65,23 @@ Once this is done, running `ipython --version` should print out `3.0` or above.
...
@@ -63,17 +65,23 @@ Once this is done, running `ipython --version` should print out `3.0` or above.
Note that IHaskell *requires* 3.0 or above; IHaskell *will not work* with IPython 2 or earlier.
Note that IHaskell *requires* 3.0 or above; IHaskell *will not work* with IPython 2 or earlier.
#### Install Haskell
#### Install Haskell
Install GHC and Cabal. You must have appropriate versions of both:
You can let [Stack](http://www.stackage.org/) take care of everything by running `stack setup` from within the IHaskell folder. Stack can also be used to build IHaskell later and will manage dependencies better than cabal (like in issue #578).
Or you can install GHC and Cabal manually. You must have appropriate versions of both:
```bash
```bash
ghc --numeric-version# Should be 7.6.* or 7.8.*
ghc --numeric-version# Should be 7.6.* or 7.8.* or 7.10.*
cabal --version# Should be 1.18.* or newer
cabal --version# Should be 1.18.* or newer
```
```
These may be installed in a number of ways, including the [Haskell Platform](http://www.haskell.org/platform/), as a [standalone Mac app](https://github.com/ghcformacosx/ghc-dot-app), via Homebrew with `brew install ghc cabal-install`, and so on.
GHC and Cabal may be installed in a number of other ways, including the [Haskell Platform](http://www.haskell.org/platform/), as a [standalone Mac app](https://github.com/ghcformacosx/ghc-dot-app), via Homebrew with `brew install ghc cabal-install`, and so on.
#### Install ZeroMQ
#### Install ZeroMQ
Install ZeroMQ, a library IHaskell uses for asynchronous communication.
Install ZeroMQ, a library IHaskell uses for asynchronous communication.
-**Mac OS X**: With [Homebrew](http://brew.sh/) installed, run `brew install zeromq`. (If using 32-bit Haskell Platform, you *may* need to use `brew install zeromq --universal`. YMMV.)
-**Mac OS X**:
- With [Homebrew](http://brew.sh/) installed, run `brew install zeromq`. (If using 32-bit Haskell Platform, you *may* need to use `brew install zeromq --universal`. YMMV.)
- With [MacPorts](https://www.macports.org/) installed, run `ports install zmq`
-**Ubuntu**: Run `sudo apt-get install libzmq3-dev`.
-**Ubuntu**: Run `sudo apt-get install libzmq3-dev`.
-**Other**: You can install ZeroMQ from source or use another package manager:
-**Other**: You can install ZeroMQ from source or use another package manager:
```bash
```bash
...
@@ -87,6 +95,9 @@ sudo ldconfig
...
@@ -87,6 +95,9 @@ sudo ldconfig
If your own platform has a package and I haven't included instructions for it, feel free to send me an email or a PR on this README.
If your own platform has a package and I haven't included instructions for it, feel free to send me an email or a PR on this README.
#### Install Haskell Tools
#### Install Haskell Tools
*(This section can be skipped when using stack)*
First, make sure that executables installed by `cabal` are on your shell `PATH`:
First, make sure that executables installed by `cabal` are on your shell `PATH`:
```bash
```bash
# If you have a ~/.cabal/bin folder:
# If you have a ~/.cabal/bin folder:
...
@@ -102,7 +113,12 @@ cabal install happy cpphs
...
@@ -102,7 +113,12 @@ cabal install happy cpphs
```
```
#### Build IHaskell
#### Build IHaskell
Install IHaskell! You may install it from Hackage via `cabal install`:
Install IHaskell! You may install it from Stackage via `stack install` (check the latest version on [http://www.stackage.org/lts-3.8]:
```bash
stack install ihaskell-0.6.5.0
```
Or you may install it from Hackage via `cabal install`:
```bash
```bash
cabal install ihaskell --reorder-goals
cabal install ihaskell --reorder-goals
```
```
...
@@ -144,6 +160,14 @@ The above will install `ihaskell`, all support libraries (specified in `stack.ya
...
@@ -144,6 +160,14 @@ The above will install `ihaskell`, all support libraries (specified in `stack.ya
Mac OS X users using MacPorts may run into an [issue involving libiconv](http://blog.omega-prime.co.uk/?p=96). A solution is to add the following lines in the file stack.yaml:
```
extra-lib-dirs:
- /usr/lib
extra-include-dirs:
- /usr/include
```
#### Run IHaskell
#### Run IHaskell
Run IHaskell:
Run IHaskell:
-`ihaskell install` to install the IHaskell kernel into Jupyter.
-`ihaskell install` to install the IHaskell kernel into Jupyter.
"/* Styles used for the Hoogle display in the pager */\n",
".hoogle-doc {\n",
" display: block;\n",
" padding-bottom: 1.3em;\n",
" padding-left: 0.4em;\n",
"}\n",
".hoogle-code {\n",
" display: block;\n",
" font-family: monospace;\n",
" white-space: pre;\n",
"}\n",
".hoogle-text {\n",
" display: block;\n",
"}\n",
".hoogle-name {\n",
" color: green;\n",
" font-weight: bold;\n",
"}\n",
".hoogle-head {\n",
" font-weight: bold;\n",
"}\n",
".hoogle-sub {\n",
" display: block;\n",
" margin-left: 0.4em;\n",
"}\n",
".hoogle-package {\n",
" font-weight: bold;\n",
" font-style: italic;\n",
"}\n",
".hoogle-module {\n",
" font-weight: bold;\n",
"}\n",
".hoogle-class {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"/* Styles used for basic displays */\n",
".get-type {\n",
" color: green;\n",
" font-weight: bold;\n",
" font-family: monospace;\n",
" display: block;\n",
" white-space: pre-wrap;\n",
"}\n",
"\n",
".show-type {\n",
" color: green;\n",
" font-weight: bold;\n",
" font-family: monospace;\n",
" margin-left: 1em;\n",
"}\n",
"\n",
".mono {\n",
" font-family: monospace;\n",
" display: block;\n",
"}\n",
"\n",
".err-msg {\n",
" color: red;\n",
" font-style: italic;\n",
" font-family: monospace;\n",
" white-space: pre;\n",
" display: block;\n",
"}\n",
"\n",
"#unshowable {\n",
" color: red;\n",
" font-weight: bold;\n",
"}\n",
"\n",
".err-msg.in.collapse {\n",
" padding-top: 0.7em;\n",
"}\n",
"\n",
"/* Code that will get highlighted before it is highlighted */\n",
".highlight-code {\n",
" white-space: pre;\n",
" font-family: monospace;\n",
"}\n",
"\n",
"/* Hlint styles */\n",
".suggestion-warning { \n",
" font-weight: bold;\n",
" color: rgb(200, 130, 0);\n",
"}\n",
".suggestion-error { \n",
" font-weight: bold;\n",
" color: red;\n",
"}\n",
".suggestion-name {\n",
" font-weight: bold;\n",
"}\n",
"</style><span class='get-type'>ChildWidget :: forall (w :: WidgetType). (RecAll Attr (WidgetFields w) ToPairs) => IPythonWidget w -> ChildWidget</span>"
],
"text/plain": [
"ChildWidget :: forall (w :: WidgetType). (RecAll Attr (WidgetFields w) ToPairs) => IPythonWidget w -> ChildWidget"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"source": [
":t ChildWidget"
":t ChildWidget"
]
]
...
@@ -170,7 +61,7 @@
...
@@ -170,7 +61,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"metadata": {
"collapsed": false
"collapsed": false
},
},
...
@@ -190,19 +81,11 @@
...
@@ -190,19 +81,11 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"metadata": {
"collapsed": false
"collapsed": false
},
},
"outputs": [
"outputs": [],
{
"data": {
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"source": [
"import Control.Monad (replicateM)\n",
"import Control.Monad (replicateM)\n",
"\n",
"\n",
...
@@ -236,125 +119,12 @@
...
@@ -236,125 +119,12 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"metadata": {
"collapsed": false,
"collapsed": false,
"scrolled": true
"scrolled": true
},
},
"outputs": [
"outputs": [],
{
"data": {
"text/html": [
"<style>/*\n",
"Custom IHaskell CSS.\n",
"*/\n",
"\n",
"/* Styles used for the Hoogle display in the pager */\n",
".hoogle-doc {\n",
" display: block;\n",
" padding-bottom: 1.3em;\n",
" padding-left: 0.4em;\n",
"}\n",
".hoogle-code {\n",
" display: block;\n",
" font-family: monospace;\n",
" white-space: pre;\n",
"}\n",
".hoogle-text {\n",
" display: block;\n",
"}\n",
".hoogle-name {\n",
" color: green;\n",
" font-weight: bold;\n",
"}\n",
".hoogle-head {\n",
" font-weight: bold;\n",
"}\n",
".hoogle-sub {\n",
" display: block;\n",
" margin-left: 0.4em;\n",
"}\n",
".hoogle-package {\n",
" font-weight: bold;\n",
" font-style: italic;\n",
"}\n",
".hoogle-module {\n",
" font-weight: bold;\n",
"}\n",
".hoogle-class {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"/* Styles used for basic displays */\n",
".get-type {\n",
" color: green;\n",
" font-weight: bold;\n",
" font-family: monospace;\n",
" display: block;\n",
" white-space: pre-wrap;\n",
"}\n",
"\n",
".show-type {\n",
" color: green;\n",
" font-weight: bold;\n",
" font-family: monospace;\n",
" margin-left: 1em;\n",
"}\n",
"\n",
".mono {\n",
" font-family: monospace;\n",
" display: block;\n",
"}\n",
"\n",
".err-msg {\n",
" color: red;\n",
" font-style: italic;\n",
" font-family: monospace;\n",
" white-space: pre;\n",
" display: block;\n",
"}\n",
"\n",
"#unshowable {\n",
" color: red;\n",
" font-weight: bold;\n",
"}\n",
"\n",
".err-msg.in.collapse {\n",
" padding-top: 0.7em;\n",
"}\n",
"\n",
"/* Code that will get highlighted before it is highlighted */\n",
".highlight-code {\n",
" white-space: pre;\n",
" font-family: monospace;\n",
"}\n",
"\n",
"/* Hlint styles */\n",
".suggestion-warning { \n",
" font-weight: bold;\n",
" color: rgb(200, 130, 0);\n",
"}\n",
".suggestion-error { \n",
" font-weight: bold;\n",
" color: red;\n",
"}\n",
".suggestion-name {\n",
" font-weight: bold;\n",
"}\n",
"</style><span class='err-msg'>No instance for (Data.Vinyl.Lens.RElem<br/> 'ihaskell-widgets-0.1.0.0:IHaskell.Display.Widgets.Singletons.Orientation '[] (Data.Vinyl.TypeLevel.RIndex 'ihaskell-widgets-0.1.0.0:IHaskell.Display.Widgets.Singletons.Orientation '[]))<br/> arising from a use of ‘setField’<br/>In the expression: setField box Orientation VerticalOrientation<br/>In an equation for ‘it’: it = setField box Orientation VerticalOrientation</span>"
"The `PlaceProxy` widget allows for more flexible use-cases involving arbitrary widgets. It is similar to `ProxyWidget`, but allows more control over where the widget is displayed.\n",
"\n",
"This widget can be used to display widgets inside markdown cells, among other places such as custom widgets or custom html elements. For example, we can create a html `div` inside this markdown cell, and cause the child widget to display in it using its CSS selector.\n",
"To view a widget's properties, we use the `properties` function:"
"To view a widget's properties, we use the `properties` function. It also shows the type represented by the `Field`, which generally are not visible in type signatures due to high levels of type-hackery."
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"metadata": {
"collapsed": false,
"collapsed": false,
"scrolled": false
"scrolled": false
},
},
"outputs": [
"outputs": [],
{
"data": {
"text/plain": [
"ViewModule\n",
"ViewName\n",
"MsgThrottle\n",
"Version\n",
"DisplayHandler\n",
"Visible\n",
"CSS\n",
"DOMClasses\n",
"Width\n",
"Height\n",
"Padding\n",
"Margin\n",
"Color\n",
"BackgroundColor\n",
"BorderColor\n",
"BorderWidth\n",
"BorderRadius\n",
"BorderStyle\n",
"FontStyle\n",
"FontWeight\n",
"FontSize\n",
"FontFamily\n",
"Description\n",
"Tooltip\n",
"Disabled\n",
"Icon\n",
"ButtonStyle\n",
"ClickHandler"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"source": [
"-- The button widget has many properties.\n",
"-- The button widget has many properties.\n",
"properties button"
"properties button"
...
@@ -1053,19 +343,11 @@
...
@@ -1053,19 +343,11 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {
"metadata": {
"collapsed": false
"collapsed": false
},
},
"outputs": [
"outputs": [],
{
"data": {
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"source": [
"-- 250 pixels wide\n",
"-- 250 pixels wide\n",
"setField button Width 250"
"setField button Width 250"
...
@@ -1080,20 +362,12 @@
...
@@ -1080,20 +362,12 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {
"metadata": {
"collapsed": false,
"collapsed": false,
"scrolled": true
"scrolled": true
},
},
"outputs": [
"outputs": [],
{
"data": {
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"source": [
"setField button Description \"Click Me (._.\\\")\"\n",
"setField button Description \"Click Me (._.\\\")\"\n",
synopsis: A library for creating kernels for IPython frontends
synopsis: A library for creating kernels for IPython frontends
description: ipython-kernel is a library for communicating with frontends for the interactive IPython framework. It is used extensively in IHaskell, the interactive Haskell environment.
description: ipython-kernel is a library for communicating with frontends for the interactive IPython framework. It is used extensively in IHaskell, the interactive Haskell environment.