let rec list_n_first n = function
    [] -> []
  | h :: q ->
      if n > 0 then
        h :: (list_n_first (n-1) q)
      else
        []