let inline getLength s = (^a: (member Length: _) s) //usage: getLength "Hello World" // or "Hello World" |> getLength // returns 11