An opinion from someone with “light” Elm experience: The example looks very understandable and the logic easy to follow. The main difficulties I could see here would be:
- Decoders. I remember it being one of the part taking me time to assimilate. There’s no way to avoid them but maybe mentioning them as a prerequisite could help the person get a good base on that.
- I feel like ‘fsa’ is not something that should appear in the code itself. It’s just my opinion but it doesn’t really speak to me when reading the code. I would have understood right away what the
fsa function did if it was named createAction for example.
- One last minor thing: It is generally discouraged to recursively call update, so a beginner might find it disturbing to see it presented as part of the pattern. Maybe adding a comment to justify the use would clarify?
Anyway, great example that I will steal for my current side project (I now have 6 ports and it’s messy and polluting). I was just wondering what a good/simple implementation of that would be!