disco> {1,2,3} intersect {2,4,7,3} {2, 3} disco> {1,2,3} intersection {2,4,7,3} Error: the expression {1, 2, 3} must have both a function type and also the incompatible type Set(a). https://disco-lang.readthedocs.io/en/latest/reference/notcon.html disco> {1,2,3} intersect {4,5} {} disco> {1,2,3} union {4,5} {1, 2, 3, 4, 5} disco> {1,2,3} union {2,3,5} {1, 2, 3, 5} disco> {1,2,3} - {2,3,5} Error: values of type Set(a1) cannot be subtracted. https://disco-lang.readthedocs.io/en/latest/reference/not-qual.html disco> {1,2,3} \ {2,3,5} {1} disco> {1,2,3} difference {2,3,5} Error: the expression {1, 2, 3} must have both a function type and also the incompatible type Set(a). https://disco-lang.readthedocs.io/en/latest/reference/notcon.html disco> {1,2,3} \ {2,3,5} {1} disco> :doc \ This expression has multiple possible types. Some examples: ~\~ : Bag(a) × Bag(a) → Bag(a) ~\~ : Set(a) × Set(a) → Set(a) precedence level 9, left associative Difference of two sets (or bags). https://disco-lang.readthedocs.io/en/latest/reference/set-ops.html disco> :doc union This expression has multiple possible types. Some examples: ~union~ : Bag(a) × Bag(a) → Bag(a) ~union~ : Set(a) × Set(a) → Set(a) Alternative syntax: ~∪~ precedence level 9, left associative Union of two sets (or bags). https://disco-lang.readthedocs.io/en/latest/reference/set-ops.html https://disco-lang.readthedocs.io/en/latest/reference/symbols.html disco> {x | x in {0..10}, y in {0 .. 10}, x < y} {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} disco> {(x,y) | x in {0..10}, y in {0 .. 10}, x < y} {(0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8), (0, 9), (0, 10), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (1, 9), (1, 10), (2, 3), (2, 4), (2, 5), (2, 6), (2, 7), (2, 8), (2, 9), (2, 10), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3, 10), (4, 5), (4, 6), (4, 7), (4, 8), (4, 9), (4, 10), (5, 6), (5, 7), (5, 8), (5, 9), (5, 10), (6, 7), (6, 8), (6, 9), (6, 10), (7, 8), (7, 9), (7, 10), (8, 9), (8, 10), (9, 10)}