5 ms·
Select example: https://gist.github.com/jinjor/bf37f10713028a1d9ef547724bcf5532 https://gist.github.com/jinjor/bf37f10713028a1d9ef547724bcf5... Different Select
by zalmoxes 10y ago
Select example: https://gist.github.com/jinjor/bf37f10713028a1d9ef547724bcf5532 https://gist.github.com/jinjor/bf37f10713028a1d9ef547724bcf5...
Different Select Example: https://gist.github.com/manuscrypt/0dac581c25101526e2398228c241b61c https://gist.github.com/manuscrypt/0dac581c25101526e2398228c...
Searching elm-discuss for <2 minutes.
- beckler 10y agohttps://gist.github.com/chalmagean/c0b2f874bcff728b3db047aa26b4e477 https://gist.github.com/chalmagean/c0b2f874bcff728b3db047aa2...
- vilhelm_s 10y agoThe first example has the duplication that the blogpost complains about. The second one doesn't use tagged union types, so you don't get the case statement coverage checking that the author wanted (if you want the tagged union, the task of converting it into a list is pushed to the client of the library).
- nightski 10y agoThe problem is that the case statement coverage isn't a valid assumption in this case and using a union type is putting a square peg in a round hole. HTML selects do allow duplicate names. He'd be better off just using a dictionary or list of name/value pairs and forgoing the union type altogether.