-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Description
ApiDocMemberDetails is currently described as a single case DUs.
FSharp.Formatting/src/FSharp.Formatting.ApiDocs/GenerateModel.fs
Lines 292 to 301 in 2efb355
| type ApiDocMemberDetails = | |
| | ApiDocMemberDetails of | |
| usageHtml: ApiDocHtml * | |
| paramTypes: (Choice<FSharpParameter, FSharpField> * string * ApiDocHtml) list * | |
| returnType: (FSharpType * ApiDocHtml) option * | |
| modifiers: string list * | |
| typars: string list * | |
| extendedType: (FSharpEntity * ApiDocHtml) option * | |
| location: string option * | |
| compiledName: string option |
This makes accessing the information in it not easy because tuples doesn't expose a named property to accessing the different values. The user is responsible, for manually naming each variables.
let (ApiDocMemberDetails(usageHtml,
paramTypes,
returnType,
modifiers,
typars,
baseType,
location,
compiledName)) =
entity.DetailsI propose to change this type to a record which will exposed named properties making it easier for consumer to use the type.
type ApiDocMemberDetails =
{
UsageHtml: ApiDocHtml
ParamTypes: (Choice<FSharpParameter, FSharpField> * string * ApiDocHtml) list
ReturnType: (FSharpType * ApiDocHtml) option
Modifiers: string list
Typars: string list
ExtendedType: (FSharpEntity * ApiDocHtml) option
Location: string option
CompiledName: string option
}
// Usage
let details : ApiDocMemberDetails = // ...
details.ParamTypes
// etc.Metadata
Metadata
Assignees
Labels
No labels