From trac at galois.com Fri Feb 8 07:52:47 2008 From: trac at galois.com (Hugs) Date: Fri Feb 8 07:51:39 2008 Subject: [Hugs] #82: Not a Number Message-ID: <045.57cdc7b38a6b8b953b430ae0aea14e90@localhost> #82: Not a Number --------------------+------------------------------------------------------- Reporter: guest | Owner: nobody Type: defect | Status: new Priority: minor | Milestone: Component: hugs | Version: 200609 Keywords: | --------------------+------------------------------------------------------- My Program was: {{{ cosineSeries :: Float -> [Float] cosineSeries x = scanl (cosineSerPartSum x) 1 [1..] cosineSerPartSum :: Float -> Float -> Integer -> Float cosineSerPartSum x prev i = prev + ((-1) ^ i) * (x ^ (2 * i)) / fromIntegral (fak (2 * i)) fak :: Integer -> Integer fak n = product [1..n] }}} My Study Mate is running WinHugs and when he types "cosineSeries 2" he gets many Numbers.... I am Running hugs98 on a Mac. Im getting something like this: Main> cosineSeries 2 [1.0,-1.0,-0.3333333,-0.4222222,-0.415873,-0.4161552,-0.4161466,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,-0.4161468,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,?nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,^C{Interrupted!} -- Ticket URL: Hugs Hugs 98, an interpreter for Haskell From trac at galois.com Fri Feb 8 08:10:53 2008 From: trac at galois.com (Hugs) Date: Fri Feb 8 08:09:45 2008 Subject: [Hugs] #82: Not a Number In-Reply-To: <045.57cdc7b38a6b8b953b430ae0aea14e90@localhost> References: <045.57cdc7b38a6b8b953b430ae0aea14e90@localhost> Message-ID: <054.fe9d07eefe5ea2ed39611b83b991523f@localhost> #82: Not a Number ----------------------+----------------------------------------------------- Reporter: guest | Owner: nobody Type: defect | Status: closed Priority: minor | Milestone: Component: hugs | Version: 200609 Resolution: invalid | Keywords: ----------------------+----------------------------------------------------- Changes (by ross): * status: new => closed * resolution: => invalid Comment: That is to be expected: factorial 35 is to big to fit in a Float. You'd get up to 170 if you used Double instead (and old versions of Hugs used the C double type internally for both types). But a better approach would be to use another scanl to build the terms of the series incrementally as Floats or Doubles, before the scanl you're using to get partial sums. -- Ticket URL: Hugs Hugs 98, an interpreter for Haskell From dekudekuplex at yahoo.com Wed Feb 27 07:39:11 2008 From: dekudekuplex at yahoo.com (Benjamin L. Russell) Date: Wed Feb 27 07:37:02 2008 Subject: Gofer 2.30a binary executable won't run on Windows XP Professional Service Pack 2 Message-ID: <793652.85407.qm@web30204.mail.mud.yahoo.com> Since "HUGS" stands for "Haskell User's Gofer System" (see http://www.websters-dictionary-online.org/definition/Hugs for a reference), and HUGS is a later version of Gofer, I am sending this inquiry about a problem in installing Gofer to this mailing list. I managed to get Gofer 2.28 (see "some haskell FAQ info (occasional posting, long" (http://www.cse.unsw.edu.au/~dons/haskell-1990-2006/msg00936.html) for download information) installed on Windows XP Professional Service Pack 2, but when I downloaded Gofer 2.30a and tried to run bcgofer.exe (either by executing it from the Command Prompt, or by double-clicking it in the GUI) (there is no GOFER.EXE file in that version), the program quit immediately. The same thing happened when I tried to run bcgofc.exe. I was unable to follow instructions in the README.PC file for Gofer 2.30a because that file refers to a non-existent "GOFER.EXE" file. How can I move a file that doesn't exist to the C:\Gofer directory? The bundled documentation for Gofer 2.30a seems outdated. In addition, I tried installing the binary executables in 386gofer, but with the same results as with Gofer 2.30a; i.e., when I tried to invoke GOFER.EXE, a Command Prompt window appeared for a fraction of a second, then disappeared. The user and system environmental variables are both set correctly; viz: EDITLINE: C:\bin\emacs\bin\runemacs.exe +%d %s EDITOR: C:\bin\emacs\bin\runemacs.exe GO32: emu c:\DJGPP\EMU387\emu387 GO32TMP: C:\TMP GOPHER: C:\GOFER\standard.prelude Path: C:\Gofer; I was able to get Gofer 2.28 to run without needing to compile anything. Do I need to compile something to run Gofer 2.30a? It seems strange that I can get Gofer 2.28 to work, but not Gofer 2.30; what could be wrong? I am currently reading the paper "Functional Programming," by Jeroen Fokker and the Department of Computer Science of Utrecht University (http://people.cs.uu.nl/jeroen/courses/fp-eng.pdf), which uses Gofer. If you could please tell me what I need to do to get Gofer 2.30a to work properly, I would appreciate it very much. Benjamin L. Russell From ndmitchell at gmail.com Wed Feb 27 07:44:36 2008 From: ndmitchell at gmail.com (Neil Mitchell) Date: Wed Feb 27 07:42:25 2008 Subject: Gofer 2.30a binary executable won't run on Windows XP Professional Service Pack 2 In-Reply-To: <793652.85407.qm@web30204.mail.mud.yahoo.com> References: <793652.85407.qm@web30204.mail.mud.yahoo.com> Message-ID: <404396ef0802270444y56df9eafw5baa430e29e94591@mail.gmail.com> Hi Benjamin, Gofer is kind of dead, I'd recommend instead installing WinHugs, and following one of the many Haskell tutorials out there. Thanks Neil On Wed, Feb 27, 2008 at 12:39 PM, Benjamin L. Russell wrote: > Since "HUGS" stands for "Haskell User's Gofer System" > (see > http://www.websters-dictionary-online.org/definition/Hugs > for a reference), and HUGS is a later version of > Gofer, I am sending this inquiry about a problem in > installing Gofer to this mailing list. > > I managed to > get Gofer 2.28 (see "some haskell FAQ info (occasional > posting, long" > (http://www.cse.unsw.edu.au/~dons/haskell-1990-2006/msg00936.html) > for download information) installed on Windows XP > Professional > Service Pack 2, but when I downloaded Gofer 2.30a and > tried to run bcgofer.exe (either by executing it from > the Command Prompt, or by double-clicking it in the > GUI) (there is no GOFER.EXE file in that version), the > program quit immediately. The same thing happened > when I tried to run bcgofc.exe. > > I was unable to follow instructions in the README.PC > file for Gofer 2.30a because that file refers to a > non-existent "GOFER.EXE" file. How can I move a file > that doesn't exist to the C:\Gofer directory? The > bundled documentation for Gofer 2.30a seems outdated. > > In addition, I tried installing the binary executables > in 386gofer, but with the same results as with Gofer > 2.30a; i.e., when I tried to invoke GOFER.EXE, a > Command Prompt window appeared for a fraction of a > second, then disappeared. > > The user and system environmental variables are both > set correctly; viz: > > EDITLINE: C:\bin\emacs\bin\runemacs.exe +%d %s > EDITOR: C:\bin\emacs\bin\runemacs.exe > GO32: emu c:\DJGPP\EMU387\emu387 > GO32TMP: C:\TMP > GOPHER: C:\GOFER\standard.prelude > Path: C:\Gofer; > > I was able to get Gofer 2.28 to run without needing to > compile anything. Do I need to compile something to > run Gofer 2.30a? > > It seems strange that I can get Gofer 2.28 to work, > but not Gofer 2.30; what could be wrong? > > I am currently reading the paper "Functional > Programming," by Jeroen Fokker and the Department of > Computer Science of Utrecht University > (http://people.cs.uu.nl/jeroen/courses/fp-eng.pdf), > which uses Gofer. If you could please tell me what I > need to do to get Gofer 2.30a to work properly, I > would appreciate it very much. > > Benjamin L. Russell > _______________________________________________ > Hugs-Bugs mailing list > Hugs-Bugs@haskell.org > http://www.haskell.org/mailman/listinfo/hugs-bugs >