elmcraft / core-extra

Utility functions for an improved experience with elm/core
https://package.elm-lang.org/packages/elmcraft/core-extra/latest/
Other
22 stars 10 forks source link

Add `Bool.Extra` functions #55

Open kutyel opened 3 months ago

kutyel commented 3 months ago

Is not Bool part of core? 🤔 https://package.elm-lang.org/packages/Chadtech/elm-bool-extra/latest/Bool-Extra

gampleman commented 3 months ago

Those fall into a few categories:

In other words, I would like to see a more complete argument for including any of these functions other than "Is not Bool part of core?", before we consider this.

kutyel commented 3 months ago

@gampleman your complaints are reasonable, I noticed in our codebase we are only using toMaybe which I guess might be useful for someone else? 🤔

gampleman commented 3 months ago

I find that function fairly confusing. Compare:

if bool then
    Just v
else
    Nothing

vs

Bool.Extra.toMaybe bool v

One of those is obvious, the other you need to read a fair amount of documentation...


Anyway, I think my opinion is clear. I'll leave this open for now and if there is a lot more consensus that we should include it, then we can re-evaluate this.