I have a discriminated union that I want to use as an argument for a function I'm exposing in a signature file. Currently I have the code defined as such:
Signature.fsi:
type Union =
| Part of string
| Part2 of int
val Func: Union -> unit
With Func being defined in a seperate fs file.
The problem is when I do this the fs file can't pick up the Union definition so code that creates a Part or Part2 value fails. Unless I define the union again in the fs file that is using the union.
So for example:
Signature.fs:
type Union =
| Part of string
| Part2 of int
let Func input:Union =
ignore
OtherFile.fs
type Union =
| Part of string
| Part2 of int
let DoSomething =
Func(Part("Test"))
Without redefining Union every time this fails. Have I missed something obvious? I'm still fairly green when it comes to F#.