Hi Kurt,
there are two different ways for defining module in a file. If you have equals at the end and use indentation then the module will be nested (in the module generated automatically for a file):

1
2
3
4
5
6
 
// "foo.fs"
module Bar = 
  let a = 1 // Foo.Bar.a
  module Bar2 = 
    let b = 1 // Foo.Bar.Bar.b

Another option is to write one top-level module declaration:

1
2
3
4
5
6
 
// "foo.fs"
module Internal
let a = 1 // Internal.a
moudle Foo = 
  let b = 2 // Internal.Foo.a

You can also use namespace instead of "module Internal" if you want to make things nicely accessible from C#, but namespaces cannot contain let-bindings (only modules & types).

Hope this helps!
T.

By on 11/8/2008 7:27 AM ()

Yes, thank you. Turns out the solutiuon was even easier than I though: just add

1
 module internal Foo 

to the top of my file and everything works as expected.

The point of the module declaration was to make it internal, so accessing from C# is not an issue here.

Thanks!

Kurt

By on 11/9/2008 4:02 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