Advertisement
Guest User

test

a guest
May 5th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. type mytype = Trip.trip list;;
  2.  
  3. let read_lines name : Trip.trip list =
  4. let ic = open_in name in
  5. let try_read () =
  6. try Some (matcher (read_line ())) with End_of_file -> None in
  7. let rec loop acc = match try_read () with
  8. | Some s -> loop (s :: acc)
  9. | None -> close_in ic; List.rev acc in
  10. loop []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement