The "ModuleSuffix" attribute means the compiled name of the F#-module is "STNModule". This allows a module and a concrete type in the same namesapce to have the identical names as far as F# is concerned. Try removing the attribute?

don

By on 1/17/2007 9:38 AM ()

The attribute is a remain of me trying to imitate Complex.fs/fsi. With or without the attribute, the methods are not visible, either in STN or STNModule.

By on 1/17/2007 10:13 AM ()

Try just using "module STN" at the top of each file, e.g.

1
2
3
4
5
6
 

   module STN

   let f x = x + 1

and for the signature:

1
2
3
4
5
6
 

   module STN

   val f : int -> int

Have you tried using ILDASM, the VS Object Browser or some other reflection tool to look at the contents of your generated DLL?

To explain further, fragments of F# files are in three forms:

1. Headed by a namespace qualifier

1
2
3
4
5
6
 

   namespace X.Y.Z   // subsequent contents are placed in the given namespace

   <contents>

2. Headed by a module qualifier

1
2
3
4
5
6
 

   module X.Y.Z    // subsequent contents are placed in the given module

   <contents>

3. Implicitly qualified by a module name derived from the name of the file

1
2
3
4
 

   <contents>

Your files are in the third category, since you don't start with a namespace or module qualification (you might think you do, but instead you start with a module declaration, because you used "= begin ... end").

If you look at the results in a reflection browser then what this means should be clear. You can probably access your existing constructs through a C# path such as "File1.STN".

cheers

don

By on 1/17/2007 10:25 AM ()

Sorry, I wasn't being entirely accurate.

Both files are headed with by a namespace qualifier.

Thus, the .fsi for instance is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
namespace Edu.DTU.Planner


open Microsoft.FSharp.Collections.LazyList
open Edu.DTU.Planner


module STN : begin
    type name = string
    type parameter = Constant of string
                   | Variable of string
    type atom = name * parameter list
    type literal = Pos of atom
                 | Neg of atom
    type state = literal list
    type effect = Env.environment * Store.store -> state -> state
    type task = name * Store.address list
    type condition = state * Env.environment * Store.store -> LazyList<Env.environment * Store.store>
    type resolver = Resolver of (state * Store.store * task * resolver list * int -> LazyList<state * Store.store * (string * parameter list) list>)


    val mkMethod    : (name * string list) * condition list * atom list -> resolver
    val mkOperator    : atom * (name * string list) * condition list * effect list -> resolver
                        
    val mkCondition    : literal -> ((state * Env.environment * Store.store) -> LazyList<Env.environment * Store.store>)
    val notEquals    : (parameter * parameter) -> ((state * Env.environment * Store.store) -> LazyList<Env.environment * Store.store>)
    val mkUpdate    : literal -> effect
    val mkTask        : string -> (parameter list -> atom)
    val solve        : (state * atom list * resolver list * int * int * int) -> atom list
    val dump_plan   : (atom list) -> unit 
end
By on 1/17/2007 11:03 AM ()

Ok, I see :-) Could you post both your F# code (or a cut down repro of it) and your C# code, and the command-lines your using to build both? Or send it to fsbugs AT microsoft DOT com.

Thanks

don

By on 1/17/2007 11:07 AM ()

My pleasure. But, before I do: I simply build using Visual Studio and add a reference in the project to the dll. I've added a function to the signature just to see if i could reference something that doesn't use types from the namespace.

1
val increment : int -> int
1
2
3
let increment x = x + 1

IntelliSense can find STN.increment and the Object browser correctly shows it (the rest are still missing). Does that mean anything?

By on 1/17/2007 11:50 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