• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

jamesdbrock/learn-you-a-haskell-notebook: Jupyter adaptation of Learn You a Hask ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

jamesdbrock/learn-you-a-haskell-notebook

开源软件地址(OpenSource Url):

https://github.com/jamesdbrock/learn-you-a-haskell-notebook

开源编程语言(OpenSource Language):

Jupyter Notebook 99.5%

开源软件介绍(OpenSource Introduction):

Learn You a Haskell for Great Good!

Read the book right now on mybinder.org with this link: launch Learn You a Haskell for Great Good! (Usually takes a minute to launch)


Screenshot

This is a Jupyter notebook adaptation of the book Learn You a Haskell for Great Good! by Miran Lipovača.

I learned Haskell from this book in 2014 by following along in GHCI, as the book suggested.

In 2019, the Jupyter notebook format would be a nice way read this book. This is one of the best cases for Theodore Gray's idea of the computational essay, and Andrew Gibiansky has made it possible with IHaskell.

Each chapter of the book is one .ipynb Jupyter notebook file. See the list of chapter files on the left sidebar in JupyterLab.

Each notebook cell depends on cells that come before it, so run the notebooks from top to bottom. I have refactored code to make the examples work in Jupyter, and removed instructions for how to use GHCI. Other than that I have tried to be faithful to the original text.

Miran Lipovača wrote this book and released it to the world under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License, which means that the book is free-as-in-speech, and allows us to enjoy the book in notebook format. But that does not mean that the book is free-as-in-beer; it means that you, dear reader, pay for the book under the honor system. If you are honorable and you want to keep living in a world in which honorable artists license their art as Creative Commons, then buy the book.

Thanks also to Paul Vorbach for https://github.com/pvorb/learn-you-a-haskell.

How to run on your local computer in Visual Studio Code

Visual Studio Code has a Notebook UI which you can use to run Jupyter kernels instead of the browser-based JupyterLab or classic Jupyter UI.

Clone this repository with git and cd into the cloned directory

git clone https://github.com/jamesdbrock/learn-you-a-haskell-notebook.git
cd learn-you-a-haskell-notebook
code .

There is a Docker Visual Studio Code devcontainer configuration in the .devcontainer directory.

When you open Visual Studio Code by running code ., a pop-up dialog will tell you that “Folder contains a Dev Container configuration file. Reopen folder to develop in a container.” Click the button labelled Reopen in Container.

You will then be able to open the .ipynb chapter files in the notebook directory.

The VS Code Notebook UI is still a bit rough, here are some problems I’ve noticed:

How to run on your local computer in JupyterLab in a web browser

Clone this repository with git and cd into the cloned directory

git clone https://github.com/jamesdbrock/learn-you-a-haskell-notebook.git
cd learn-you-a-haskell-notebook

Then here are three options for running.

  1. docker

    docker run --rm -p 8888:8888 -v $PWD/notebook:/home/jovyan/work --name learn-you-a-haskell ghcr.io/jamesdbrock/ihaskell-notebook:master jupyter lab --LabApp.token=''

    then open http://localhost:8888 to read the book.

  2. podman

    podman run --privileged --userns=keep-id --rm -p 8888:8888 -v $PWD/notebook:/home/jovyan/work --name learn-you-a-haskell ghcr.io/jamesdbrock/ihaskell-notebook:master jupyter lab --LabApp.token=''

    then open http://localhost:8888 to read the book.

  3. NixOS flake

    nix run . -- --notebook-dir notebook
    

    then the book will open in a browser automatically. If it doesn’t, open the “running at” link.

How to edit notebooks

If you make an improvement to a notebook .ipynb file and you want to save the file and commit the changes and make a pull request to the repository,

  1. Maximize the browser window to full screen width, because cell horizontal scroll bar visibility gets saved in the notebook.

  2. Run -> Restart kernel and Run All Cells...

  3. Save the notebook.

ihaskell-notebook

For more information about the IHaskell Docker image, see https://github.com/jamesdbrock/ihaskell-notebook




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
raviksharma/bartosz-basics-of-haskell: Code and exercises from Bartosz Milewski ...发布时间:2022-06-22
下一篇:
UweSchmidt/hxt: Haskell XML Toolbox发布时间:2022-06-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap