// Record
type Ribbon = {Length:int}
// Class
type Line(len:int) =
member x.Length = len
type IHaveALength =
abstract Length:int
let inline getLength s = (^a: (member Length: _) s)
let ribbon = {Length=1}
let line = Line(3)
let someLengthImplementer =
{ new IHaveALength with
member __.Length = 5}
printfn "Our ribbon length is %i" (getLength ribbon)
printfn "Our Line length is %i" (getLength line)
printfn "Our Object expression length is %i" (getLength someLengthImplementer)