fork download
  1. type 'a t = Empty | Cons of 'a * 'a t
  2.  
  3. let length xs =
  4. let rec loop n ys =
  5. match ys with
  6. | Empty -> n
  7. | Cons (y, ys') -> loop (n+1) ys'
  8. in
  9. loop 0 xs
  10.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty