-
Notifications
You must be signed in to change notification settings - Fork 10
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 Function.Extra!? #27
Comments
I have more copies of In the past |
I think that's the key question. I definitely have most of these helpers defined a few times in my projects as well. But is it a pattern that should be encouraged? On the other hand, there is a good few functions in core-extra that probably shouldn't be encouraged already... |
I think it needs to boil down to what you see this package as: is it opinionated and contains only functions that you can vouch for, or is it a merge of the existing -extra packages with all their (better/worse) choices? I'd love |
Thought: It’s also possible to forbid functions using elm-review, if there’s one you vehemently disagree with. I would probably need to forbid |
OK, here's an idea on how to solve the dilemma:
I'm not super confident in this plan, since it creates a decent heap of extra work, that I personally am not super excited about. But there is already some questionable code and so far the feedback I've been hearing seems to be strongly against removing functionality. On this specific proposal, my feeling regarding controversiality is roughly like this:
|
Definitely a vote against
Good point on |
Not sure if there is much appetite for this, but a Core-ish type is the function type. There are a bunch of helper functions to do with functions:
uncurry : (a -> b -> c) -> (a, b) -> c
curry : ((a, b) -> c) -> a -> b -> c
a -> b -> b
,(a -> c) -> (b -> c -> d) -> a -> b -> d
, yada yadatoFixpoint : (a -> a) -> a -> a
and perhapstoFixpointWithLimit : Int -> (a -> a) -> a -> Result a a
while : (a -> Bool) -> (a -> a) -> a -> a
anddoWhile : (a -> a) -> (a -> Bool) -> a -> a
nTimes : Int -> (a -> a) -> a -> a
etc...
Thoughts? Opinions?
The text was updated successfully, but these errors were encountered: