I'm sure I'm missing something, but where is the bool?
let iter t ~f = let rec loop !t = function |Some element -> ~f element.value; loop element.next |None -> ()
Expecting unit, have bool in type of iter:
('a element option -> unit) ref -> f:('a -> 'b) -> bool
Also compared to this version
let iter t ~f = let rec loop = function |Some element -> f element.value; loop element.next |None -> () in loop !t
Why 'a element option ref
vs. ('a element option -> unit)
?