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

ERL-1210: Provide a dict:is_dict/1 (and similar functions for ADTs) #4180

Closed
OTP-Maintainer opened this issue Mar 29, 2020 · 1 comment
Closed
Assignees
Labels

Comments

@OTP-Maintainer
Copy link

Original reporter: kostis
Affected version: Not Specified
Component: stdlib
Migrated from: https://bugs.erlang.org/browse/ERL-1210


The {{sets}} module provides an {{is_set/1}} function that other modules can employ to check a term is a set or not, without violating the opacity of the underlying representation.

`Similar' stdlib modules that define opaque ADTs (e.g., {{dict}} and perhaps others – I have not checked all) currently do not provide such functions.

The suggestion/request of this issue is that they do in 23.x onwards.
@OTP-Maintainer
Copy link
Author

bjorn said:

We will not add such functionality this late to OTP 23.

It is not immediately obvious why such functions are useful, so if you want us to consider them for OTP 24 we will need a motivation and the intended use cases. It also not clear whether those functions should give fast, heuristic answers or a slow, thorough answers, or perhaps the choice of both. Of the current functions, ordsets:is_set/1 traverses the entire set before answering true, while sets:is_set/1 only test for the #set{} record. gb_sets:is_set/1 only tests the top-level term.

 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants