Mono: is there System.Tuple?

I am trying to interop between C # and F # in Mono. Is there System.Tuple in Mono C #? I can see one in Mono.CSharp, but it doesn't look like the same type as F # (a '* b'). Thus,

(a) Is there a System.Tuple in Mono C # or (b) Is there a throw between tuples in Mono C # and F #?

+6
c # f # mono c # -to-f #
source share
3 answers

Yes Mono supports the Tuple type. I know this in 4.0, but I have seen comments about its availability since version 2.6.

+7
source share

It also depends on which version of the F # compiler you are using. If you compile your F # code using the F # compiler for .NET 2.0, it will use FSharp.Core.dll for .NET 2.0, which contains the declaration of the Tuple<..> classes. Then you can just reference FSharp.Core.dll to your C # project and you will find tuple there (this is in the System namespace to make it compatible with .NET 4)

I believe that the ZIP version from Microsoft and F # packages contains version 2.0. I'm not sure about the version of F # bundled with Mono 2.10, albeit in Debian.

+2
source share

I just tried

 System.Tuple<int, int> t2 = new System.Tuple<int, int>(1, 2); 

and it worked, on version 4.0

0
source share

All Articles