3 ms·
There is no reasonable or agreed upon way to do select boxes. You might at this point go “what?! isn’t that pretty basic stuff?” and I’d argue that you’d be rig
by dkersten 10y ago
There is no reasonable or agreed upon way to do select boxes. You might at this point go “what?! isn’t that pretty basic stuff?” and I’d argue that you’d be right. The more I dug into this problem the more my conclusion solidified: Elm is: not ready for serious use
I've only briefly looked at Elm so far, so I'm not sure how much of an issue this is or isn't in real code. However, I'd like to point out that Javascript (without jquery or other frameworks) also doesn't have any selectbox support besides the built-in HTML ones (which aren't very flexible). I even wrote my own yesterday. Took about 100 lines of JS (no dependencies). I've written similar code in ClojureScript.
I know that the complaint is that the author had difficulties building a select/dropdown. Maybe its harder in Elm than in JS or ClojureScript for some reason, which is a shame if true, but it can't be thaaaat hard, can it?
Of course, Elm is still really young, so its possible it does, indeed, still need a bit more polish to make it truly useful.
- darawk 10y agoThe core of his point seems to be that Elm almost provides you with a strong type-safe way of building a select box. But it stops short by not allowing you to enumerate the values in your type definitions. Since you can't do this, you have to create a regular list with those values in it, which both breaks DRY principles and prevents the compiler from fully validating your code (which is basically the whole point of Elm). Now, all that being said, i'm not familiar enough with Elm to know if he's actually right or if there is a better way to do what he wants. But that is what I think the crux of his point is.
- dkersten 10y agoAh, I see. Thanks for the explanation.