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

Add Map.insert_or_fail #152

Open
Dean177 opened this issue Jun 18, 2020 · 0 comments
Open

Add Map.insert_or_fail #152

Dean177 opened this issue Jun 18, 2020 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@Dean177
Copy link
Collaborator

Dean177 commented Jun 18, 2020

This function should have the following signature:

val insertNoOverride :  'key 'value 'id Map.t -> key:'key -> 'value -> ( 'key 'value 'id Map.t) 'value Result.t

It should return an Ok containing the newly update map *if key has not already been set.

If it has it should return an Error containing the existing value for the key.

Open to suggestions for the name. Some inspiration:

  • (insert / add)NoOverride
  • insertOrFail
  • insertUnique
@Dean177 Dean177 added the help wanted Extra attention is needed label Jun 18, 2020
@pbiggar pbiggar added this to the 0.2.0 milestone Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants