Is there a reason you choose to put the type nested inside the module in the F# code? If you put the type in the namespace, it would do what you want, yes?

By on 10/8/2008 1:57 PM ()

Thank you, you are correct. I guess I've read phrases like "...if the module isn't explicitly named, it gets the name of its source file, with the first letter capitalized" (Foundations of F# p. 111) too often. I generally prefer explicit rather than implicit; I didn't expect that explicitly naming the module would change what was created. Going back and reading more carefully I see that on page 329 it follows up with "If you are defining types that will be used from other .NET languages, then you should place them inside a namespace rather than inside a module." Expert F# (p. 163) says "Declarations in files without a leading module or namespace declaration are placed in a module whose name is derived from the name of the implementation file." which does mention the exception to the rule for namespaces.

Rob

By on 10/10/2008 10:54 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper