Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Require Qualified Access documentation has an unclear definition. #319

@voronoipotato

Description

@voronoipotato

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions