Created
October 15, 2017 20:18
-
-
Save curtnichols/7100ccfe528bd5baad83c2ae0e0e1dc4 to your computer and use it in GitHub Desktop.
F# 4.1 VS 2017 15.4 System.Tuple fallout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyNamespace | |
module Update = | |
open System | |
open System.IO | |
type FileMapper = Func<string, Tuple<bool, Stream>> | |
type UpdateArguments = { | |
MapFilePath : FileMapper | |
} | |
[<CompiledName("F")>] | |
let f (args : UpdateArguments) = | |
let success, file = let result = args.MapFilePath.Invoke("name") | |
result.Item1, result.Item2 | |
printfn "%A %A" success file.CanRead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyNamespace | |
module Update = | |
open System | |
open System.IO | |
type FileMapper = Func<string, Tuple<bool, Stream>> | |
type UpdateArguments = { | |
MapFilePath : FileMapper | |
} | |
val f : UpdateArguments -> unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using MyNamespace; | |
namespace ReproTuple2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Func<string, Tuple<bool, Stream>> callback = name => Tuple.Create(true, (Stream)new MemoryStream()); | |
Update.F(new Update.UpdateArguments(callback)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment