Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
new System.IO.MemoryStream // Now without parentheses! #753
new with partial application
I propose we support new with partial application.
The existing way of approaching this problem in F# is having that ugly closure AND parentheses surrounding it.
x |> System.Convert.FromBase64String |> (fun x -> new System.IO.MemoryStream(x))
The following should all be supported:
x |> System.Convert.FromBase64String |> (fun x -> new System.IO.MemoryStream x)
x |> System.Convert.FromBase64String |> (new System.IO.MemoryStream)
x |> System.Convert.FromBase64String |> new System.IO.MemoryStream
x |> (System.Convert.FromBase64String >> new System.IO.MemoryStream)
Pros and Cons
The advantages of making this adjustment to F# are
The disadvantage of making this adjustment to F# is the implementation effort required.
Estimated cost (XS, S, M, L, XL, XXL): S
Related suggestions: (put links to related suggestions here)
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
It doesn't look like a "partial application" because the constructor is tuple-based.
type Foo() = new Foo(x: int) let a = new Foo let b = new Foo()
in the example,
Conciseness is a minor issue here.
A larger issue is how to keep track of disposables.
(Related work: color dotnet/fsharp#4618)