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

strmap: add S.value #612

Merged
merged 1 commit into from
Apr 5, 2019
Merged

strmap: add S.value #612

merged 1 commit into from
Apr 5, 2019

Conversation

davidchambers
Copy link
Member

Closes #611

Please let me know if you prefer lookup or some other name.

/cc @daaaaa

@davidchambers davidchambers requested a review from svozza March 17, 2019 22:08
@Bradcomp
Copy link
Member

The code looks good.

I think I may prefer lookup over value, but not strongly. value just seems really ambiguous. We are in a little pickle because our current names aren't consistent:
get - verb: would suggest lookup as the closest analogue
prop - noun: would suggest value as the closest analogue

@davidchambers
Copy link
Member Author

Thank you for your feedback, @Bradcomp. :)

I think I may prefer lookup over value, but not strongly. value just seems really ambiguous.

Does seeing the types of value and values together change your perspective?

value  :: String -> StrMap a -> Maybe a
values ::           StrMap a -> Array a

I see this function as the singular of S.values, so value seems natural to me. I agree that value is not descriptive, but neither is values. 🤣

Although naming is an important aspect of API design, even nondescriptive names eventually become meaningful through association. S.ap, anyone? :)

Does anyone wish to further support lookup? I am open to having my mind changed.

@davidchambers davidchambers merged commit 507d749 into master Apr 5, 2019
@davidchambers davidchambers deleted the davidchambers/value branch April 5, 2019 11:42
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

Successfully merging this pull request may close these issues.

2 participants