MicrosoftDocs / visualfsharpdocs

Frozen documentation repository for legacy MSDN Content for Visual F#
https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/visual-fsharp
Creative Commons Attribution 4.0 International
102 stars 111 forks source link

Require Qualified Access documentation has an unclear definition. #319

Open voronoipotato opened 5 years ago

voronoipotato commented 5 years ago

https://github.com/MicrosoftDocs/visualfsharpdocs/blob/live/docs/conceptual/core.requirequalifiedaccessattribute-class-[fsharp].md

Require Qualified Access uses the word in the definition and therefore provides no useful information.

https://stackoverflow.com/questions/44462268/what-is-requirequalifiedaccess-attribute I had to read stack overflow to figure out what this actually did.

From F# org

Adding the [<RequireQualifiedAccess>] attribute to a module indicates that the module may not be opened and that references to the elements of the module require explicit qualified access. For example, the Microsoft.FSharp.Collections.List module has this attribute.

This is useful when functions and values in the module have names that are likely to conflict with names in other modules and requiring qualified access can greatly increase the long-term maintainability and evolvability of a library: functions can be added to the module without breaking source compatibility.

example suggestion

The List module has this attribute. This means you're not allowed to open the module:

open List // compile error!

map id [1;2]

Instead, you must do this:

List.map id [1;2]