F# Recursive Modules/Namespaces code example has redundant/confusing members #41533
Labels
dotnet-fsharp/svc
help wanted
Good for community contributors to help [up-for-grabs]
in-pr
This issue will be closed (fixed) by an active pull request.
Type of issue
Typo
Description
The banana example for Recursive Modules in F# includes a type
Banana
with memberIsPeeled
which is alwaysfalse
; should presumably be removed or replaced with something likemember 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
The text was updated successfully, but these errors were encountered: