cue-lang / docs-and-content

A place to discuss, plan, and track documentation on cuelang.org
6 stars 1 forks source link

howto: treat a list like a set #56

Open jpluscplusm opened 9 months ago

jpluscplusm commented 9 months ago

Given

[{a:1,b:2,c:"foo"},{a:1:b:2,c:"bar"}]

... how can we assert that the synthetic list formed from just the a and b fields is unique? I.e. with an error if presented with this example.

In other words (after associative lists land) if we treat that synthetic list as a set, is there a unification failure across the critical fields?

jpluscplusm commented 9 months ago

The unused content at https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1174648/28 (patchset 28) could be re-used here.