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

Make function arguments optional #15

Open
ghost opened this issue Jan 2, 2017 · 3 comments
Open

Make function arguments optional #15

ghost opened this issue Jan 2, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 2, 2017

It's easy to forget, or convenient to leave out, the function argument when you're looking for e.g. List higher-order functions like all or filter. E.g. "List a -> Bool" when you mean "List a -> (a -> Bool) -> Bool". It'd be great, and would save some confusion when "List a -> Bool" doesn't return anything, to be able to leave the function argument out and for results with that signature to still be returned. The fact that it's a higher-order function is only a detail compared to what you're trying to do: List to Bool. Sure, when someone publishes an allTheSame function for List, it will show up with List a -> Bool, but not until then.

@ghost ghost changed the title Make higher-order functions optional Make function arguments optional Jan 2, 2017
@ghost
Copy link
Author

ghost commented Jan 2, 2017

A better example is of trying to find foldl or foldr before you've seen its type signature before:
(a -> b -> b) -> b -> List a -> b is harder to come up with than List a -> b, which currently returns no results. This is copied from Slack: "What in Elm similar to reduce".

@klaftertief
Copy link
Owner

Would you expect some special keyword or symbol or do you think this should work automagically?
I thought a bit about this for some special cases. I expect performance penalties for a too generic solution.

@ghost
Copy link
Author

ghost commented Jan 11, 2017

I think this should work automagically, as I've been confused when List a -> Bool didn't return what I was expecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant