Documentation
API
MixedSet

# MixedSet

The MixedSet module offers functionality for creating mixed sets, which are sets that can contain both discrete and continuous values. Discrete values are represented as points, while continuous values are represented as ranges. Mixed sets are particularly useful for describing the support of mixed probability distributions.

The majority of set functions in the MixedSet module are designed to mirror the upcomming set functions (opens in a new tab) in Javascript.

The primary purpose of mixed sets in Squiggle is to facilitate scoring. For instance, by utilizing mixed sets, you can easily determine if one distribution covers the support of another distribution. If it doesn't, it may be prone to receiving a score of negative infinity.

Currently, there is no dedicated MixedSet object type. Instead, mixed sets are implemented as dictionaries, where discrete values are stored as points and continuous values are stored as segments.

### difference

Signatures
MixedSet.difference({points: List(Number), segments: List([Number, Number])}, {points: List(Number), segments: List([Number, Number])}) => {points: List(Number), segments: List([Number, Number])}

### intersection

Signatures
MixedSet.intersection({points: List(Number), segments: List([Number, Number])}, {points: List(Number), segments: List([Number, Number])}) => {points: List(Number), segments: List([Number, Number])}

### union

Signatures
MixedSet.union({points: List(Number), segments: List([Number, Number])}, {points: List(Number), segments: List([Number, Number])}) => {points: List(Number), segments: List([Number, Number])}

### isSubsetOf

Signatures
MixedSet.isSubsetOf({points: List(Number), segments: List([Number, Number])}, {points: List(Number), segments: List([Number, Number])}) => Bool

### isSupersetOf

Signatures
MixedSet.isSupersetOf({points: List(Number), segments: List([Number, Number])}, {points: List(Number), segments: List([Number, Number])}) => Bool

### isEqual

Signatures
MixedSet.isEqual({points: List(Number), segments: List([Number, Number])}, {points: List(Number), segments: List([Number, Number])}) => Bool

### isEmpty

Signatures
MixedSet.isEmpty({points: List(Number), segments: List([Number, Number])}) => Bool

### min

Returns the minimum value in the set

Signatures
MixedSet.min({points: List(Number), segments: List([Number, Number])}) => Number

### max

Returns the maximum value in the set

Signatures
MixedSet.max({points: List(Number), segments: List([Number, Number])}) => Number