The problem is that HFile
is an F# type abbreviation. In F#, this means that the type HFile
is exactly the same thing as HPart list
. This means that wherever you use one on the F# side, you can also use the other.
Sadly, type abbreviations do not have any direct representation in the .NET IL, and so F# compiles them just as meta-data understood by the F# compiler. This means that the type HFile
does not really exist as a type from the .NET and C# view.
You could define it as a real type in F# - such as a simple discriminated union with a single constructor:
type HFile = HFile of HPart list
Or you could define a C#-style type alias in C# with using
. This requires full path and has to be in each of the files where you want to use HFile
:
using HFile = Microsoft.FSharp.FSharpList<YourFSharpNamespace.HPart>;