type 'a list = Nil | Cons of 'a * 'a list
type nat = Zero | Succ of nat
let rec
['a] (length : 'a list -> int) =
  ['a]
  fun (l : 'a list) ->
    match l[] with 0 -> Zero[] | Cons['a](_, xs) -> Succ[] (length['a] xs[])