{"id":14977117,"url":"https://github.com/ihaskell/ihaskell","last_synced_at":"2025-05-12T15:20:45.880Z","repository":{"id":10262453,"uuid":"12373318","full_name":"IHaskell/IHaskell","owner":"IHaskell","description":"A Haskell kernel for the Jupyter project.","archived":false,"fork":false,"pushed_at":"2025-04-20T15:03:59.000Z","size":7381,"stargazers_count":2629,"open_issues_count":45,"forks_count":258,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-04-23T17:14:10.406Z","etag":null,"topics":["haskell","jupyter"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IHaskell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-26T07:16:09.000Z","updated_at":"2025-04-20T15:04:02.000Z","dependencies_parsed_at":"2024-04-08T16:07:34.403Z","dependency_job_id":"05732d11-acaf-4d21-ad71-372dc39abc27","html_url":"https://github.com/IHaskell/IHaskell","commit_stats":{"total_commits":1970,"total_committers":117,"mean_commits":"16.837606837606838","dds":0.6390862944162436,"last_synced_commit":"c414ee58a6c66d66b104075e9345e0c31ac3b45f"},"previous_names":["gibiansky/ihaskell"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IHaskell%2FIHaskell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IHaskell%2FIHaskell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IHaskell%2FIHaskell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IHaskell%2FIHaskell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IHaskell","download_url":"https://codeload.github.com/IHaskell/IHaskell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250477810,"owners_count":21437049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","jupyter"],"created_at":"2024-09-24T13:55:07.009Z","updated_at":"2025-04-23T17:14:15.989Z","avatar_url":"https://github.com/IHaskell.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"![jupyter](https://i.imgur.com/S16l2Hw.png) ![IHaskell](https://i.imgur.com/qhXXFbA.png) [![Build Status](https://github.com/gibiansky/IHaskell/workflows/CI/badge.svg)](https://github.com/gibiansky/IHaskell/actions?query=workflow%3ACI) [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/gibiansky/IHaskell/mybinder)\n\n# IHaskell\n\n\u003e You can now try IHaskell directly in your browser at [CoCalc](https://cocalc.com) or [mybinder.org](https://mybinder.org/v2/gh/gibiansky/IHaskell/mybinder).\n\u003e\n\u003e Alternatively, watch a [talk and demo](http://begriffs.com/posts/2016-01-20-ihaskell-notebook.html) showing off IHaskell features.\n\nIHaskell is a kernel for the [Jupyter project](https://jupyter.org), which allows you to use Haskell inside Jupyter frontends (including the console and notebook). It currently supports GHC 8.4 through 9.10.\n\nFor a tour of some IHaskell features, check out the [demo Notebook](http://nbviewer.org/github/gibiansky/IHaskell/blob/master/notebooks/IHaskell.ipynb). More example notebooks are available on the [wiki](https://github.com/gibiansky/IHaskell/wiki).\nThe [wiki](https://github.com/gibiansky/IHaskell/wiki) also has more extensive documentation of IHaskell features.\n\n![IPython Console](https://raw.github.com/gibiansky/IHaskell/master/images/ihaskell-console.png)\n![IPython Notebook](https://raw.github.com/gibiansky/IHaskell/master/images/ihaskell-notebook.png)\n\n### Interactive In-Browser Notebook\n\n# Installation\n\n## Linux\n\nSome prerequisites; adapt to your distribution.\n\n```bash\nsudo apt-get install -y python3-pip git libtinfo-dev libzmq3-dev libcairo2-dev libpango1.0-dev libmagic-dev libblas-dev liblapack-dev\n```\n\nInstall `stack`, clone this repository, install Python requirements, install\n`ihaskell`, and install the Jupyter kernelspec with `ihaskell`.\n\nThese instructions assume you don't already have Stack or a Jupyter\ninstallation, please skip the relevant steps if this is not the case.\n\n```bash\ncurl -sSL https://get.haskellstack.org/ | sh\ngit clone https://github.com/gibiansky/IHaskell\ncd IHaskell\npip3 install -r requirements.txt\nstack install --fast\nihaskell install --stack\n```\n\nRun Jupyter.\n\n```bash\nstack exec jupyter -- notebook\n```\n\n## Mac\n\nYou need to have [Homebrew](https://brew.sh) installed.\nIf you do not have it yet run `/usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"` in your terminal.\n\nYou also need the Xcode command line tools.\nYou can install them by running `xcode-select --install` in the terminal and following the prompts.\n\nThese instructions assume you don't already have Stack or a Jupyter\ninstallation, please skip the relevant steps if this is not the case.\n\n```bash\nbrew install python3 zeromq libmagic cairo pkg-config haskell-stack pango\ngit clone https://github.com/gibiansky/IHaskell\ncd IHaskell\npip3 install -r requirements.txt\nstack install --fast\nihaskell install --stack\n```\n\nIf you have Homebrew installed to a location that `stack` does not expect (e.g. `/opt/homebrew`), you'd need to specify `--extra-include-dirs ${HOMEBREW_PREFIX}/include --extra-lib-dirs ${HOMEBREW_PREFIX}/lib` to the `stack` command.\n\nRun Jupyter.\n\n```bash\nstack exec jupyter -- notebook\n```\n\n_Tested on macOS Sierra (10.12.6)_\n\n## Windows\n\nIHaskell does not support Windows, however it can be used on Windows 10 via\nWindows Subsystem for Linux (WSL). If WSL is not installed, follow the\n[Installation Guide for Windows 10](https://docs.microsoft.com/en-us/windows/wsl/install-win10).\nThe following assumes that Ubuntu is picked as the Linux distribution.\n\nIn the Ubuntu app, follow the steps above for Linux.\n\nJupyter Notebook is now ready to use. In the Ubuntu app, launch a Notebook\nServer, without opening the notebook in a browser:\n\n```bash\njupyter notebook --no-browser\n```\n\nReturning to Windows 10, open a browser and copy and paste the URL output in the\nstep above (the token will differ).\n\n```bash\nOr copy and paste one of these URLs:\n     http://localhost:8888/?token=9ca8a725ddb1fdded176d9e0e675ba557ebb5fbef6c65fdf\n```\n\n_Tested on Windows 10 (build 18362.175) with Ubuntu 18.04 on WSL_\n\nAlternatively, install Virtualbox, install Ubuntu or another Linux distribution,\nand proceed with the install instructions.\n\n## Docker\n\nTo quickly run a Jupyter notebook with the IHaskell kernel, try the `Dockerfile`\nin the top directory.\n\n```bash\ndocker build -t ihaskell:latest .\ndocker run --rm -p 8888:8888 ihaskell:latest\n```\n\nOr use the continuously updated Docker image \n[on Docker Hub](https://hub.docker.com/r/gibiansky/ihaskell).\n\n```sh\ndocker run --rm -p 8888:8888 gibiansky/ihaskell\n```\n\nIn order to mount your own local files into the Docker container\nuse following command:\n\n```sh\ndocker run --rm -p 8888:8888 -v \"$PWD\":/home/jovyan/src gibiansky/ihaskell\n```\n\nBe aware that the directory you're mounting must contain\na `stack.yaml` file.\nA simple version would be:\n\n```yaml\nresolver: lts-16.23\npackages: []\n```\n\nIt's recommended to use the same LTS version as the IHaskell image is using itself \n(as can be seen in [its stack.yaml](./stack.yaml)).\nThis guarantees that stack doesn't have to first perform \na lengthy installation of GHC before running your notebook.\n\nYou can also use the following script to run IHaskell in Docker: https://gist.github.com/brandonchinn178/928d6137bfd17961b9584a8f96c18827\n\n## Nix\n\nIf you have the `nix` package manager installed, you can create an IHaskell\nnotebook environment with one command. For example:\n\n```bash\n$ nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs/tarball/nixos-23.05 release.nix --argstr compiler ghc928 --arg packages \"haskellPackages: [ haskellPackages.lens ]\"\n\u003cresult path\u003e\n$ \u003cresult path\u003e/bin/jupyter notebook\n```\n\nIt might take a while the first time, but subsequent builds will be much\nfaster. You can use the\n[https://ihaskell.cachix.org](https://app.cachix.org/cache/ihaskell) cache for\nprebuilt artifacts.\n\nThe IHaskell display modules are not loaded by default and have to be specified as additional packages:\n\n```bash\n$ nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs/tarball/nixos-23.05 release.nix --argstr compiler ghc928 --arg packages \"haskellPackages: [ haskellPackages.ihaskell-blaze haskellPackages.ihaskell-charts ]\"\n```\n\nFor more examples of using IHaskell with Nix, see https://github.com/vaibhavsagar/notebooks.\n\n# Developing\n\nIHaskell is regularly updated to work with the latest version of GHC. To read how this is done, and how the development environment is set up, please see [this blog post](https://vaibhavsagar.com/blog/2021/05/02/updating-ihaskell-newer-ghc).\n\n## Nix flake\n\nThere is also a Nix flake that provides a developer environment. For details on Nix flakes, please see the documentation at https://wiki.nixos.org/wiki/Flakes.\n\nAfter this, IHaskell can be compiled as follows:\n\n```bash\nnix develop # This opens a new shell with all dependencies installed\ncabal update # Make sure Cabal's package index is up-to-date\ncabal build # Builds IHaskell\n```\n\nNote that this shell also provides `haskell-language-server`, which can be used in your editor if it supports it. Opening your editor from within the `nix develop` shell should allow it to see `haskell-language-server`.\n\n# Troubleshooting\n\n## Where are my packages? (IHaskell + Stack)\n\nStack manages separate environments for every package. By default your notebooks\nwill only have access to a few packages that happen to be required for\nIHaskell. To make packages available add them to the stack.yaml in the IHaskell\ndirectory and run `stack install --fast`.\n\nPackages should be added to the `packages:` section and can take the following\nform\n([reproduced here from the stack documentation](https://github.com/commercialhaskell/stack/blob/master/doc/yaml_configuration.md#packages)). If\nyou've already installed a package by `stack install` you can simply list its\nname even if it's local.\n\n```\n- package-name\n- location: .\n- location: dir1/dir2\n- location: https://example.com/foo/bar/baz-0.0.2.tar.gz\n- location: http://github.com/yesodweb/wai/archive/2f8a8e1b771829f4a8a77c0111352ce45a14c30f.zip\n- location:\n    git: git@github.com:commercialhaskell/stack.git\n    commit: 6a86ee32e5b869a877151f74064572225e1a0398\n- location:\n    hg: https://example.com/hg/repo\n    commit: da39a3ee5e6b4b0d3255bfef95601890afd80709\n```\n\n## The kernel keeps dying (IHaskell + Stack)\n\nThe default instructions globally install IHaskell with support for only one\nversion of GHC. If you've e.g. installed an `lts-10` IHaskell and are using it\nwith an `lts-9` project the mismatch between GHC 8.2 and GHC 8.0 will cause\nthis error. Stack also has the notion of a 'global project' located at\n`~/.stack/global-project/` and the `stack.yaml` for that project should be on\nthe same LTS as the version of IHaskell installed to avoid this issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihaskell%2Fihaskell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fihaskell%2Fihaskell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihaskell%2Fihaskell/lists"}