From the course: Introduction to F#
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Working with tuples - F# Tutorial
From the course: Introduction to F#
Working with tuples
- [Instructor] So far, we've covered a lot of value and decision-making syntax, but it's high time we started thinking about some logical ways to group our data together. The first data type we're going to look at in this section is tuples or tuples or however you like to say it in your part of the world. Tuples give us a lightweight solution for storing unnamed values in some kind of order. Now, the nice thing is that tuples aren't limited to the types they can hold, which makes them super useful when we're mixing and matching. I'm going to start a new module here and I'm going to call this DataGroups. Now, for example, we could store a starting point for an asset in a graphical interface with two coordinates or the first and last name of a user as a single tuple. So let's do that. Let's say let origin, and the way we create tuples are with parentheses. Now, the first value can be whatever we want, so we'll say zero, zero…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.