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 a function to create Set and Map with a single member #128

Closed
heueristik opened this issue Oct 16, 2024 · 0 comments · Fixed by #130
Closed

Add a function to create Set and Map with a single member #128

heueristik opened this issue Oct 16, 2024 · 0 comments · Fixed by #130
Assignees

Comments

@heueristik
Copy link

heueristik commented Oct 16, 2024

Currently, one needs to use Set.fromList [member] to create a set with a single member.

Add another constructor, allowing to create sets with a single member.

singleton {A} {{Ord A}} (a : A) : Set A := Set.insert a Set.empty;

Do the same for Map as well

@heueristik heueristik changed the title Add a function to create a set with a single member Add a function to create Set and Map with a single member Oct 16, 2024
@lukaszcz lukaszcz self-assigned this Oct 21, 2024
paulcadman pushed a commit that referenced this issue Oct 24, 2024
* Closes #128 
* Closes #129 
* adds more functions to `Stdlib.Set` and `Stdlib.Map`
* improves the implementation of existing functions
* Depends on #127
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 a pull request may close this issue.

2 participants