From rrk at correo.azc.uam.mx Thu Sep 6 08:13:46 2007 From: rrk at correo.azc.uam.mx (Risto Rangel Kuoppa) Date: Thu Sep 6 08:03:59 2007 Subject: [Hugs-users] WinHugs extremely basic newbie question Message-ID: <4358854CED4B4D129D9046E63B9C03E4@M8> Hello everyone, I am having troubles to start using WinHugs. I downloaded it, installed, and run it. Yet I am unable to run something else than just evaluating expressions. For example, I am trying to define my first data type with: Hugs> data Tipo = Cruz | Circulo deriving Eq But all I get is: ERROR - Syntax error in expression (unexpected keyword "data") Hugs> I think that I must load some module or library but when I make: Hugs> :load "C:\\Program Files\\WinHugs\\packages\\hugsbase\\Hugs\\Prelude.hs" I get: ERROR file:.\Prelude.hs - Module "Hugs.Prelude" already loaded Hugs.Prelude> And I cannot find any Data.hs (Does it actually exist?) anywhere. Could someone help me with this please? I have already spent several hours trying to figure it out. All I want is to start testing the tutorials and learn Haskell but I am missing something to run them with WinHugs. Thanks in advance, Risto From naur at post11.tele.dk Thu Sep 6 14:01:47 2007 From: naur at post11.tele.dk (Thorkil Naur) Date: Thu Sep 6 13:53:05 2007 Subject: [Hugs-users] WinHugs extremely basic newbie question In-Reply-To: <4358854CED4B4D129D9046E63B9C03E4@M8> References: <4358854CED4B4D129D9046E63B9C03E4@M8> Message-ID: <200709062001.54112.naur@post11.tele.dk> Hello Risto, I don't have a Windows system myself, and therefore no winhugs, but your problems seem unrelated to winhugs as such, so I will try to indicate how you might proceed, using my Linux Hugs for illustration. On Thursday 06 September 2007 14:13, Risto Rangel Kuoppa wrote: > Hello everyone, > > I am having troubles to start using WinHugs. I downloaded it, installed, > and run it. Yet I am unable to run something else than just evaluating > expressions. For example, I am trying to define my first data type with: > > Hugs> data Tipo = Cruz | Circulo deriving Eq Quoting from the "The Hugs 98 User's Guide": "The Hugs prompt accepts expressions, but not Haskell definitions." (See http://cvs.haskell.org/Hugs/pages/users_guide/module-commands.html) So if you wish to work with definitions, you have to put them in a file and either list the file on the hugs command line (this is not winhugs) or load the file from the hugs promt. Here is what it would look like on a Linux system: > tn@linux:~/tn/tmp/hugs> cat Risto1.hs > data Tipo = Cruz | Circulo deriving Eq ("cat" is the Linux "type" command.) > tn@linux:~/tn/tmp/hugs> hugs > __ __ __ __ ____ ___ _________________________________________ > || || || || || || ||__ Hugs 98: Based on the Haskell 98 standard > ||___|| ||__|| ||__|| __|| Copyright (c) 1994-2003 > ||---|| ___|| World Wide Web: http://haskell.org/hugs > || || Report bugs to: hugs-bugs@haskell.org > || || Version: November 2003 _________________________________________ > > Haskell 98 mode: Restart with command line option -98 to enable extensions > > Type :? for help > Prelude> :load Risto1 > Main> Cruz > ERROR - Cannot find "show" function for: > *** Expression : Cruz > *** Of type : Tipo > > Main> :type Cruz > Cruz :: Tipo > Main> From this, you can see that hugs has indeed "got" the data definition. (To enable values of type Tipo to be printed, you should derive Show in addition to Eq.) > > But all I get is: > ERROR - Syntax error in expression (unexpected keyword "data") > Hugs> > > I think that I must load some module or library but when I make: > > > Hugs> :load "C:\\Program > Files\\WinHugs\\packages\\hugsbase\\Hugs\\Prelude.hs" > > I get: > ERROR file:.\Prelude.hs - Module "Hugs.Prelude" already loaded > Hugs.Prelude> Here, you are trying to load the standard prelude, but that is loaded already by default, so the error message tells you exactly that. As indicated, you should probably create your own file, containing your definitions, and then load that. > > And I cannot find any Data.hs (Does it actually exist?) anywhere. I am not sure what you are getting at here. Please give some additional information. I hope that you will be able to get past some of the initial hurdles. If not, or if you have additional questions, please feel free to ask again. Best regards Thorkil > Could > someone help me with this please? I have already spent several hours > trying to figure it out. All I want is to start testing the tutorials and > learn Haskell but I am missing something to run them with WinHugs. > > Thanks in advance, > > Risto > > > > _______________________________________________ > Hugs-Users mailing list > Hugs-Users@haskell.org > http://www.haskell.org/mailman/listinfo/hugs-users > From ferronrsmith at gmail.com Wed Sep 19 18:10:51 2007 From: ferronrsmith at gmail.com (ferronrsmith) Date: Wed Sep 19 18:10:28 2007 Subject: [Hugs-users] Request for Haskell Help In-Reply-To: <10226480.post@talk.nabble.com> References: <10226480.post@talk.nabble.com> Message-ID: <12787216.post@talk.nabble.com> We are all here to help, but you have to post your problems so that others can help.. My site is a very good resource for learning haskell: http://haskell.kwikphp.com/haskell/index.php Haskell for Beginners -- View this message in context: http://www.nabble.com/Request-for-Haskell-Help-tf3659849.html#a12787216 Sent from the Haskell - Hugs-Users mailing list archive at Nabble.com. From dekudekuplex at yahoo.com Fri Sep 21 00:07:27 2007 From: dekudekuplex at yahoo.com (Benjamin L. Russell) Date: Fri Sep 21 00:07:01 2007 Subject: [Hugs-users] A New Notation for Arrows In-Reply-To: <20070531193037.GA26748@soi.city.ac.uk> Message-ID: <818304.51525.qm@web30205.mail.mud.yahoo.com> Are there any plans to fix the preprocessor or update Hugs so that scope errors or type errors will be reported against the source code, rather than against the preprocessor output? That would render debugging with new notation for arrows just as easy to accomplish with Hugs as with GHC. -- Benjamin L. Russell --- Ross Paterson wrote: > .... > > I've fixed the binary link, but you might as well > use GHC for arrows. > If you use the preprocessor, scope errors or type > errors will be harder > to track down, as they'll be reported against the > preprocessor output, > which is rather obfuscated. GHC will report them > against the source > you wrote. > _______________________________________________ > Hugs-Users mailing list > Hugs-Users@haskell.org > http://www.haskell.org/mailman/listinfo/hugs-users > From ross at soi.city.ac.uk Fri Sep 21 08:40:33 2007 From: ross at soi.city.ac.uk (Ross Paterson) Date: Fri Sep 21 08:40:11 2007 Subject: [Hugs-users] A New Notation for Arrows In-Reply-To: <818304.51525.qm@web30205.mail.mud.yahoo.com> References: <20070531193037.GA26748@soi.city.ac.uk> <818304.51525.qm@web30205.mail.mud.yahoo.com> Message-ID: <20070921124033.GA6184@soi.city.ac.uk> On Thu, Sep 20, 2007 at 09:07:27PM -0700, Benjamin L. Russell wrote: > Are there any plans to fix the preprocessor or update > Hugs so that scope errors or type errors will be > reported against the source code, rather than against > the preprocessor output? No, there are no such plans.