4 ms·
The other nice thing about factoring code like this: it often turns up patterns that match existing library functions. For instance, most of sqrtGuesses can be
by JoshTriplett 13y ago
The other nice thing about factoring code like this: it often turns up patterns that match existing library functions. For instance, most of sqrtGuesses can be replaced with the "iterate" function:
sqrtGuesses n = iterate (\x -> (0.5 * (x + n/x))) 1.0