winhugs crashes on C stack overflow

Jan Reineke <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
Hi,

I am new to Haskell and functional programming in general, but I think 
that I have found a bug in Winhugs.

When I call "wurzel 5" in the "dos-mode"-hugs after loading the attached 
file I get "ERROR - C stack overflow", which is ok. Winhugs crashes in 
the same situation. In my German Win2k version it says "winhugs.exe hat 
Fehler verursacht und wird geschlossen. Starten Sie das Programm neu. 
Ein Fehlerprotokoll wird erstellt." which means something like 
"winhugs.exe has created an error and is going to be closed. Restart the 
program."

Is this a known issue?

Regards,
Jan Reineke
bug.hs (text/plain, 436 B)
absolutevalue :: (Double -> Double)
absolutevalue x = if (x < 0)
			then -x
			else x

newtoniteration :: (Double -> Double) -> (Double -> Double) -> Double -> Double
newtoniteration g gprime x = if (absolutevalue(g x/gprime x) < 0.01)
			then x
			else newtoniteration g gprime x-(g x/gprime x)

wurzel a = newtoniteration (\x -> (x*x-a)) (\x -> x*x) 2

f a x = x*x-a
fprime x = x*x
wurzelalternative a = newtoniteration (f a) fprime 2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.