Skip to content

Commit 09e7c8b

Browse files
committed
docs/FSharpStyleGuide: note about SCG.List [no ci]
1 parent ca2561a commit 09e7c8b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/FSharpStyleGuide.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ instead of `option` and `list`). The only exception to this rule is: primitive
1414
types (where we prefer `string` and `int` over `String` and `Int32` unless we're
1515
using a static method of them; and `array` over `Array` because they are actually
1616
different things).
17+
NOTE: To be able to comply with the rule above, it is important that you do NOT
18+
`open System.Collections.Generics`, otherwise the name `List` will be the mutable
19+
list instead of the F#'s immutable one. If you really really need to access the
20+
former, use `type ScgList<'T> = System.Collections.Generics.List<'T>` instead.
1721
* To not confuse array types with lists, we prefer to use `List.Empty` over `[]`
1822
(where it's possible; e.g. in match cases it's not possible), and `array<Foo>`
1923
over `Foo []`.

0 commit comments

Comments
 (0)