
Henning Thielemann wrote:
On Fri, 23 Mar 2007, Neil Mitchell wrote:
my_sqrt t = last (take 20 (iterate (\n -> n/2 + t/(2 * n)) t))
http://darcs.haskell.org/htam/src/Numerics/ZeroFinder/Newton.hs
with inverse t (\x->(x^2,2*x)) t
I don't know how to add it into the one liner though - although I suspect someone here will :)
http://darcs.haskell.org/htam/src/Numerics/Sequence.hs
limitDifference :: (Real a) => a -> [a] -> a limitDifference tol xs = case dropWhile ((> tol) . abs . uncurry (-)) $ zip xs (tail xs) of ((_,x):_) -> x [] -> error "limitDifference: Finite sequence, but no element satisfies abort criterion." _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
as a fellow haskell newbie, i would like to take this opportunity to encourage library authors to submit their material to the haskell hackage. the haskell infrastructure is rather big, complex and "organic". (see e.g. http://darcs.haskell.org/tmp/ for an example) it was only by chance that i ran across the (rather amazing) htam library a week ago or so. i hope you agree that these things should not be left to chance ;-) hoogle, google and hackage tend to be the first places where i look for fresh meat. i suppose this also applies to other haskell freshmen. cheers, v.