DEV Community

Discussion on: Which Data Structure Should I Use? An Elixir Cheat Sheet

Collapse
 
rubberduck profile image
Christopher McClellan

Essentially, they’re not different. Lists are actually just tupples of tupples.

[1,2,3] is really {1, { 2, {3, nil}}}

Most, of not all FP languages represent lists this way, usually with a bit of syntactic sugar. This all comes from λ calculus, which is worthwhile to learn if you’re into FP.