12 lines
277 B
OCaml
12 lines
277 B
OCaml
|
let read_file name =
|
||
|
let ic = open_in name in
|
||
|
let try_read () =
|
||
|
try Some (input_line ic)
|
||
|
with End_of_file -> None in
|
||
|
let rec aux acc =
|
||
|
match try_read () with
|
||
|
| Some s -> aux (s::acc)
|
||
|
| None -> close_in ic; acc in
|
||
|
aux []
|
||
|
|