Newton-Raphson Method in Haskell