Soon I’ll lead a typed FP high-school course based on Purescript. The goals of the course are to showcase the functional programming paradigm and benefits of strong type system, and also to teach them things they might not encounter in the usual Programming 101 in college. And because it is aimed at 17 year olds, all of this will be properly illustrated on small real-world projects, games and simulations.
Let’s say we’re implementing Conway’s game of life, where you can click the cells to toggle them, and press space to advance the simulation by one step. What would be the recommended way to go about rendering the grid of cells and listening for the user input?
Considering my goals (showcasing proper FP, showing new interesting things), which one would you choose? Which one would feel the best? And what are the different tradeoffs?
- game, the game engine from @artemisSystem
- emo8, the emoji game engine
canvas, could lead to foreign-feeling code, depending on the API (sort of like using bindings to a C lib in Haskell)
- apparently there’s also canvas-action with a better API
Now, I’m not sure whether FRP is suitable for this type of problem, but if it is, you can use:
And of course, there’s also the “traditional” UI libraries, although I’m not sure whether they would be good for this, either:
- any of the react libraries
I’m sure I’m not the only Purescript beginner wondering how to do this. I think it would help others greatly to have an opinionated list of “you need X? use Y!” aimed at beginners and the common use cases; currently there’s things like awesome-purescript, but they’re not granular enough.