Want to avoid primitive obsession/boolean blindness in #elmlang? So do I!https://robots.thoughtbot.com/lessons-learned-avoiding-primitives-in-elm …
-
-
Replying to @joshuaclayton @thoughtbot
Irrelevant to elm, but seems kwargs fulfill much of this use case as well, no? (Separate type still useful in dollars vs cents etc)
1 reply 0 retweets 0 likes -
Replying to @sgrif
the issue with that in e.g. Elm/Haskell is that it disallows use of partial application - you'd need to construct the record entirely
1 reply 0 retweets 0 likes -
Replying to @joshuaclayton @sgrif
which, in certain cases, becomes more difficult; you could partially construct w/each val as a Maybe, but that seems less than ideal
2 replies 0 retweets 0 likes -
Replying to @joshuaclayton
Which is basically just a newtype but with the language doing most of the legwork
1 reply 0 retweets 0 likes -
Replying to @sgrif
yep - that's def possible in Elm w/type aliases, but you lose partial application and compile-time assurance (re: primitives)
4 replies 0 retweets 0 likes
Right but my point was that if the argument had to be named you get the same assurances for many cases.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.