swift
swift copied to clipboard
[v3] Implement new Concept Exercise: map and flatMap
This issue describes how to implement the map concept exercise for the Swift 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 the following documents:
- The features of v3.
- Rationale for v3.
- What are concept exercises and how are they structured?
Please also watch the following video:
Goal
This concept exercise should convey a basic understanding of how to map in Swift.
Learning objectives
- What is
map
? - Sequence.map
- Dictionary.mapValues
- Optional.map
- What is
flatMap
? - Sequence.flatMap
- Optional.flatMap
Out of Scope
-
compactMap
-
filter
-
reduce
Concepts
-
map
-
flatMap
Prerequisites
-
generics
-
functions
-
higher-order-functions
-
closures
-
loops
Resources to refer to
Hints
After
- Sequence.map
- Sequence.compactMap
- Dictionary.map
- Dictionary.mapValues
- Dictionary.compactMap
- Dictionary.compactMapValues
- Optional.map
- Sequence.flatMap
- Optional.flatMap
Representer
TBD
Analyzer
TBD
Implementing
See the Swift track implementation guide for guidance.
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.
Combining map
and flatMap
into one exercise. Hopefully they don't need to be split.