F# code organization: types & modules
问题 How do you decide between writing a function inside a module or as a static member of some type? For example, in the source code of F#, there are lots of types that are defined along with a equally named module, as follows: type MyType = // ... [<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>] module MyType = // ... Why don't you simply define the operations as static members of type MyType? 回答1: Here are some notes about the technical distinctions. Modules can be