TSafeCTake items from the list until two successive items are equal and I return the second of them (or an item is not equal to itself, to handle  NaN without a 0 context. In this case, the first item of the A pair is returned) . If the list ends before a match is found, ' returns the last element of the list. convergeTo absEps relEps xs takes items from xs until two successive  items x and y are within either absEps or relEps * max (abs x) (abs  y)F of each other, in which case the second of the pair is returned, or K until an item is found that does not equal itself (which would typically L be a NaN), in which case the preceding item is returned. If the list ends D before a match is found, the last element of the list is returned. =For example, approximating the golden mean by applying Newton' s method to  find a root of  x^2 - x - 1:  phi :: Rational C phi = convergeTo 1e-100 0 (iterate (\x -> (x*x + 1) / (2*x-1)) 1) convergeBy f end xs looks through xs! for the first segment for which  f5 returns a value, and returns that value. Typically f would be  something like:   f (a:b:_)  | abs(a-b) <= eps  = Just (0.5 * (a + b))  f _ = Nothing %If no such segment is found, applies end to the last item in the list 9 and returns the result. If the list was empty, returns .  converge-0.1.0.1Math.Sequence.Convergeconverge convergeTo convergeBybase GHC.Float RealFloat Data.MaybeNothing