Skip to content

Instantly share code, notes, and snippets.

Avatar

Joseph Scott Stevens josephscottstevens

  • Augusta, GA
View GitHub Profile
@josephscottstevens
josephscottstevens / destructuring.md
Last active Feb 7, 2018 — forked from yang-wei/destructuring.md
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 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"))
You can’t perform that action at this time.