Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (Gleam) expand_more
Gleam / Types & Data

Pattern matching

Learn Pattern matching in Gleam with a focused explanation, a topic-specific example, and a mastery check.

12 min read • Beginner
gleam-011.gleam
gleam
pub fn first(xs) { case xs { [x, .._] -> Ok(x) [] -> Error("empty") } }
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content