anoma / juvix-stdlib

The Juvix standard library
https://anoma.github.io/juvix-stdlib/
11 stars 2 forks source link

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

Closed heueristik closed 1 month ago

heueristik commented 1 month ago

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