docs icon indicating copy to clipboard operation
docs copied to clipboard

F# Recursive Modules/Namespaces code example has redundant/confusing members

Open VisualMelon opened this issue 1 year ago • 0 comments

Type of issue

Typo

Description

The banana example for Recursive Modules in F# includes a type Banana with member IsPeeled which is always false; should presumably be removed or replaced with something like

member self.IsPeeled with get() = List.forall ((=) Peeled) self.Sides

It also looks like Peel should be mutating the object, e.g.

member self.Peel() = self.Sides <- BananaHelpers.peel self

The same apply to the example for Recursive Namespaces

(is this kind of feedback useful or just noise?)

Page URL

https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/modules

Content source URL

https://github.com/dotnet/docs/blob/main/docs/fsharp/language-reference/modules.md

Document Version Independent Id

6f88dfb3-c9f9-3715-5121-83a1f22223b8

Article author

@KathleenDollard

Metadata

  • ID: 379f00ab-ebc1-50eb-6779-3a22ec41a80d
  • Service: dotnet-fsharp

VisualMelon avatar Jun 23 '24 09:06 VisualMelon