how to get the value of the last element of a List? I\'ve noted that List.hd (or .Head) return an item, while List.tl (or .Tail) returns a List.
Is rev the List and
A more concise version based on Mitch's answer:
let lastItem = myList |> List.rev |> List.head
The myList list is sent to List.rev function. The result is then processed by List.head
myList
List.rev
List.head