Po this question Zastanawiam się, jak (lub jeśli) mogę rozszerzyć ogólne F # Array Type. mogę to zrobić:F # jak rozszerzyć ogólny typ tablicy?
type System.Array with
member a.Last = a.GetValue(a.Length - 1)
ale jak wspomniano Tomas to nie jest nazwą rodzajową. Następny próbowałem tego, ale to nie działa:
type Microsoft.FSharp.Collections.Array with // Error: Array is not defined
member a.Last = a.[a.Length - 1]
w F # scource Znalazłem nazw, ale to nie działa albo:
type Microsoft.FSharp.Primitives.Basics.Array with // Error: Array is not defined
member a.Last = a.[a.Length - 1]