Module v. Namespaces in F #
Ich habe eine Bibliothek in F # geschrieben, die von C # und F # verwendet wird. Diese Bibliothek definiert eine Klassefoo
im Modulbar
im Namespacerandom
:
#light
namespace random
module bar
type foo() = ...
Nun, wenn ich Typ konsumiererandom.foo.bar
C # Intellisense sieht es als Typbar
, in Typ verschachteltrandom.foo
.
Die Frage ist: Gibt es einen Vorteil für C #, extern konsumierbaren Code in Modulen anstatt in Namespaces zu definieren? Ich verstehe, dass Module ein guter Weg sind, Funktionen zu gruppieren, aber was ist mit Klassen?