Beware that this function is not tail-recursive and will fail on big files. I would argue that the imperative style alternative is better:

let lines = ref [] in try
  while true do lines := input_line ic :: !lines; done; assert false
with End_of_file -> List.rev !lines