[Haskell & FP in Education] Yesod code teaching app on iOS devices

Olaf Klinke olf at aatal-apotheke.de
Wed Sep 7 07:56:09 UTC 2022


Dear list, 

I built a compiler in Haskell for a primary school third-grade
programming concept. It features in the math workbook the class uses. 
The language is tiny and its semantics are towers of stacked cubes [*].
The compiler currently has:

* a parsec parser
* a highlighter for parse errors
* a pretty-printer for the language (inverse to the parser)
* an SVG generator

Education goals are
1. procedural thinking (the language has non-nested loops)
2. abstraction 
  2a. try to imagine the tower by looking at the source code
  2b. identitfy the program whose semantics is a given tower
3. the write code-compile cycle (understand error messages)

The target school uses iPads (presumably of the pre-arm generation)
whence cross-compiling is probably too much hassle. Therefore I am
considering wrapping the compiler in a Yesod webserver, as SVG is
natively embeddable in HTML. Is the webserver approach favourable for a
class environment? Could I have hacked it together more easily using
other education frameworks, e.g. Scratch? 

Cheers,
Olaf

[*] The semantics is even a monoid homomorphism from the monoid of
sequences of commands to the commutative monoid of cube towers. 



More information about the Education mailing list