Skip to content

Object union with optional parameter #46

Discussion options

You must be logged in to vote

You could use a rule, with one body per (defined, undefined) x (defined, undefined) pair, e.g.

a = data.foo
b = input.bar

union_maybe = object.union(a, b)

union_maybe = a {
  not b
}

union_maybe = b {
  not a
}

👉 Playground

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@srenatus
Comment options

@anderseknert
Comment options

@Treiblesschorle
Comment options

@Treiblesschorle
Comment options

@anderseknert
Comment options

Answer selected by Treiblesschorle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
Converted from issue

This discussion was converted from issue #45 on October 29, 2021 18:09.