Skip to content

Instantly share code, notes, and snippets.

Avatar
🐶

Robert Looby robertjlooby

🐶
View GitHub Profile
@yang-wei
yang-wei / destructuring.md
Last active Nov 22, 2020
Elm Destructuring (or Pattern Matching) cheatsheet
View destructuring.md

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"))
You can’t perform that action at this time.