|
1 | 1 | # Docs
|
2 | 2 |
|
3 |
| -Each track must have a `docs` directory with the following (required) files: |
| 3 | +Each track must have a `docs` directory with the following files: |
4 | 4 |
|
5 | 5 | ```
|
6 | 6 | docs
|
7 |
| -├── ABOUT.md |
8 |
| -├── INSTALLATION.md |
9 |
| -├── LEARNING.md |
10 |
| -├── SNIPPET.txt |
11 |
| -├── RESOURCES.md |
12 |
| -└── TESTS.md |
| 7 | +├── ABOUT.md (required) |
| 8 | +├── INSTALLATION.md (required) |
| 9 | +├── LEARNING.md (required) |
| 10 | +├── SNIPPET.txt (required) |
| 11 | +├── REPRESENTER_NORMALIZATIONS.md (optional) |
| 12 | +├── RESOURCES.md (required) |
| 13 | +└── TESTS.md (required) |
13 | 14 | ```
|
14 | 15 |
|
15 | 16 | ---
|
@@ -132,6 +133,119 @@ let hello = "Hello, World!"
|
132 | 133 |
|
133 | 134 | Check [this page](https://exercism.org/tracks/fsharp) to see what this looks like when rendered (note: you must not have already joined the track).
|
134 | 135 |
|
| 136 | +## File: `REPRESENTER_NORMALIZATIONS.md` |
| 137 | + |
| 138 | +**Purpose:** List the normalizations the representer applies to a solution. |
| 139 | + |
| 140 | +**Displayed on:** |
| 141 | + |
| 142 | +(not displayed) |
| 143 | + |
| 144 | +### Example |
| 145 | + |
| 146 | +````markdown |
| 147 | +# Representer normalizations |
| 148 | + |
| 149 | +The representer applies the following normalizations: |
| 150 | + |
| 151 | +## Remove comments |
| 152 | + |
| 153 | +All comments are removed. |
| 154 | + |
| 155 | +### Before |
| 156 | + |
| 157 | +```fsharp |
| 158 | +module Fake |
| 159 | +(* Block comment |
| 160 | + on multiple lines *) |
| 161 | +let message = "Hi" (* Block comment after code *) |
| 162 | +// Double-slash comment on single line |
| 163 | +let reply = "Yo" // Double-slash comment after code |
| 164 | +/// <summary>This function adds two numbers</summary> |
| 165 | +/// <param name="x">The first number</param> |
| 166 | +/// <param name="y">The second number</param> |
| 167 | +/// <returns>The first number added to the second number</param> |
| 168 | +let add x y = x + y |
| 169 | +``` |
| 170 | + |
| 171 | +### After |
| 172 | + |
| 173 | +```fsharp |
| 174 | +module Fake |
| 175 | +let message = "Hi" |
| 176 | +let reply = "Yo" |
| 177 | +let add x y = x + y |
| 178 | +``` |
| 179 | + |
| 180 | +## Remove import declarations |
| 181 | + |
| 182 | +All import declarations are removed. |
| 183 | + |
| 184 | +### Before |
| 185 | + |
| 186 | +```fsharp |
| 187 | +module Fake |
| 188 | +open System |
| 189 | +open System.IO |
| 190 | +let message = "Hi" |
| 191 | +``` |
| 192 | + |
| 193 | +### After |
| 194 | + |
| 195 | +```fsharp |
| 196 | +module Fake |
| 197 | +let message = "Hi" |
| 198 | +``` |
| 199 | + |
| 200 | +## Format code |
| 201 | + |
| 202 | +The code is formatted using the [fantomas library](https://fsprojects.github.io/fantomas/docs/index.html). |
| 203 | +This formats the code according to the F# style guide. |
| 204 | +The full list of transformations that are applied by fantomas can be found [here](https://fsprojects.github.io/fantomas/docs/end-users/Configuration.html). |
| 205 | + |
| 206 | +### Before |
| 207 | + |
| 208 | +```fsharp |
| 209 | +module Fake |
| 210 | +let add ( birthDate : DateTime) = |
| 211 | + birthDate.Add ( 2.0) |
| 212 | +type Volume = |
| 213 | +| Liter of float |
| 214 | +| USPint of float |
| 215 | +| ImperialPint of float |
| 216 | +``` |
| 217 | + |
| 218 | +### After |
| 219 | + |
| 220 | +```fsharp |
| 221 | +module Fake |
| 222 | +let add (birthDate: DateTime) = |
| 223 | + birthDate.Add(2.0) |
| 224 | +type Volume = |
| 225 | + | Liter of float |
| 226 | + | USPint of float |
| 227 | + | ImperialPint of float |
| 228 | +``` |
| 229 | + |
| 230 | +## Normalize identifiers |
| 231 | + |
| 232 | +Identifiers are normalized to a placeholder value. |
| 233 | + |
| 234 | +### Before |
| 235 | + |
| 236 | +```fsharp |
| 237 | +module Fake |
| 238 | +let foo x = x + 1 |
| 239 | +``` |
| 240 | + |
| 241 | +### After |
| 242 | + |
| 243 | +```fsharp |
| 244 | +module PLACEHOLDER_1 |
| 245 | +let PLACEHOLDER_3 PLACEHOLDER_2 = PLACEHOLDER_2 + 1 |
| 246 | +``` |
| 247 | +```` |
| 248 | + |
135 | 249 | ## File: `RESOURCES.md`
|
136 | 250 |
|
137 | 251 | **Purpose:** Links to useful resources.
|
|
0 commit comments