3 ms·
Not OP, but I just finished a small trial phase with it. There's no straightforward way to make nested record updates. You have to write separate setter functi
by mixedCase 10y ago
Not OP, but I just finished a small trial phase with it.
There's no straightforward way to make nested record updates. You have to write separate setter functions for every step of the way.
If you don't list every single mutation in a single type, and have a single update function to handle them all, you're in for an exhorbitant amount of boilerplate to wire it all. Long, single file types and functions with Objective-C style namespacing are idiomatic.
All is good error wise, until you have to use the escape hatch to JavaScript, in which case good luck building a separate castle of abstractions to fit both of them together and debug it.
There's also the fact that the language creator has to bless a set of bindings before they're allowed to be packaged and uploaded. I do not know how this works out in practice, but it certainly made me raise my eyebrows and not in a good way.
In summary: It's a promising language, but using it to build large codebases either involves techniques the community doesn't know about or it's an exercise in masochism. Maybe in a few years it'll be good.
- politician 10y agoThanks for the insight; we're also evaluating Elm, but our code base isn't large, and we committed to using flat records. Good point about the nested record handling.
- mixedCase 10y agoFor what it's worth, I am analyzing it again after making a small prototype of the application I needed it for but using Vue + Vuex. It's helped me put in perspective the amount of boilerplate needed by Elm, and now I'm not so sure that particular downside is as big compared to the alternatives as to disqualify it... I'm going to give it another full week before going one way or the other.
- cies 10y agoDid you have a look at PureScript? It has type classes, which might just elegantly solve your boilerplate problems. I think it's FFI is also simpler.
- mixedCase 10y agoI have, and ignored it. It appears to be too focused on developers already familiar with pure functional programming and the documentation looks impenetrable; where Elm does much better on both fronts. I might take a deeper look at it later, however. But I'm not interested in making a web application if I can't train a JavaScript programmer to be productive with it in a week. Elm did give me that, and I get the impression PureScript doesn't.
- jewbacca 10y ago> There's no straightforward way to make nested record updates. You have to write separate setter functions for every step of the way. A pattern for this kind of thing in Haskell is Lenses/Prisms: http://adit.io/posts/2013-07-22-lenses-in-pictures.html http://adit.io/posts/2013-07-22-lenses-in-pictures.html