The function with type 'a Stream.t -> unit
is Stream.iter
. Basically the compiler is telling you that Stream.iter
doesn't have any named parameters. You're trying to pass it a parameter named f
, so that's the problem.
The solution would be to delete ~f:
. (I haven't tested because I don't have your code.)