repeat : ('a -> 'a) -> 'a -> 'a
An invocation repeat f x evaluates to repeat f (f x). When an invocation f y finally fails, for some y, then y is returned.
If an Interrupt exception is generated during an application of f, then repeat f x raises Interrupt.
repeat (fn x => x+1) 0