Skip to content

jamesdbrock/testudinal-haskell

Repository files navigation

Testudinal Haskell

Haskell programming with turtle graphics, for ages 9–13.

This is an attempt to provide a real Haskell educational programming environment for the youngest possible audience. It’s a Jupyter notebook REPL running Haskell in Visual Studio Code.

Requirements

Docker and Visual Studio Code must be installed on your system.

This will have to be done by someone who knows how to install and configure software development tools.

Docker

You must have Docker installed and running on your system.

https://docs.docker.com/get-docker/

Visual Studio Code

Jupyter support is improving rapidly. You should be on the latest version, at least September 2021.

Extensions

  • Jupyter ms-toolsai.jupyter
  • Haskell Syntax Highlighting justusadam.language-haskell
  • Remote - Containers ms-vscode-remote.remote-containers

This commandline will install the extensions for you.

code --install-extension ms-toolsai.jupyter && code --install-extension justusadam.language-haskell && code --install-extension ms-vscode-remote.remote-containers

Running

Method 1

git clone https://github.com/jamesdbrock/testudinal-haskell.git
cd testudinal-haskell
code .

Then make sure you click the popup Reopen in Container button to run the devcontainer.

Reopen In Containter]

Method 2

To run VS Code directly in the devcontainer, you’ll have to first follow these instructions.

Opening a folder directly within a dev container

cd testudinal-haskell
devcontainer open .

Disable VS Code extensions

Remember to turn off your Vim keybindings for children.

code --disable-extension vscodevim.vim .

Ingredients

These are the essential ingredients, some of which have only become available in 2021, that I think make a very nice Haskell programming environment for children.

  • Jupyter Notebooks in VS Code

    Browser-based Jupyter is actually pretty dreadful. If you know where to click it works okay, but if you are just experimentally clicking around the window and pressing buttons then you will very soon activate some browser function that takes you away from the page that you're on, which is very confusing.

  • VS Code devcontainers

    A Jupyter client with an IHaskell kernel and all of the necessary libraries is a massively polyglot multiprocess software system. A container is a pretty ideal way to package and distribute this system. The fact that VS Code can run a Jupyter kernel out of a container is very convenient.

  • Diagrams.TwoD.Path.Turtle

    The turtle drawing library for the diagrams package.

  • IHaskell Widgets

    Thanks David Davó for reviving ihaskell-widgets for the IHaskell Jupyter kernel.

  • default (Rational) and instance {-# OVERLAPPING #-} Show (Rational)

    All numbers are Rational by default in the notebook. When a Rational is shown, we show it with the / operator instead of the % constructor. So when we compute 10/6 the result is 5/3. Anyone who has studied fourth-grade fractions will expect numbers to work this way, and rightly so. It's cruel to inflict IEEE 754 on children.

  • LANGUAGE BlockArguments

    Experienced Haskellers just write $ do without thinking about it, and they mostly don't notice how crazy and inexplicable that dollar sign is. Thanks, Akio Takano.

Screenshots

Other Haskell Programming Education Resources

Codeworld by Chris Smith thoughts

Codeworld Haskell More Haskelly Codeworld

Try Haskell

Learn You a Haskell for Great Good! Jupyter adaptation

Caveats

Here are some things which need improvement.

  1. Error messages.

    They’re terrible. We try to pretend in this notebook that Haskell is a simple language with no type annotations but when a type error occurs it’s nonsense to a ten-year-old.

About

Haskell programming with Turtle drawing, for ages 9–13

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published