Implement new Concept Exercise: tuples
This issue describes how to implement the tuples concept exercise for the F# track.
Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Please also watch the following video:
Goal
The goal of this exercise is to teach the student the basics of the Concept of Tuples in F#.
Learning objectives
- Know what a tuple is.
- Know when tuples should be used.
- Know how to define tuples of different sizes.
- Know that tuples have structural equality.
- Know how to deconstruct tuples (including as parameters).
- Know how to pattern match on tuples.
- Know that tuples are immutable.
Out of scope
structtuples.- Memory and performance characteristics.
Concepts
The Concepts this exercise unlocks are:
tuples: know what a tuple is; know when tuples should be used; know how to define tuples of different sizes; know that tuples have structural equality; know how to deconstruct tuples; know how to pattern match on tuples; know that tuples are immutable.
Prerequisites
This exercise's prerequisites Concepts are:
pattern-matching: know how to do pattern matching.basics: know how to define bindings and functions.
Any data types used in this exercise (e.g. strings) should also be added as prerequisites.
Resources to refer to
Hints
- Tuples: introduction to tuples.
After
- Tuples: introduction to tuples.
- Tuples introduction: another tuple introduction, but digs a bit deeper.
Representer
This exercise does not require any specific representation logic to be added to the representer.
Analyzer
This exercise does not require any specific logic to be added to the analyzer.
Implementing
To implement this exercise, please follow these instructions.
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.
I'd like to try. Do we need to migrate from previous, or write from scratch?
You can try to port an existing exercise, which is often a bit easier to do. I've found three candidates:
- C#/phone-number-analysis: this exercise doesn't have the student compare tuples, so I feel that this would at least need to be added. It's also a bit thin in content.
- Elixir/kitchen-calculator: combines records and tuples. We also have a records exercise, so this would probably need adapting to focus on tuples.
- Python/tisbury-treasure-hunt: seems to be focused on tuples, so that's great.
Of these three, I think I like the Python one best. Maybe you could try porting that one?
Oh and thanks for wanting to work on this!