Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bool.Extra functions #55

Open
kutyel opened this issue Apr 4, 2024 · 3 comments
Open

Add Bool.Extra functions #55

kutyel opened this issue Apr 4, 2024 · 3 comments
Labels
new function Request to add a new function to the library

Comments

@kutyel
Copy link
Contributor

kutyel commented Apr 4, 2024

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

@kutyel kutyel added the new function Request to add a new function to the library label Apr 4, 2024
@gampleman
Copy link
Collaborator

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.

@kutyel kutyel changed the title Add Bool.Extra functions Add Bool.Extra functions Apr 5, 2024
@kutyel
Copy link
Contributor Author

kutyel commented Apr 5, 2024

@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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new function Request to add a new function to the library
Projects
None yet
Development

No branches or pull requests

2 participants