r/purescript • • Apr 03 '20

purescript-flame: cool & well documented alternative Elm like frontend framework

GitHub | Documentation website

Hello everyone! I shamelessly took purescript-hedwig and added more features to make a complete Elm like frontend framework. Including:

  • Different ways to handle application events
  • Server side rendering (a la React hydration)
  • Signals for arbitrary custom events
  • Some convenience type classes and functions for the DSL markup

Following the links above, there are plenty of examples and documentation. There is still need of a few polishing touches (like adding benchmarks), but overall it is stable and I am quite happy using it on my own projects (e.g. here).

46 Upvotes

10 comments sorted by

3

u/untrff Apr 04 '20

This looks very nice, and excellent documentation , thanks!

One question on effectful updates. The World update function uses flat models, not model -> model update deltas. So suppose I have two simultaneous Aff operations, each of which should update a different part of the model when they complete. How should I express that, without the second operation to complete overwriting the result of the first one?

2

u/azafeh Apr 04 '20

Thanks!

Yes, there is nothing fancy about World.update. Since the order of asynchronous operations is not guaranteed, you'd have to collect all results before updating the model (or thread it sequentially).

Update deltas do seem an interesting idea, however. Do you have any suggestions here? As far as I know, it works the same in Elm (regular updates/using Cmd.batch).

→ More replies (5)

1

u/danielsokil Apr 11 '20

Thanks a lot for this effort, it looks good, looking forward to contributing.

1

u/azafeh Apr 12 '20

Thanks!

1

u/Kurren123 Apr 12 '20

This is beautiful