cue-lang / docs-and-content

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

docs/howto/negate-a-disjunction #160

Open jpluscplusm opened 2 weeks ago

jpluscplusm commented 2 weeks ago

(From https://github.com/cue-lang/cue/discussions/3229#discussioncomment-9770106)

A new Commented CUE howto guide that demonstrates the current method for complementing/negating a disjunction:

#foo: "1" | "2"

foo: "3"
_foo_ok: true & ((foo & #foo) == _|_)

(Flesh this example out a little - don't just include it verbatim)

Include a link to cue-lang/cue#943 and not() in the related content section, clearly marked as a probable future simplification - ie without a direct example (so that it can't be erroneously copied before the feature is available)

hansbogert commented 1 week ago

Which page would you suggest to add this to? @jpluscplusm @myitcv

jpluscplusm commented 1 week ago

Which page would you suggest to add this to?

@hansbogert I've updated the initial comment to make it clear that it's a new page.

The issue title generally tracks the current path suggestion, but it isn't binding - the experience of writing a page often informs us about the most suitable title as we're doing it. We're not precious about rigidly sticking to the issue's suggestion!