-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add List.ends_with?/2 #13768
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 List.ends_with?/2 #13768
Conversation
Why not call Also, this might be a silly ask, but what do you think about adding a test to stream_data for this? We have tests for Elixir stdlib in there 🙃 |
We don't need to keep compatibility between exceptions, so delegating to |
Sounds good, will go with
I can! If we delegate, we'd be testing erlang's stdlib I guess, but nothing's wrong with that :) |
318ca03
to
906a69a
Compare
@sabiwara I mean we are wrapping it and we might change impl, so yeah I think still we are testing Elixir. Also, I suggested this because of the "complex" spec you wrote for the function: when I see something like that, I always thing about a property to write 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we want to inline this but looks good to me 👍
Good point, that would make sense I think? |
We typically only inline when there is a native implementation on the other side. So this is good to go. PS: Plus, if the type system works out, anything that is not a native implementation will have to be rewritten in pure Elixir so Elixir can prove it is correct in core. |
We have several options here:
:lists.suffix
(if so, perhaps we can do the same for starts_with? / prefix)FunctionClauseError
withstarts_with?/2
(see these tests)