3 ms·
https://github.com/slamdata/purescript-halogen https://github.com/slamdata/purescript-halogen is a very nice frontend library with local state per component, su
by arianvanp 8y ago
https://github.com/slamdata/purescript-halogen https://github.com/slamdata/purescript-halogen is a very nice frontend library with local state per component, such that not the entire vdom needs to be diffed.
However, if you want an easy migration path, there is
https://github.com/pselm/core https://github.com/pselm/core
Which is a drop-in replacement of the Elm 0.18 API in purescript. You can almost directly copy your elm code to it and it will work with minor changes
- dan-robertson 8y agoI recall looking at halogen a while ago (maybe a year?) and I didn’t really get where it was going. The goal is to do ui in a functional language and you chooses a functional language for various reasons. But then the halogen components are essentially reimplementing object orientation in purescript (so everything looks weird, there isn’t special syntax for common things, and the types are bizarre): Components are these things that have a way to initialise themselves, an internal state, a way to receive messages and update their internal state, a way to compute from the internal state (ie rendering), and a way to reply to messages that are querying things (by having the message pass a callback for the reply as an argument). The only thing they have which is missing from standard oo is a way to pass up messages to their parent component. After all that one must wonder what the point of using purescript for this is and why not just use a more object-oriented language fron the start?
- mbo 8y agoThat `core` `README` is really good! It's convinced me to look more into PureScript. Thank-you!
- platz 8y agoI like halogen, but elm folks may want something more familiar (and with less type variables).
- arianvanp 8y agoDefinitely. One of the 'elm-like' libraries (like the one I also linked) are a great stepping stone to get started.
- platz 8y agoI don't think you even need to call them stepping stones. They are perfectly fine libraries in their own regard. Slamdata had some specific requirements with halogen that everyone may not need. And although the free monad approach is nice, it certainly is not fundamental or necessarily the best depending on the task to UI construction.