tag:blogger.com,1999:blog-1305492153027236693.post2063208033310919851..comments2023-07-05T07:36:00.983-07:00Comments on Finger tree: Newton's method, in very few lines of HaskellPeter Scotthttp://www.blogger.com/profile/13332386909041593894noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-1305492153027236693.post-21536639648339356592015-05-09T08:03:35.267-07:002015-05-09T08:03:35.267-07:00In ghci you need to type
let next f f' x...In ghci you need to type <br /><br /> let next f f' xn = xn - ((f xn) / (f' xn))<br /><br />as in the above with the definition of iter<br />if you put <br /><br /> next f f' xn = xn - ((f xn) / (f' xn))<br /><br />into a file you can load it into ghcoGeorge Colpittshttps://www.blogger.com/profile/15526399395097722268noreply@blogger.comtag:blogger.com,1999:blog-1305492153027236693.post-73272917665144203202012-05-04T17:44:12.477-07:002012-05-04T17:44:12.477-07:00I'd love to try this but I cannot get either g...I'd love to try this but I cannot get either ghci nor the ghc system (inside Leksah) to accept it.<br /><br />Typing<br /> next f f' xn = xn - ((f xn) / (f' xn))<br /><br />into ghci just produces the message<br /><br />parse error on input '='<br /><br /><br />Trying the same definition inside a package produces the error message that '-' is not in scope.<br /><br />Sighdhjdhjhttps://www.blogger.com/profile/03869479405195636676noreply@blogger.com