Boy oh boy do I find myself wishing Elm had typeclasses
=> More informations about this toot | More toots from socks@social.emisocks.com
Or at the VERY least that it implemented all the functions for common typeclasses on common types
The Maybe type does have andThen which is really just >>= (it's very janky to rely on convention for that but whatever) but I now have to implement the Alternative functions myself
=> More informations about this toot | More toots from socks@social.emisocks.com
Surely it's not THAT uncommon to want to take a list of Maybes and return the first Just. Plus Elm boasts about its aggressive dead code elimination so it wouldn't result in bigger apps to add these functions
Bleh
=> More informations about this toot | More toots from socks@social.emisocks.com
@socks there's stuff like that which used to be in the stdlib. Once it was "simplified" it got moved to various elm-community/TYPE-extra
packages.
For instance, the function you're describing is Maybe.Extra.orList: https://package.elm-lang.org/packages/elm-community/maybe-extra/latest/Maybe-Extra#orList
=> More informations about this toot | More toots from kae_bytheocean@slime.global
@socks heh, for "instance"
=> More informations about this toot | More toots from kae_bytheocean@slime.global
@kae_bytheocean Oh, interesting. Hm, I would expect this stuff to be either in the standard library, or displayed prominently somewhere in the docs
=> More informations about this toot | More toots from socks@social.emisocks.com
@socks I think they've been full-on "let's make this as simple as possible for newcomers", and the vast majority of the methods in there aren't things newcomers think about.
I see this issue across all software documentation / education, really. I wish you could tell every doc or article your experience level and it decides what collapsed things to expand, etc.
=> More informations about this toot | More toots from kae_bytheocean@slime.global
@kae_bytheocean Yeah, I see that. It's not just the docs, Elm is trying a bit too hard to be newbie-friendly in general for my taste. Which is a shame because it also does a lot of things really well
=> More informations about this toot | More toots from socks@social.emisocks.com This content has been proxied by September (3851b).Proxy Information
text/gemini