core-extra icon indicating copy to clipboard operation
core-extra copied to clipboard

Add `Bool.Extra` functions

Open kutyel opened this issue 1 year ago • 3 comments

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

kutyel avatar Apr 04 '24 13:04 kutyel

Those fall into a few categories:

  • trivial: List.all identity isn't really something you need a library to provide, no?
  • arbitrary: toString on a boolean is a bit funky, as each language/file format will need different names
  • out of scope: we don't deal with elm/json and don't want to depend on it.

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.

gampleman avatar Apr 04 '24 14:04 gampleman

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

kutyel avatar Apr 05 '24 10:04 kutyel

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.

gampleman avatar Apr 05 '24 11:04 gampleman