Skip to content

data dependency possibilities with CUE #2879

Answered by jpluscplusm
vgeordy asked this question in Q&A
Discussion options

You must be logged in to vote

There are a few different ways to achieve this! Here's a playground link that combines 2 methods in 1 evaluation: https://alpha.cuelang.org/play/?id=tIne24zL-Lv#w=function&i=cue&f=eval&o=cue. The method you use (and there are definitely more methods!) is down to your preference.

Notice that on line 23, both #Sample1 and #Sample2 are unified, which is only possible because they can unify successfully, and they both represent the same constraints. You shouldn't use both methods simultaneously - I'm just demonstrating that both achieve the same outcome.

The playground isn't showing the errors with Bob's failing example. I believe this is a CUE Playground artifact - if you were to comment out…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@vgeordy
Comment options

@jpluscplusm
Comment options

@vgeordy
Comment options

Answer selected by vgeordy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants