-
Notifications
You must be signed in to change notification settings - Fork 6k
Open
Labels
⌚ Not TriagedNot triagedNot triagedokr-freshnessOKR: Freshness of contentOKR: Freshness of contentokr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Description
The F# documentation about flexible-types.md is not up to date with the latest F# version.
The example states:
let iterate1 (f : unit -> seq<int>) =
for e in f() do printfn "%d" e
let iterate2 (f : unit -> #seq<int>) =
for e in f() do printfn "%d" e
// Passing a function that takes a list requires a cast.
iterate1 (fun () -> [1] :> seq<int>)
// Passing a function that takes a list to the version that specifies a
// flexible type as the return value is OK as is.
iterate2 (fun () -> [1])
But since F#6 and the RFC FS-1093, the cast is not required and the following line works:
iterate1 (fun () -> [1])
I can propose an update through a PR but I don't know if I should rather:
- Keep this example but emphasize that it's only relevant before F#6.
- Remove it and only keep the relevant seq.concat example.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 801ffa68-e3b2-71e7-03e4-1f5ab606e579
- Version Independent ID: a64255fa-049b-02a2-5261-11d675688033
- Content: Flexible Types - F#
- Content Source: docs/fsharp/language-reference/flexible-types.md
- Product: dotnet-fsharp
- GitHub Login: @cartermp
- Microsoft Alias: dotnetcontent
Metadata
Metadata
Assignees
Labels
⌚ Not TriagedNot triagedNot triagedokr-freshnessOKR: Freshness of contentOKR: Freshness of contentokr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.