Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
DA.Set
Note: This is only supported in Daml-LF 1.11 or later. This module exports the generic set typeSet k and associated
functions. This module should be imported qualified, for example:
Set type, and the various operations
as S.lookup, S.insert, S.fromList, etc.
Set k internally uses the built-in order for the type k.
This means that keys that contain functions are not comparable
and will result in runtime errors. To prevent this, the Ord k
instance is required for most set operations. It is recommended to
only use Set k for key types that have an Ord k instance
that is derived automatically using deriving:
Int, Text, Bool, (a, b) assuming a and b have default
Ord instances, Optional t and [t] assuming t has a
default Ord instance, Map k v assuming k and v have
default Ord instances, and Set k assuming k has a
default Ord instance.
Module Snapshot
Lifecycle
Stable.
Notices
Status:
active
Introduced in: 3.4.9
Removed in: -
Warnings: 0
Deprecations: 0
Deprecated since: -Data Types
data Set k
The type of a set. This is a wrapper over the Map type.
Constructors:
Set| Field | Type | Description | | :---- | :--- | :---------- | | map | Map k () | |
instance Foldable Setinstance Ord k => Monoid (Set k)instance Ord k => Semigroup (Set k)instance GetField map (Set k) (Map k ())instance SetField map (Set k) (Map k ())instance IsParties (Set Party)instance Ord k => Eq (Set k)instance Ord k => Ord (Set k)instance (Ord k, Show k) => Show (Set k)
Functions
empty
size
toList
fromList
toMap
Set into a Map.
fromMap
Set from a Map.
member
notMember
notMember k s is equivalent to not (member k s).
null
insert
filter
delete
singleton
union
intersection
difference
isSubsetOf
isSubsetOf a b returns true if a is a subset of b,
that is, if every element of a is in b.
isProperSubsetOf
isProperSubsetOf a b returns true if a is a proper subset of b.
That is, if a is a subset of b but not equal to b.
Orphan Typeclass Instances
-
instance Ord k => Eq (Set k) -
instance Ord k => Ord (Set k) -
instance (Ord k, Show k) => Show (Set k) -
instance IsParties (Set Party) -
instance Ord k => Semigroup (Set k) -
instance Ord k => Monoid (Set k) -
instance GetField map (Set k) (Map k ()) -
instance SetField map (Set k) (Map k ()) -
instance Foldable Set