Skip to content

Instantly share code, notes, and snippets.

View josephscottstevens's full-sized avatar

Joseph Scott Stevens josephscottstevens

View GitHub Profile
@josephscottstevens
josephscottstevens / destructuring.md
Last active February 7, 2018 21:07 — forked from yang-wei/destructuring.md
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 mirrors the construction. Compare to other languages, Elm comparatively supports less destructuring than other functional languages, but lets see what Elm does have!

Tuple

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