3

With regard to exposing friendly types for multiple consumers (F#, C#, VB, etc..) Should I apply Eric Lippert's rule of not naming types the same as namespaces to modules?

Community
  • 1
  • 1
Maslow
  • 18,464
  • 20
  • 106
  • 193
  • I suppose I should have specified are there pros/cons to naming a module the same as the enclosing namespace? However, I'd also be interested in hearing about modules the same name as enclosing types if that is different than namespaces owning types – Maslow Sep 24 '14 at 13:44
  • 1
    I would continue to apply the advice with modules.. if they are actually compiled as .NET assembly modules that is. Having not written a lot of code that deals with more than one .NET module in an assembly (C# only has one module per assembly ..) I can't be sure.. but I would guess that you may have similar issues. – Simon Whitehead Sep 24 '14 at 14:14
  • @SimonWhitehead F# modules are compiled as (sealed abstract) classes, not CLR modules. The compiled CLR class name has "Module" appended. So, for example, the Seq module in FSharp.Core.dll has the fully-qualified name `Microsoft.FSharp.Collections.SeqModule` – phoog Sep 25 '14 at 16:48

1 Answers1

3

There is a good document describing F# component design guidelines. There is a section there about F# components interfacing with other .NET languages containing naming conventions etc.

http://fsharp.org/specs/component-design-guidelines/

Petr
  • 4,280
  • 1
  • 19
  • 15