Hacker News new | ask | show | jobs
by candl 4067 days ago
There is a lot more details on the MSDN blogs:

http://blogs.msdn.com/b/dotnet/archive/2015/04/29/rounding-o...

http://blogs.msdn.com/b/fsharpteam/archive/2014/11/12/announ...

For me the most welcome change is the vastly improved consistency of the Seq/List/Array APIs.

1 comments

"The .NET framework supports up to 32-dimensional arrays, but in the past F# only supported use of up to rank-4 arrays. Not only were arrays of rank 5+ not possible to create and manipulate from F# code, the compiler could sometimes fail to consume external libraries which relied on high-dimensional arrays.

This is now fixed. Although there is not yet support for creating and manipulating high-rank arrays, the compiler will now properly handle these types up to rank-32."

Has anyone here ever used "high-rank" arrays? The deepest I've ever gone was 4 for a lookup table, but I'm wondering what the use-case is for super high depth arrays as well as why there is a limit at all.

I contributed the fix for the high-ranking array support.

The main reason for the fix was because F# pre-4.0 can't reference overloaded methods where one or more of the overloads has one or more parameters which is an array of rank 5 or more. I had a 3rd party DLL I wanted to reference, where a class had generic overloads for all of the array ranks, e.g.,:

    MyClass.Foo(T[])
    MyClass.Foo(T[,])
    ...
    MyClass.Foo(T[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,])
Even though I was only trying to use MyClass.Foo(T[]), the F# compiler's overload resolution failed due to the presence of the higher-ranked array types.

I'm not planning to use such arrays any time soon, but I wanted to make sure that if other code was using these arrays I could reference it from F#.