Skip to content

Gotchas

? has two meanings, _ has two meanings:

ContextSyntaxMeaning
Type annotationx:_Any/unknown type (wildcard)
Match expression?x{...}Match on value
Prefix ternary?=x 0 10 20Conditional expression
Match wildcard_:"default"Catch-all arm

_ means “don’t care” in both type annotations and match patterns. ? is always a conditional/match operator.

ilo
f x:_>t;?x{n v:"number";t v:"text";_:"other"}

Here _ after : is the any type, ? starts a match, and _: in the match is the wildcard arm.