Following this question I wonder how (or if) I can extend the general type of an F # array. I could do this:
type System.Array with member a.Last = a.GetValue(a.Length - 1)
but, as Thomas said, he is not general. Then I tried this, but it does not work:
type Microsoft.FSharp.Collections.Array with // Error: Array is not defined member a.Last = a.[a.Length - 1]
In F # scource, I found this namespace, but it doesn't work either:
type Microsoft.FSharp.Primitives.Basics.Array with // Error: Array is not defined member a.Last = a.[a.Length - 1]
source share