Skip to content

Instantly share code, notes, and snippets.

View shahnhogan's full-sized avatar

Shahn Hogan shahnhogan

View GitHub Profile
@yang-wei
yang-wei / destructuring.md
Last active November 3, 2024 16:23
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))