I'm relatively new to Ocaml and think I'm understanding the Unfold function correctly but I just can't see how to make a fibonacci sequence using it. Wouldn't we need to have a holder variable of the last two values so we could find the current one? All help is greatly appreciated. I'm adding the Unfold function below for reference.
let rec unfold (f: 'seed -> ('a * 'seed)) (stop : 'b -> bool) (b :'seed) : 'a list =
if stop b then []
else
let x, b' = f b in
x :: (unfold f stop b')