Building a reactive calculator in Haskell
keera.co.ukRed language offers a different approach: https://github.com/red/code/blob/master/Showcase/calculator....
Truly native and cross-platform GUI with declarative DSL for its specification, built-in reactive framework (no FRP though), and semantically rich evaluation model (e.g. note that calculation of typed expression is a one-liner).
So as a minimal example, yes, that is short. But it mixes model and view which, in very large applications, may produce codebases that are really hard to maintain. Are there examples that are much bigger, for example, with at least a few hundred widgets?
By the way, the library used in that blog post is also truly native and cross-platform. Keera has apps and games that work on Windows/Mac/Linux/Web/iOS/Android, all from the same code.
It mixes them because it's a small educational example, no one stops you from following MVC practices if you want.
Most of the Red GUI examples I know of are "programming in the small", like CRUD interfaces, games, and various interactive environments. [1, 2]
The graphical engine relies on OS widgets internally right now, which are resource-heavy and don't scale well (at least on Win32 backend each widget is just that, a window); in the future, more lightweight graphical objects (aka GOBs) will be introduced for use-cases like spreadsheets and data-intensive apps, there's already a PoC for that. [3]
For evaluation and benchmarking, I recommend to check out 7GUIs project [4] and add Keera Hails entries to it; here [5] is Red implementation, for comparison. Some tasks in it directly address MVC separation of concerns.
[1]: https://github.com/red/code
[2]: https://github.com/red/red/wiki/%5BLINKS%5D-Projects-showcas...
[3]: https://github.com/qtxie/red/tree/GOB
Cool! Thank you!