Teaching Kids Programming

WP

Haskell Junior Tutorial

(DRAFT!!!)

Programming Haskell is like using a calculator, but hidden behind this calculator there are hidden powers like you have never seen. I'll show you how to get to those hidden things; but first let see how you can do simple things in Haskell.

Simple stuffs

1+1

Hugs> 1+1
2

Hugs> 2*(10+10)
40

A formula like 2^3 calculates 2 to the power of 3. So here is for example how you can calculate how much people we will have Amsterdam after 30 years if currently it has 1 million people, and every year the population would grow by 2%:

Hugs> 1000000.0 * 1.02^30 
...