3

I can see in the FSharp.Core source code, that their library functions often call Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count to create a zero initialized array. In order to do some performance comparisons with the core libraries I would like to do the same, but it is a private method that I can't seem to access. I can see the definition of the function is:

let inline zeroCreateUnchecked (count:int) =        
    (# "newarr !0" type ('T) count : 'T array #)

But that doesn't appear to be valid in a normal F# program either. Is there a way to make this work?

jackmott
  • 1,112
  • 8
  • 16
  • 5
    That's a secret/deprecated way of inlining IL in F# code, see here: http://stackoverflow.com/questions/15968054/what-is-the-syntax-seen-in-f-standard-library-implementation – scrwtp Aug 08 '16 at 20:22
  • Thank you, that link is perfect. – jackmott Aug 09 '16 at 02:14

0 Answers0