Skip to content

Instantly share code, notes, and snippets.

@curtnichols
Created October 15, 2017 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curtnichols/7100ccfe528bd5baad83c2ae0e0e1dc4 to your computer and use it in GitHub Desktop.
Save curtnichols/7100ccfe528bd5baad83c2ae0e0e1dc4 to your computer and use it in GitHub Desktop.
F# 4.1 VS 2017 15.4 System.Tuple fallout
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
namespace MyNamespace
module Update =
open System
open System.IO
type FileMapper = Func<string, Tuple<bool, Stream>>
type UpdateArguments = {
MapFilePath : FileMapper
}
val f : UpdateArguments -> unit
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