You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Make higher-order functions optional
Make function arguments optional
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".
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.
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.
The text was updated successfully, but these errors were encountered: