What's the problem with the code below? I'am struggling a lot with knowing when to use ';' or ';;' or use begin end in OCaml. Here i need to read some edges and insert into graph but i need to link this with rest of program so that it can use g(a graph) with all the edges. When i do this it says Error: Syntax error
let i = ref n in
while !i > 0 do
(
let pair = read_edge Scanning.stdin in
let g = insert_edge (fst pair) (snd pair) g in
i := !i - 1
)
done in (* giving error in this line *)
let rec do_stuff l =
match l with
| [] -> ()
| h::t -> print_int h;do_stuff t in
( * more functions)