In C# I can do this:
public (bool result, string message) Hello()
{
...
return (true, "ok")
}
I am trying to figure out how to do it in F#.
I can do:
let Hello () =
(true, "ok")
but then, when I call Hello from C#, I have to get the elements as 'Item1' and 'Item2'.
Is there a way to name the field in the returned tuple?
I tried:
let hello () : (result, message ): bool * string =
and a few other variations, but I can't make that work.
The type returned is seen as a tuple object, in C#, whereas the pure C# example shown above doesn't seem to be using the tuple type.
I guess you can't name the items in a tuple object, but is there a way to return parameters like in C#?