You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wow, the second one sounds naively very inefficient? how about Gen.unfold (fun i -> Some (i, succ i)) 0?
or maybe that was only for demonstation purposes. in any case by unfold also will wrap at max_int so it's really just a more convoluted version of the very first example.
i probably misunderstood -- i thought you are using length to construct a generator of increasing integers like the OP asked. but Gen.length returns a simple integer so i guess it was only there to demonstrate the result.
Possibly worth mentioning: how do you produce an “infinite” range of integers?
This is what I did: