From arashbi at gmail.com Sun May 14 07:08:46 2006 From: arashbi at gmail.com (Arash) Date: Sun May 14 07:02:19 2006 Subject: [Hugs-users] newbie problem help pliz Message-ID: <2856b29d0605140408n3e683b6el969d7228820d2230@mail.gmail.com> I am unfamiliar with haskell and just started learning it. I need to run a program developed by my master for real number calculation some years ago. First attemp to run it by hugs gives me this error message: ERROR "RN_Comp.hugs":258 - Undefined variable "%" I tryed to import Ratio, which solved the problem but after that it gives me this error message: ERROR "RN_Comp.hugs":18 - Type error in application *** Expression : fromInteger . fromEnum *** Term : fromInteger *** Type : Integer -> a *** Does not match : Int -> a which is for this function: {--------------------------------------------} {- moving to traditional signed-digit -} {--------------------------------------------} fromDigit :: Digit -> Integer fromDigit =(\n -> n - 1).fromInteger.fromEnum Coudl anyone help me please fix this problem? -- from debian manifesto: Debian Linux is a brand-new kind of Linux distribution. Rather than being developed by one isolated individua l or group, as other distributions of Linux have been developed in the past, Debian is being developed openly in the spirit of Linux and GNU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org//pipermail/hugs-users/attachments/20060514/00ae0b2b/attachment.htm From jon.fairbairn at cl.cam.ac.uk Sun May 14 07:18:36 2006 From: jon.fairbairn at cl.cam.ac.uk (Jon Fairbairn) Date: Sun May 14 07:12:11 2006 Subject: [Hugs-users] newbie problem help pliz In-Reply-To: Your message of "Sun, 14 May 2006 14:38:46 +0330." <2856b29d0605140408n3e683b6el969d7228820d2230@mail.gmail.com> Message-ID: <7993.1147605516@calligramme.charmers> On 2006-05-14 at 14:38+0330 Arash wrote: > ERROR "RN_Comp.hugs":18 - Type error in application > *** Expression : fromInteger . fromEnum > *** Term : fromInteger > *** Type : Integer -> a > *** Does not match : Int -> a > > which is for this function: > > {--------------------------------------------} > {- moving to traditional signed-digit -} > {--------------------------------------------} > fromDigit :: Digit -> Integer > fromDigit =(\n -> n - 1).fromInteger.fromEnum > > Could anyone help me please fix this problem? Prelude> :t fromInteger fromInteger :: (Num a) => Integer -> a Prelude> :t fromIntegral fromIntegral :: (Num b, Integral a) => a -> b so you just need to use fromIntegral instead of fromInteger J?n -- J?n Fairbairn Jon.Fairbairn at cl.cam.ac.uk From ross at soi.city.ac.uk Mon May 15 18:57:31 2006 From: ross at soi.city.ac.uk (Ross Paterson) Date: Mon May 15 18:51:02 2006 Subject: [Hugs-users] ANNOUNCE: new release of Hugs Message-ID: <20060515225731.GA3892@soi.city.ac.uk> We are pleased to announce a new major release of Hugs, including an installer for Windows and a new WinHugs interface (both contributed by Neil Mitchell). It is available from the Hugs page: http://www.haskell.org/hugs/ At present two sizes of the Windows distribution and two sizes of source distribution are available for download. Distributions for other platforms will be linked to when they are provided by third parties. Packagers can choose between an omnibus package and a more modular arrangement. ------------------------------------------------------------------------------ The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the Yale Haskell Group, and the OGI School of Science & Engineering at OHSU, 1994-2005, All rights reserved. It is distributed as free software under the license in the file "License", which is included in the distribution. ------------------------------------------------------------------------------ From ross at soi.city.ac.uk Tue May 16 06:49:54 2006 From: ross at soi.city.ac.uk (Ross Paterson) Date: Tue May 16 06:43:30 2006 Subject: [Hugs-users] Re: new release of Hugs / preprocessor usage In-Reply-To: <4469A940.1070907@tzi.de> References: <20060515225731.GA3892@soi.city.ac.uk> <446998D8.90709@tzi.de> <20060516092705.GA3773@soi.city.ac.uk> <4469A940.1070907@tzi.de> Message-ID: <20060516104954.GB3773@soi.city.ac.uk> On Tue, May 16, 2006 at 12:28:16PM +0200, Christian Maeder wrote: > My next problem is: > > "Maximum token length (4000) exceeded" > > Which spot in the sources do I have to change in order to increase this > limit? (I've unsuccessfully searched the hugs mailing lists for an answer) MAX_TOKEN in src/input.c From claus.reinke at talk21.com Tue May 16 06:51:44 2006 From: claus.reinke at talk21.com (Claus Reinke) Date: Tue May 16 06:45:11 2006 Subject: [Hugs-users] Re: [Haskell] Re: new release of Hugs / preprocessor usage References: <20060515225731.GA3892@soi.city.ac.uk> <446998D8.90709@tzi.de><20060516092705.GA3773@soi.city.ac.uk> <4469A940.1070907@tzi.de> Message-ID: <004f01c678d6$ba1dfde0$68618351@cr3lt> > Thanks, this works. My next problem is: > > "Maximum token length (4000) exceeded" > > Which spot in the sources do I have to change in order to increase this > limit? (I've unsuccessfully searched the hugs mailing lists for an answer) iirc, this comes up with long string constants, such as the equivalent of HERE-documents in shell scripts and program generators. if that is the case, try splitting up the string. instead of here = "poor man's \n\ \here document\n\ \in haskell\n" use here = unlines ["poor man's" ,"here document" ,"in haskell" ] that way, you don't have to make your own incompatible version of hugs, and haskell's string gaps don't buy you anything in readability anyway. Ross: perhaps Hugs could use (++) internally to encode string gaps, instead of trying and often failing to parse a monolithic string token? (the max token length was extended in the past, but a fixed limit will never do for all applications) cheers, claus