dotnet / dotnet/docs

Add clarification about generalizable structures

Open
#24,984 0 comments 0 reactions 0 assignees View on GitHub
dotnet-fsharp/svc
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
15h 21m
Merged PRs (30d)
370

Description

I think this page is missing a clarification about generalizable structures, for instance why is it possible to define an option or list of generic values but not an array, a seq, map or dictionary of them ie: why `[id;id]` alone is a valid expression but not `[| id;id |]`.

It seems this dates back to F# 2 https://stackoverflow.com/a/2758456/446822

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 85b50526-a200-3774-0f70-d1079d783d9c
* Version Independent ID: e6f2ac27-6633-b9f9-6739-f48aef5595ad
* Content: [Automatic Generalization - F#](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/automatic-generalization)
* Content Source: [docs/fsharp/language-reference/generics/automatic-generalization.md](https://github.com/dotnet/docs/blob/main/docs/fsharp/language-reference/generics/automatic-generalization.md)
* Product: **dotnet-fsharp**
* GitHub Login: @cartermp
* Microsoft Alias: **phcart**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.