Algebraic data types: Difference between revisions

Content added Content deleted
(→‎{{header|jq}}: simplify)
Line 1,121: Line 1,121:
# will be returned.
# will be returned.
# Output: null (failure to match) or a single JSON object giving the bindings if any.
# Output: null (failure to match) or a single JSON object giving the bindings if any.
# giving the bindings.
def bindings($x):
def bindings($x):
if $x == . then {} # by assumption, no bindings are necessary
if $x == . then {} # by assumption, no bindings are necessary