-
Notifications
You must be signed in to change notification settings - Fork 3
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
Provide a last
function for lists
#138
Comments
#139 fixes this issue |
I don't think we should have |
We decided not to provide it, not in the Prelude at least. |
Last comes up quite a bit with foldr patterns, it might be good to reconsider having it, as I'm not sure how else you'd give the first element to a foldr |
Whever you want to take the last element and then do foldr, you can reverse the list, take the first element and do foldl. But it's true taking the last element might be more intuitive, so we might want to reconsider this decision. |
There is a
head
functionbut no
The text was updated successfully, but these errors were encountered: