I recently noticed that I quite often write functions which just iterates another function f
until it reaches a fixed point (such that f x == x
)
I thought this is a pretty general concept, so I think there might be a built in.
So I was wondering whether there is a built in for this, or something more general?
So I'm basically looking for this:
fixedpoint f x= head . dropWhile(\y->y /= f y) $ iterate f x
I just had trouble googling this, because I only found references to the fix
function whenever my search term contained fixed point
or something similar.