type 'a t = Empty | Cons of 'a * 'a t
let length xs =
let rec loop n ys =
match ys with
| Empty -> n
| Cons (y, ys') -> loop (n+1) ys'
in
loop 0 xs
ICB0eXBlICdhIHQgPSBFbXB0eSB8IENvbnMgb2YgJ2EgKiAnYSB0CgogIGxldCBsZW5ndGggeHMgPQogICAgbGV0IHJlYyBsb29wIG4geXMgPQogICAgICBtYXRjaCB5cyB3aXRoCiAgICAgICAgfCBFbXB0eSAtPiBuCiAgICAgICAgfCBDb25zICh5LCB5cycpIC0+IGxvb3AgKG4rMSkgeXMnCiAgICBpbgogICAgbG9vcCAwIHhzCg==