Subscribe
Code:
let rec computeLength list = match list with | [] -> 0 | head::tail -> 1 + computeLength tail
Result:
> computeLength [1..10];; val it : int = 10 >