From freepornoforyou2003@yahoo.com Tue Apr 1 06:22:50 2003 From: freepornoforyou2003@yahoo.com (Paul Hudak) Date: Mon, 31 Mar 2003 22:22:50 -0800 (PST) Subject: Free Porn! Message-ID: <20030401062250.83778.qmail@web20703.mail.yahoo.com>
GUARANTEED 100% FREE PORNO
SEE THE HOTTEST GIRLS FOR FREE
Click Here to Enter!


Did you know that....

The laws governing the adult Internet business have recently become extremely strict to protect consumers. You now can, and should take advantage of this protection.

Click Here to Enter!

But there is more....

Companies that offer FREE PORNO must, by law, honor this promise. Companies give away free access to their websites just to generate traffic to it so they can promote other things by using banners and such. Remember, if it says FREE, you are not obligated to buy anything.

Click Here to Enter!

Are your professors after you for Haskell homework again? Do they laugh at you on Haskell mailing list when you ask about permutations? Do people post joke answers to your questions without helping you at all? How much time did you waste trying to install ghc? Wh o really understands those Hugs error messages anyway? Is it really possible to figure out what's wrong when the stack overflows? Does your girlfriend make fun of your diminished cranial capacity? Now, THERE IS A SOLUTION! The Galois Homework Team will make sure that you get the right answers. Get full credit for every assignment or YOU PAY NOTHING! That's right! Wrong answers won't cost you a penny. What do you need? A simple sorting function? Fibinocci numbers? A monad? We do it all. True/False questions. Short answers. One line programs. One page programs. Full sized applications. Term papers. Master's theses. And EVEN DISSERTATIONS! But THATS NOT ALL! Homework is just part of the problem! We bet you have to take tests too! Never fear, though. Help is on the way. For just $100 we will send you a special pencil that sends your test questions STRAIGHT TO THE GALOIS HOMEWORK DESK! And then WRITES THE CORRECT ANSWERS in your OWN HANDWRITING! This special pencil is COMPLETELY UNDETECTABLE! Your prof will never know just how stupid you are! Price schedule: Problems from popular Haskell texts: $5 Short answer questions: $10 Programs: $1 / line of code (comments extra) Dissertations: call us. This service is COMPLETELY CONFIDENTIAL! No need to broadcast your cluelessness to the entire internet. And don't worry - if other students in your class are also using our services we promise that NO TWO PROGRAMS that we provide will EVER be the SAME! Fritz, our homework specialist, can create hundreds of ways to handle even the simplest task. That's right, even factorial! Please see our website at http://www.galconn.com/ for more details. No Visual Basic programming, please. __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://platinum.yahoo.com From haskellcurry2003@yahoo.com Tue Apr 1 14:58:06 2003 From: haskellcurry2003@yahoo.com (Haskell Curry) Date: Tue, 1 Apr 2003 06:58:06 -0800 (PST) Subject: URGENT Message-ID: <20030401145806.85834.qmail@web20706.mail.yahoo.com> URGENT ASSISTANCE WE ARE MEMBERS OF A SPECIAL COMMITTEE FOR THE DESIGN AND DEVELOPMENT OF ADVANCED PROGRAMMING LANGUAGES OF MEIJCROSOFT COORPORATION IN THE UNITED STATES. THIS COMMITTEE HAS RECENTLY COMPLETED THE IMPLEMENTATION OF A NEW FUNCTIONAL PROGRAMMING LANGUAGE THAT UNIFIES RELATIONAL, OBJECT-ORIENTED AND SEMISTRUCTURED DATA. THE EXISTANCE OF SUCH A LANGUAGE HAS BEEN KEPT SUCH A STRICT SECRET BY MEIJCROSOFT THAT EVEN GOOGLE DOES NOT KNOW ABOUT IT. WITH OUR POSITIONS, WE HAVE SUCCESSFULLY SECURED FOR OURSELVES THE SUM OF THIRTHY ONE MILLION, FIVE HUNDRED THOUSAND UNITED STATES DOLLARS (US$31.5M). THIS AMOUNT WAS CAREFULLY MANIPULATED BY OVER-INVOICING LICENSE AGREEMENTS WITH IBM, ORACLE, BEA AND SUN. SINCE THE FOUNDATIONS OF THE NEW SECRET PROGRAMMING LANGUAGE ARE BASED ON WORK THAT HAS BEEN DONE BY THE FUNCTIONAL PROGRAMMING COMMUNITY IN THE PAST, WE ARE INVITING YOU TO HELP US IN TRANSFERING THIS FUND (US$31.5M) INTO A SAFE ACCOUNT. IT HAS BEEN AGREED THAT THE OWNER OF THE ACCOUNT WILL BE COMPENSATED WITH 30% OF THE REMITTED FUNDS, WHILE WE KEEP 60% AS THE INITIATORS AND 10% WILL BE SET ASIDE TO OFFSET EXPENSES AND PAY THE NECESSARY TAXES. WE INTEND TO USE PART OF OUR OWN SHARE TO HIRE MORE FUNCTIONAL PROGRAMMERS FROM DEPARTMENT. THIS IS BECAUSE THE PRESENT DIRECTORS OF OUR COMPANY ARE EMPHASISING THE CONSTRUCTION OF THRUSTWORTHY CODE FOR ALL ITS PRODUCTS BEFORE THE NEXT RELEASE. HENCE, PURE AND LAZY FUNCTIONAL PROGRAMMERS ARE IN HIGH DEMAND OVER HERE. WE SHALL ALSO NEED YOUR ASSISTANCE IN THIS REGARD ON A COMMISSION TO BE AGREED UPON WHEN WE FINALLY MEET. ALL MODALITIES OF THIS TRANSACTION HAVE BEEN CAREFULLY WORKED OUT AND PROVED CORRECT USING IDEALIZED METAML AND ONCE STARTED WILL NOT TAKE MORE THAN SEVEN (7) WORKING DAYS, WITH YOUR FULL SUPPORT. THIS TRANSACTION IS 100% RISK FREE. MOREOVER, WE SHALL NEED THE FOLLOWING FROM YOU TO ENABLE US BEGIN THE TRANSACTION FORMALLY. THEY ARE; YOUR FULL NAME AND ADDRESS OR YOUR COMPANY NAME, ADDRESS AND HOMEPAGE, YOUR COMPUTERS NAME AND IPADDRESS, YOUR ACCOUNT PASSWORD AND NAME. THIS INFORMATION WILL BE USED ALONGSIDE OTHER VITAL DOCUMENTS OVER HERE IN PREPARING THE NECESSARY APPLICATION FOR PAYMENT TO THE CONCERNED QUARTERS WHERE PAYMENT APPROVALS WOULD BE SECURED IN FAVOUR OF YOUR COMPANY FOR THE PAYMENT OF OUR FUND(US$31.5M) INTO YOUR NOMINATED ACCOUNT FOR US ALL. BY OUR APPLICATION, IT WILL BE ASSUMED THAT THIS SUM IS BEING REQUESTED AS PAYMENT, WHICH IS LONG-OUTSTANDING, FOR A RESEARCH CONTRACT, WE SHALL CLAIM WITH OUR POSITION, YOU OR YOUR COMPANY EXECUTED FOR MEIJCROSOFT COORPERATION SOMETIME IN 1998. HENCE, WE SHALL FOLLOW ALL THE LEGAL OFFICIAL PROTOCOLS USUALLY OBSERVED BY FOREIGN CONTRACTORS WHENEVER THEY ARE DEMANDING PAYMENT FOR RESEARCH CONTRACTS EXECUTED FOR THE MY COMPANY. FURTHERMORE, IMMEDIATELY THE FINAL APPROVAL IS GRANTED, THE FUND WILL BE TRANSFERRED INTO YOUR ACCOUNT WITHIN 72 HOURS, BY WHICH TIME MY PARTNERS AND I WILL HAVE HACKED INTO YOUR MACHINES FOR THE FINAL DISBURSEMENT IN THE RATIO ALREADY SPELT OUT TO YOU. PLEASE, YOU SHOULD ENDEAVOUR TO GIVE US A MACHINE ON WHICH YOU HAVE ADMINISTRATOR PRIVILIGES. THIS IS VERY IMPORTANT BECAUSE WE WOULD NOT WANT A SITUATION WHEN WE HAVE ENTERED THE ACCOUNT, YOU NOW TELL US YOU WOULD NEED TO BE AUTHORISED BY ANOTHER PERSON BEFORE WE CAN HAVE OUR OWN SHARE. YOU WILL NOT BE REQUIRED TO TRAVEL OUT OF YOUR OFFICE, ME AND MY PARTNERS, WE ELECTRONICALLY HANDLE THE DISBURSEMENT OF THE FUND, AFTER THE FINAL TRANSACTION. WE WILL ALSO DISCUSS ABOUT THE USE OF FUNCTIONAL PROGRAMMING TO CONVERT CODE IN EXISTING LANGUAGES TO THE NEW FUNCTIONAL LANGUAGE BY MY COMPANY VIA INSTANT MESSAGING. BECAUSE WE WOULD LIKE TO ESTABLISH A JOINT BUSINESS WITH YOU. THAT IS WE WILL USE YOUR NAME TO REGISTER AND INCORPORATE A SOFTWARE TRANSLATION COMPANY IN COSTA RICA. BESIDES, ON THE COMPLETION OF THIS TRANSFER, ALL TEX FILES USED FOR THE PURPOSE WILL BE WITHDRAWN FROM THE QUARTERS THEY ARE SUBMITTED BY OUR CONTACTS IN THESE OFFICES AND DESTROYED, THEREAFTER. SO, THERE WILL NOT BE ANY PROBLEM ARISING FROM THIS TRANSACTION NOW OR IN THE FUTURE. IF THIS PROPOSAL SATISFIES YOU, PLEASE REACH US ONLY BY EMAIL FOR MORE INFORMATION. PLEASE, TREAT AS URGENT AND VERY IMPORTANT. YOURS FAITHFULLY, DR. HASKELL B. CURRY __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://platinum.yahoo.com From colin@colina.demon.co.uk Tue Apr 1 15:12:22 2003 From: colin@colina.demon.co.uk (Colin Paul Adams) Date: 01 Apr 2003 16:12:22 +0100 Subject: URGENT In-Reply-To: <20030401145806.85834.qmail@web20706.mail.yahoo.com> References: <20030401145806.85834.qmail@web20706.mail.yahoo.com> Message-ID: This doesn't count in England, though, since it is after 12:00. -- Colin Paul Adams Preston Lancashire From y-agra@lycos.com Tue Apr 1 15:26:58 2003 From: y-agra@lycos.com (M Jones) Date: Tue, 01 Apr 2003 07:26:58 -0800 Subject: Increase Performance TODAY! Message-ID: Increase Your Performance Right Now! Take control of your life, Order Y-agra Online Now! The drug Y-agra is a revolutionary way to treat imperatence and enhance any man's programming style. It is a Safe and Effective way to increase a man's performance and has proven to be the most successful treatment for object oriented disorders. No need to go through embarrassing, stressful university courses anymore, you can now get Y-agra from the comfort of your home! Some Things to think about... You will not get side-effects without monadic stimulation - no need to be embarrassed like when you use other computational aids. More men use and trust Y-agra as a treatment for programming language dysfunction than other software stimulation aids. Y-agra is a safe treatment that is proven because of the wide use and acceptance by the general public. Why settle for the least fixpoint when Y-agra can give you recurring ACTION you deserve! This is the easiest and most discreet way to END IMPERATENCE. It's ALL NATRUAL! Made with one of life's most essential combinators, Y-agra has been used for decades! The pleasure is INFINITE! It's worked for so many don't waste any more time get started by following this link! http://129.95.20.2/~mpj This is NOT SPAM! REALLY! You signed up for this EMail and WE CAN PROVE IT! _____________________________________________________________ Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year. http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus From 1hallber@informatik.uni-hamburg.de Tue Apr 1 15:32:27 2003 From: 1hallber@informatik.uni-hamburg.de (Sven Moritz Hallberg) Date: Tue, 1 Apr 2003 17:32:27 +0200 Subject: URGENT In-Reply-To: <20030401145806.85834.qmail@web20706.mail.yahoo.com> References: <20030401145806.85834.qmail@web20706.mail.yahoo.com> Message-ID: <20030401153227.GA23742@rzdspc3.informatik.uni-hamburg.de> This is definately going up on one of the Uni blackboards... Still giggling, Sven M. Hallberg From camio@yahoo.com Wed Apr 2 15:49:46 2003 From: camio@yahoo.com (David Sankel) Date: Wed, 2 Apr 2003 07:49:46 -0800 (PST) Subject: Haskell Networking Example Message-ID: <20030402154946.13764.qmail@web40605.mail.yahoo.com> Hello All, Here is an example of using haskell networking operations for those interested. The implementation is a simple echo server. echoclient.hs: module Main( main ) where import Network import IO import Control.Concurrent main :: IO () main = withSocketsDo $ --For windows compatibility do handle <- connectTo "localhost" (PortNumber 2048) input <- getContents sequence_ $ map ( \a -> do hPutStr handle $ a ++ "\n" hFlush handle ) $ lines input hClose handle echoserver.hs: module Main( main ) where import Network import IO import Control.Concurrent main :: IO () main = withSocketsDo $ --For windows compatibility do theSocket <- listenOn (PortNumber 2048) sequence_ $ repeat $ acceptConnectionAndFork theSocket where acceptConnectionAndFork :: Socket -> IO () acceptConnectionAndFork theSocket = do connection <- accept theSocket let (handle, hostname, portnumber ) = connection putStr ("("++ hostname ++ ":" ++ (show portnumber) ++ "): Open\n" ) forkIO (echoServer connection) return () echoServer :: (Handle, String, PortNumber) -> IO () echoServer (handle, hostname, portnumber ) = do a <- hGetContents handle putStr $ foldr (++) "" $ map (\a -> "(" ++ hostname ++ ":" ++ (show portnumber) ++ "): Msg " ++ (show a) ++ "\n" ) $ lines a putStr ("("++ hostname ++ ":" ++ (show portnumber) ++ "): Close\n" ) Makefile: all: echoclient echoserver echoclient: echoclient.hs ghc -package network echoclient.hs -o echoclient echoserver: echoserver.hs ghc -package network echoserver.hs -o echoserver clean: rm *.o *.hi echoclient echoserver From si@fh-wedel.de Thu Apr 3 14:48:03 2003 From: si@fh-wedel.de (Uwe Schmidt) Date: Thu, 3 Apr 2003 16:48:03 +0200 Subject: ANNOUNCE: Haskell XML Toolbox Version 2.01 Message-ID: <200304031445.h33Ejkpn023925@mail.fh-wedel.de> Haskell XML Toolbox 2.01 I would like to announce a new version of the Haskell XML Toolbox for processing XML including a validating parser and a new XPath module. new features: * namespace support * xpath support * new example program for a XML-grep like program for selecting parts of a document by a XPath expression More information and download: http://www.fh-wedel.de/~si/HXmlToolbox/index.html Please email comments, bugs, etc. to hxmltoolbox@fh-wedel.de Uwe Schmidt From shae@webwitches.com Thu Apr 3 17:33:13 2003 From: shae@webwitches.com (shae@webwitches.com) Date: Thu, 03 Apr 2003 19:33:13 +0200 Subject: ANNOUNCE: lambdabot 1.0 - IRC 'bot in Haskell Message-ID: <87znn732qu.fsf@thunderbird.webwitches.com> Announcing the release of lambdabot 1.0 ------------------------------------ lambdabot is an IRC 'bot and plugin framework written in Haskell by Andrew Bromage, and a collection of plugins by Shae Erisson, Taylor Campbell, and Derek Elkins. http://sourceforge.net/projects/haskell-libs/ What's new in this release: - fortune plugin - factoid plugin - lambda calculator plugin - karma plugin - topic plugin - system plugin - hello and state demo plugins Requirements: - ghc 5.04 - HToolkit's postgresql bindings for the factoid plugin - fortune files for the fortune plugin -- Shae Matijs Erisson - 2 days older than RFC0226 #haskell on irc.freenode.net - We Put the Funk in Funktion 10 PRINT "HELLO" 20 GOTO 10 ; putStr $ fix ("HELLO\n"++) From jmj@info.fundp.ac.be Wed Apr 2 15:49:27 2003 From: jmj@info.fundp.ac.be (Jean-Marie JACQUET) Date: Wed, 2 Apr 2003 17:49:27 +0200 (MEST) Subject: Foclasa: 1st Call for Papers Message-ID: <200304021549.h32FnRl22107@backus.info.fundp.ac.be> ====================================================================== 2nd International Workshop on Foundations of Coordination Languages and Software Architectures (Foclasa 2002) September 2, 2003, Marseille, France Workshop affiliated to CONCUR'2003, 02 - 06 September 2003. http://www.info.fundp.ac.be/~jmj/Foclasa03.html ====================================================================== SCOPE AND TOPICS Modern information systems rely more and more on combining concurrent, distributed, mobile and heterogenous components. This move from old systems, typically conceived in isolation, induces the need for new languages and software architectures. In particular, coordination languages have been proposed to cleanly separate computational aspects and communication. On the other hand, software architects face the problem of specifying and reasoning on non-functional requirements. All these issues are widely perceived as fundamental to improve software productivity, enhance maintainability, advocate modularity, promote reusability, and lead to systems more tractable and more amenable to verification and global analysis. The aim of the workshop is to bring together researchers working on the foundations of component-based computing, coordination, and software architectures. Topics of interest include (but are not limited to): o Theoretical models for coordination (component composition, concurrency, dynamic aspects of coordination, semantics, expressiveness); o Specification, refinement, and analysis of software archi- tectures (patterns and styles, verification of functional and non-functional properties); o Coordination, architectural, and interface description languages (implementation, interoperability, heterogeneity); o Agent-oriented languages (formal models for interacting agents); o Dynamic software architectures (mobile agents, configuration, reconfiguration); o Modeling of information systems (groupware, internet and the web, workflow management, CSCW and multimedia applications) o Coordination patterns (mobile computing, internet computing); o Tools and environments for the development of coordinated applications o Methodologies for validating and certifying software compositions SUBMISSION GUIDELINES Papers describing original work are solicited as contributions to Foclasa. Submitted papers should be limited to 6 000 words, preferrably formatted according to the Electronical Notes in Theoretical Computer Science. They should be emailed as PostScript (PS) or Portable Document Format (PDF) files to jmj@info.fundp.ac.be. PUBLICATION Following the previous edition, the proceedings will be published as a volume of the Electronical Notes in Theoretical Computer Science. Selected papers will be published in a special issue of the journal Science of Computer Programming. IMPORTANT DATES: o June 9, 2003: Submission deadline. o July 15, 2003: Notification of acceptance. o August 25, 2003: Final version. o September 6, 2003: Meeting Date. LOCATION The workshop will be held in Marseille in September 2003. It is a satellite workshop of CONCUR 2003. For venue and registration see the CONCUR web page at http://concur03.univ-mrs.fr/ WORKSHOP ORGANIZERS o Antonio Brogi (University of Pisa, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) o Ernesto Pimentel (University of Malaga, Spain) PROGRAMME COMITTEE: o Farhad Arbab (CWI, The Netherlands) o Antonio Brogi (University of Pisa, Italy) - Co-chair o Manfred Broy (University of Munich, Germany) o Jeff Kramer (Imperial College, United Kingdom) o Paola Inverardi (Univerity L'Aquila, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) - Co-chair o Joost Kok (University of Leiden, The Netherlands) o Ernesto Pimentel (University of Malaga, Spain) - Co-chair o Antonio Porto (New University of Lisbon, Portugal) o Catalin Roman (Washington University, USA) o Pamela Zave (AT&T Labs Research, USA) From F.S.de.Boer@cwi.nl Thu Apr 3 11:54:08 2003 From: F.S.de.Boer@cwi.nl (frb) Date: Thu, 03 Apr 2003 13:54:08 +0200 Subject: FMCO 2003: Call for Participation Message-ID: <3E8C20E0.5DF09992@cwi.nl> (We apologize for the reception of multiple copies) ANNOUNCEMENT OF The Second International Symposium on Formal Methods for Components and Objects (FMCO 2003) DATES 4 - 7 November, 2003 PLACE Lorentz Center, Leiden University, Leiden, The Netherlands URL http://fmco.liacs.nl/fmco03.html OBJECTIVE The objective of this symposium is to bring together researchers and practioners in the areas of software engineering and formal methods to discuss the concepts of reusability and modifiability in component-based and object-oriented software systems. FORMAT The symposium is a four days event in the style of the former REX workshops,organized to provide an atmosphere that fosters collaborative work, discussions and interaction. The program consists of keynote and technical presentations, and contains an exquisite social event. Speakers' contributions will be published after the symposium in Lecture Notes in Computer Science by Springer-Verlag. KEYNOTE SPEAKERS Desmond D'Souza (Kinetium, Austin, USA) E. Allen Emerson (University of Texas at Austin, USA) Andrew D. Gordon (Microsoft Research, UK) Yuri Gurevich (Microsoft Research, USA) Tony Hoare (Microsoft Research, UK) David Parnas (University of Limerick, IE) Joseph Sifakis (Verimag, FR) TECHNICAL PRESENTATIONS Albert Benveniste (IRISA/INRIA - Rennes, FR) Frank de Boer (CWI, NL) Egon Boerger (Pisa University, IT) Werner Damm (University of Oldenburg, DE) Razvan Diaconescu (IMAR, RO) Gregor Engels (University of Paderborn, DE) Jose Luiz Fiadeiro (University of Leicester, UK) Jan Friso Groote (Eindhoven University of Technology, NL) Jean-Marc Jezequel (IRISA, Rennes, FR) Bengt Jonsson (Uppsala University, SE) Yassine Lakhnech (University of Grenoble, FR) Rob van Ommering (Philips Research Laboratories, NL) Amir Pnueli (The Weizmann Institute of Science, ISR) Willem-Paul de Roever (University of Kiel, DE) Jan Rutten (CWI, Amsterdam, NL) Philippe Schnoebelen (CNRS, Cachan, FR) Natalia Sidorova (Eindhoven University of Technology, NL) Heike Wehrheim (University of Oldenburg, DE) Jeannette Wing (Carnegie Mellon University, USA) REGISTRATION Participation is limited to about 80 people, using a first-in first-served policy. To register, please fill in the registration form at http://fmco.liacs.nl/fmco03.html. The EARLY registration fee (BEFORE September 15, 2003) is 375 euro for regular participants and 250 euro for students. It includes the participation to the symposium, a copy of the proceedings, all lunches and refreshments, and a social event (with dinner). ORGANIZING COMMITTEE F.S. de Boer (CWI and Utrecht University) M.M. Bonsangue (LIACS-Leiden University) S. Graf (Verimag) W.P. de Roever (CAU) For more information about participation and registration see the FMCO site above or consult either F.S. de Boer (frb@cwi.nl) or M.M. Bonsangue (marcello@liacs.nl). From dominic.steinitz@blueyonder.co.uk Sun Apr 6 13:28:47 2003 From: dominic.steinitz@blueyonder.co.uk (Dominic Steinitz) Date: Sun, 6 Apr 2003 13:28:47 +0100 Subject: Bits Problem Message-ID: <000701c2fc38$128b91a0$1464a8c0@canterburysoftware.com> Can anyone explain this? Hugs doesn't complain. Prelude> :set --version The Glorious Glasgow Haskell Compilation System, version 5.04.1 test.hs:5: No instance for (Num Bool) arising from the instance declaration at test.hs:5 In the instance declaration for `Bits Bool' module Main(main) where import Bits instance Bits Bool where complement False = True complement True = False Dominic Steinitz From glynn.clements@virgin.net Sun Apr 6 14:35:45 2003 From: glynn.clements@virgin.net (Glynn Clements) Date: Sun, 6 Apr 2003 14:35:45 +0100 Subject: Bits Problem In-Reply-To: <000701c2fc38$128b91a0$1464a8c0@canterburysoftware.com> References: <000701c2fc38$128b91a0$1464a8c0@canterburysoftware.com> Message-ID: <16016.11569.231076.346457@cerise.nosuchdomain.co.uk> Dominic Steinitz wrote: > Can anyone explain this? Hugs doesn't complain. > > Prelude> :set --version > The Glorious Glasgow Haskell Compilation System, version 5.04.1 > > test.hs:5: > No instance for (Num Bool) > arising from the instance declaration at test.hs:5 > In the instance declaration for `Bits Bool' > > module Main(main) where > > import Bits > > instance Bits Bool where > complement False = True > complement True = False GHC's definition of Bits requires that instances of Bits are also instances of Num. This constraint is required for the default implementations of bit and testBit: bit i = 1 `shift` i x `testBit` i = (x .&. bit i) /= 0 -- Glynn Clements From dominic.steinitz@blueyonder.co.uk Sun Apr 6 14:07:48 2003 From: dominic.steinitz@blueyonder.co.uk (Dominic Steinitz) Date: Sun, 6 Apr 2003 14:07:48 +0100 Subject: Bits Problem References: <000701c2fc38$128b91a0$1464a8c0@canterburysoftware.com> <16016.11569.231076.346457@cerise.nosuchdomain.co.uk> Message-ID: <001a01c2fc3d$86903ec0$1464a8c0@canterburysoftware.com> Is this a recent change? I've downloaded Ian Lynagh's DES module and it doesn't compile because of this. I assume it used to. I don't see the rationale for this. I can see Bool can be an instance of Bit but why does it need to be an instance of Num? Dominic Steinitz ----- Original Message ----- From: "Glynn Clements" To: "Dominic Steinitz" Cc: Sent: Sunday, April 06, 2003 2:35 PM Subject: Re: Bits Problem > > Dominic Steinitz wrote: > > > Can anyone explain this? Hugs doesn't complain. > > > > Prelude> :set --version > > The Glorious Glasgow Haskell Compilation System, version 5.04.1 > > > > test.hs:5: > > No instance for (Num Bool) > > arising from the instance declaration at test.hs:5 > > In the instance declaration for `Bits Bool' > > > > module Main(main) where > > > > import Bits > > > > instance Bits Bool where > > complement False = True > > complement True = False > > GHC's definition of Bits requires that instances of Bits are also > instances of Num. > > This constraint is required for the default implementations of bit and > testBit: > > bit i = 1 `shift` i > x `testBit` i = (x .&. bit i) /= 0 > > -- > Glynn Clements From coeus@gmx.de Sun Apr 6 15:36:00 2003 From: coeus@gmx.de (Marc Ziegert) Date: Sun, 6 Apr 2003 16:36:00 +0200 Subject: strange implementation - Re: Bits Problem In-Reply-To: <16016.11569.231076.346457@cerise.nosuchdomain.co.uk> References: <000701c2fc38$128b91a0$1464a8c0@canterburysoftware.com> <16016.11569.231076.346457@cerise.nosuchdomain.co.uk> Message-ID: <200304061636.00609.coeus@gmx.de> I'm confused. Does it mean that objects basing on bits have to be of Num because of an = default implementation that they don't use? A List of Bits should be instance of Bits, too. Instead of default imlementations that use Num functions, there could be = an instance of all Integrals. (Integer is instance of Bits too, so there = should not be any problem with rotations.) class Bits a where ... instance (Integral a) =3D> Bits a where ... Am Sonntag, 6. April 2003 15:35 schrieb Glynn Clements: > Dominic Steinitz wrote: > > Can anyone explain this? Hugs doesn't complain. > > > > Prelude> :set --version > > The Glorious Glasgow Haskell Compilation System, version 5.04.1 > > > > test.hs:5: > > No instance for (Num Bool) > > arising from the instance declaration at test.hs:5 > > In the instance declaration for `Bits Bool' > > > > module Main(main) where > > > > import Bits > > > > instance Bits Bool where > > complement False =3D True > > complement True =3D False > > GHC's definition of Bits requires that instances of Bits are also > instances of Num. > > This constraint is required for the default implementations of bit and > testBit: > > bit i =3D 1 `shift` i > x `testBit` i =3D (x .&. bit i) /=3D 0 From vardhan@cadence.com Mon Apr 7 04:30:34 2003 From: vardhan@cadence.com (Vardhan Varma) Date: Mon, 07 Apr 2003 09:00:34 +0530 (IST) Subject: newbie Q: [a] -> [[a]] Message-ID: <20030407.090034.56346599.vardhan@cadence.com> Hello, Please help me with this: I'm absolute newbie in Haskell, I hope I'm posting to right forum. (1) For "abcdefgh" -> ["ab","cd","ef"] I figured this out: foo (x:y:z) = ( (x:y) :(foo z)) Now how generalize this to club 'n' chars instead of two ? 3 -> "abcdefgh" -> ["abc","def","gh"] i.e. n -> [Char] -> [ [Char] ] -- all except last element have length == n (2) My original problem is of splitting by markers. "acdhi" -> [ "a" , "b", "cd", "efg", "hi" ] I'm at total loss on how to do it. Any pointer will be appreciated. --TIA --Vardhan From Markus.Schnell@infineon.com Mon Apr 7 07:20:29 2003 From: Markus.Schnell@infineon.com (Markus.Schnell@infineon.com) Date: Mon, 7 Apr 2003 08:20:29 +0200 Subject: newbie Q: [a] -> [[a]] Message-ID: (1) Have a look at take (2) Have a look at break and span > -----Original Message----- > From: Vardhan Varma [mailto:vardhan@cadence.com] > Sent: Monday, April 07, 2003 5:31 AM > To: haskell@haskell.org > Subject: newbie Q: [a] -> [[a]] > > > > Hello, > Please help me with this: > I'm absolute newbie in Haskell, > I hope I'm posting to right forum. > > (1) For "abcdefgh" -> ["ab","cd","ef"] > I figured this out: > foo (x:y:z) = ( (x:y) :(foo z)) > Now how generalize this to club 'n' chars instead of two ? > 3 -> "abcdefgh" -> ["abc","def","gh"] > i.e. n -> [Char] -> [ [Char] ] -- all except last element > have length == n > > (2) My original problem is of splitting by markers. > "acdhi" -> [ "a" , "b", "cd", "efg", "hi" ] > I'm at total loss on how to do it. > Any pointer will be appreciated. > > --TIA > --Vardhan > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From t.zielonka@students.mimuw.edu.pl Mon Apr 7 08:22:16 2003 From: t.zielonka@students.mimuw.edu.pl (Tomasz Zielonka) Date: Mon, 7 Apr 2003 09:22:16 +0200 Subject: newbie Q: [a] -> [[a]] In-Reply-To: References: Message-ID: <20030407072215.GA23054@students.mimuw.edu.pl> On Mon, Apr 07, 2003 at 08:20:29AM +0200, Markus.Schnell@infineon.com wrote: > (1) Have a look at take > (2) Have a look at break and span > > > Now how generalize this to club 'n' chars instead of two ? > > 3 -> "abcdefgh" -> ["abc","def","gh"] > > i.e. n -> [Char] -> [ [Char] ] -- all except last element > > have length == n (3) Have a look at splitAt and List.unfoldr (and maybe null) Regards, Tom -- .signature: Too many levels of symbolic links From johanj@cs.uu.nl Mon Apr 7 11:12:12 2003 From: johanj@cs.uu.nl (Johan Jeuring) Date: Mon, 7 Apr 2003 12:12:12 +0200 Subject: Haskell Workshop 2003 Message-ID: <6631E955-68E1-11D7-B61B-0003937324F2@cs.uu.nl> Now that the deadline for ICFP has passed, please consider submitting a paper to the Haskell Workshop 2003! ACM SIGPLAN 2003 Haskell Workshop Uppsala, Sweden, August 28, 2003 http://www.functional-programming.org/HaskellWorkshop/cfp03.html Call For Papers The Haskell Workshop forms part of the PLI 2003 colloquium on Principles, Logics, and Implementations of high-level programming languages, which comprises the ICFP and PPDP conferences as well as associated workshops. Previous Haskell Workshops have been held in La Jolla (1995), Amsterdam (1997), Paris (1999), Montreal (2000), Firenze (2001), and Pittsburgh (2002). ********************* Deadlines ********************* Deadline for submission: May 22, 2003 Notification of acceptance: June 23, 2003 Final submission due: July 3, 2003 Haskell Workshop: August 28, 2003 ********************* Topics ********************* The purpose of the Haskell Workshop is to discuss experience with Haskell, and possible future developments for the language. The scope of the workshop includes all aspects of the design, semantics, theory, application, implementation, and teaching of Haskell. Topics of interest include, but are not limited to, the following: Language Design with a focus on possible extensions and modifications of Haskell as well as critical discussions of the status quo; Theory in the form of a formal treatment of the semantics of the present language or future extensions, type systems, and foundations for program analysis and transformation; Implementation Techniques including program analysis and transformation, static and dynamic compilation for sequential, parallel, and distributed architectures, memory management as well as foreign function and component interfaces; Tool Support in the form of profilers, tracers, debuggers, pre-processors, and so forth; Applications, Practice, and Experience with Haskell for scientific and symbolic computing, database, multimedia and Web applications, and so forth as well as general experience with Haskell in education and industry; Functional Pearls being elegant, instructive examples of using Haskell. Following the scheme adopted by ICFP 2003, papers in the latter two categories need not necessarily report original research results; they may instead, for example, report practical experience that will be useful to others, re-usable programming idioms, or elegant new ways of approaching a problem. The key criterion for such a paper is that it makes a contribution from which other practitioners can benefit. It is not enough simply to describe a program! ********************* Submissions ********************* Authors should submit papers in postscript format, formatted for A4 paper, to Johan Jeuring johanj@cs.uu.nl by 22th May 2003. The length should be restricted to the equivalent of 5000 words (which is approximately 12 pages in ACM format). Accepted papers will be available in the form of a technical report of the Utrecht University or an equivalent format in time for the workshop. In addition, the papers will be published by the ACM and will appear in the ACM Digital Library. If there is sufficient demand, we will try to organise facilities for system demonstrations during lunch and coffee breaks. If you are interested in demonstrating an application or tool written in Haskell, please contact Johan Jeuring (johanj@cs.uu.nl). ********************* Programme Committee ********************* Magnus Carlsson OGI Olaf Chitil University of York Ralf Hinze University of Bonn Johan Jeuring (chair) Utrecht University Jan-Willem Maessen MIT Henrik Nilsson Yale University Simon Peyton Jones Microsoft Research Claus Reinke University of Kent From peterson-john@cs.yale.edu Mon Apr 7 22:05:28 2003 From: peterson-john@cs.yale.edu (John Peterson) Date: Mon, 7 Apr 2003 17:05:28 -0400 Subject: Announcing Pan#, version 0.1 Message-ID: <200304072105.h37L5SK06068@ragged.cs.yale.edu> ------------------------------------------- Announcing Pan#, Version 0.1 ------------------------------------------- Pan is a language of interactive, functional images developed by Conal Elliott, Oege de Moor, and Sigbjorn Finne. We have built a new front and back end for the original Pan compiler to create Pan#, a stand alone system that does not require any other Haskell compiler. Pan# uses the Microsoft .NET system to compile and run the generated programs. Pan# contains its own interpreter for a small, Haskell-like language. We have simplified and extended the Haskell language somewhat but retains the core semantic basis of Haskell. This release is part of a larger effort to use functional languages and programming language principles to design new languages for educational use (http://haskell.org/edsl). Pan# has been used as a mathematical visualization language and we have developed a number of high school algebra lessons that use Pan# to create interactive visualizations which illustrate mathematical principles. Try out Pan# if you're interested in functional graphics or would like a simple language that demonstrates the power of functional programming in a new and interesting way. This is a preliminary release - it has not been extensively tested and some aspects of the system have not been implemented or are in poor shape. Pan# is easy to install and use. You can get Pan# at http://haskell.org/edsl/pansharp.html Requirements: - Windows 2000 or XP - The .NET framework (available through Microsoft Update) We would like to thank Microsoft Research for thier support of this project. John Peterson Yale Haskell Project From jleite@di.fct.unl.pt Mon Apr 7 20:49:18 2003 From: jleite@di.fct.unl.pt (=?iso-8859-1?Q?Jo=E3o_Alexandre_Leite?=) Date: Mon, 7 Apr 2003 20:49:18 +0100 Subject: CFP: DALT'03 - 1st Workshop on Declarative Agent Languages and Technologies Message-ID: <415-22003417194918769@ANIMAL> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D F I N A L C A L L F O R P A P E R S DALT 2003 First International Workshop on Declarative Agent Languages and Technologies Melbourne, Australia July 15th 2003 http://centria=2Edi=2Efct=2Eunl=2Ept/~jleite/dalt03/index=2Ehtm In conjunction with AAMAS 2003 2nd International Conference on Autonomous Agents and Multi-Agent Systems http://www=2Eaamas-conference=2Eorg/ Submission: 11 of April, 2003 Post-Proceedings published by Springer-Verlag (LNAI) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D TECHNICAL DESCRIPTION Agent metaphors and technologies are ever more adopted to=20 harness and govern the complexity of today's systems=2E As a=20 consequence, the growing complexity of agent systems calls=20 for models and technologies that promote system=20 predictability, and enable feature discovery and=20 verification=2E Recent advances in the area of logics and=20 formal methods make declarative languages and technologies=20 a mostly promising approach to the modeling and engineering=20 of complex agent systems=2E DALT aims at fostering a discussion forum to export, on the=20 one hand, such techniques into the broader community of=20 agent researchers and practitioners and, on the other hand,=20 to bring in the issues of real-world, complex, and possibly=20 large-scale agent system design in the perspective of=20 formal methods and declarative technologies=2E DALT 2003 will take place in Melbourne, Australia, in=20 conjunction with AAMAS, the 2nd International Conference on=20 Autonomous Agents and Multi-Agent Systems=2E Topics of interest include, but are not limited to: * Declarative agent communication and coordination languages * Knowledge-based and knowledge-intensive MAS * Modeling of agent rationality * Declarative approaches to the engineering of MAS * High level agent specification languages * Practical aspects of declarative agent programming and implementation * Formal methods for the specification and verification of MAS * Computational logics in MAS * Argumentation and dialectical systems in MAS * Declarative description of contracts and negotiation issues in MAS * Lessons learned from the design and implementation of MAS * Declarative paradigms for the combination of heterogeneous agents * Constraints and MAS * Declarative representation of policies and security in MAS SUBMISSIONS We welcome and encourage the submission of high quality,=20 original papers, which are not simultaneously submitted for=20 publication elsewhere=2E Papers should be written in English, formatted according to=20 the Springer LNCS style, which can be obtained at=20 (http://www=2Espringer=2Ede/comp/lncs/authors=2Ehtml), and not=20 exceed 16 pages including figures, references, etc=2E Send your paper in PostScript (PS) or Portable Document=20 Format (PDF) to jleite@di=2Efct=2Eunl=2Ept=2E IMPORTANT DATES * Submission, 11 of April, 2003 * Notification, 6 of May, 2003 * Camera Ready, 16 of May, 2003 PROCEEDINGS To encourage and promote the discussion, early and final=20 versions of the accepted papers will be available online,=20 at the workshop's web page, as soon as they are available=2E A printed volume with the proceedings will be available at=20 the workshop=2E Authors of papers presented at the workshop will be asked=20 to extend their contributions, possibly incorporating the=20 results of the workshop discussion, to be included in the=20 workshop post-proceedings=2E Post-proceedings will be published by Springer-Verlag as a=20 volume of the Lecture Notes on Artificial Intelligence=20 series (http://www=2Espringer=2Ede/comp/lncs/index=2Ehtml)=2E PROGRAM COMMITTEE Rafael Bordini, The University of Liverpool, UK Jeff Bradshaw, The University of West Florida, FL, USA Antonio Brogi, Universit=E0 di Pisa, Italy Stefania Costantini, Universit=E0 degli Studi di L'Aquila, Italy Yves Demazeau, Institut IMAG, Grenoble, France J=FCrgen Dix, The University of Manchester, UK Toru Ishida, Kyoto University, Japan Catholijn Jonker, Vrije Universiteit Amsterdam, The Netherlands Antonis Kakas, University of Cyprus, Cyprus Daniel Kudenko, University of York, UK Alessio Lomuscio, King's College, London, UK Viviana Mascardi, DISI, Genova, Italy Paola Mello, Universit=E0 di Bologna, Italy John Jules Ch=2E Meyer, Universiteit Utrecht, The Netherlands Charles L=2E Ortiz, SRI International, Menlo Park, CA, USA Sascha Ossowski, Universidad Rey Juan Carlos, Madrid, Spain Lu=EDs Moniz Pereira, Universidade Nova de Lisboa, Portugal Jeremy Pitt, Imperial College, London, UK Ken Satoh, National Institute of Informatics, Tokyo, Japan Michael Schroeder, City University, London, UK Onn Shehory, IBM Research Lab in Haifa, Israel Carles Sierra, Spanish Research Council, Barcelona, Spain V=2ES=2E Subrahmanian, University of Maryland, MD, USA Francesca Toni, Imperial College, London, UK Wiebe van der Hoek, The University of Liverpool, UK Franco Zambonelli, Universit=E0 di Modena, Italy ORGANIZING COMMITTEE Co-chairs: Jo=E3o Alexandre Leite (Contact Person) Universidade Nova de Lisboa jleite@di=2Efct=2Eunl=2Ept Andrea Omicini Universit=E0 di Bologna aomicini@deis=2Eunibo=2Eit Leon Sterling The University of Melbourne leon@cs=2Emu=2Eoz=2Eau Paolo Torroni Universit=E0 di Bologna ptorroni@deis=2Eunibo=2Eit From tronci@dsi.uniroma1.it Tue Apr 8 11:18:51 2003 From: tronci@dsi.uniroma1.it (Tronci Enrico) Date: Tue, 8 Apr 2003 12:18:51 +0200 Subject: CHARME03 new sbm deadline Message-ID: <200304081018.MAA04493@poppea.dsi.uniroma1.it> ---------------------------------------------------------------------- We apologize if you receive multiple copies of this announcement. ---------------------------------------------------------------------- In response to many requests we extended CHARME 2003 sbm deadline. *********************************************************************** CHARME 2003 NEW SUBMISSION DEADLINE: April 21, 2003 *********************************************************************** CHARME 2003 The 12th Advanced Research Working Conference on: Correct Hardware Design and Verification Methods 21-24 October 2003, University of L'Aquila, L'Aquila, Italy http://www.di.univaq.it/charme2003 Co-sponsored by the IFIP TC10/WG10.5 Working Group on Design and Engineering of Electronic Systems CHARME 2003 is the twelfth in a series of working conferences devoted to the development and use of leading-edge formal techniques and tools for the design and verification of hardware and systems. It has been the aim of the conference to expand its interest to software as well when the technology is related. Previous conferences have been held in Darmstadt, Edinburgh, Grenoble, Glasgow, Leuven, Torino, Arles, Frankfurt, Montreal, and Bad Herrenalb, and Edinburgh. It is the biennial counterpart of FMCAD, which takes place every even year in the USA. The aim of CHARME 2003 is to bring together researchers and users from academia and industry working in this active area of research. The conference will cover original research results, case studies, use of technologies across application domains, and reports on practical experiments. Papers describing original work in all aspects of formal hardware and system design and verification methods are invited. Papers related to formal modeling and verification of concurrent software are also welcome. The event will be held 21-24 October 2003 and hosted by University of L'Aquila, Italy. L'Aquila can be easily reached from Rome Airport. Topics of interest include, but are not limited to: * usage of semi-formal methods (combining simulation methods with formal verification) * high level design modeling languages and high level design constructs * formal verification of hybrid systems * timing verification * formal methods for commercial hardware description languages * correctness preserving transformations * formal synthesis methods * use of theorem provers for verification * BDD and FSM based approaches, including model checking and SAT checking * correctness aspects in HW/SW co-design * abstraction and compositional techniques * formal verification of protocols * diagnosis of design errors * coverage directed verification and other semi-formal verification methods * use of formal specification languages in simulation * formal verification of concurrent software * practical and industrial applications of formal techniques The conference proceedings will appear as a volume in Springer-Verlag's Lecture Notes in Computer Science series and will be available at the conference. Papers should not exceed 15 pages, formatted as specified by Springer-Verlag in the Authors Instructions page, and submitted electronically following the procedure given on the submissions page of the conference website, http://www.di.univaq.it/charme2003. Selected contributions may be invited for publication in STTT (International Journal on Software Tools for Technology Transfer, Springer-Verlag). ****************************************************************************** Author's Schedule: * 11 April 2003 - Deadline for paper submission. Extended to: April 21, 2003 * 6 June 2003 - Notification of acceptance * 11 July 2003 - Deadline for final version ****************************************************************************** Chairs Enrico Tronci (conference chair) (University of Rome, Italy) Daniel Geist (programme chair) (IBM, Israel) ****************************************************************************** Programme Committee Alan Hu (University of British Columbia, Canada) Alan Mycroft (University of Cambridge, UK) Anna Slobodova (Intel, USA) Armin Biere (Swiss Federal Institute of Technology, Switzerland) Byron Cook (Microsoft Corporation, USA) Carl Pixley (Synopsys, USA) Daniel Geist (PC Chair) (IBM, Israel) Dominique Borrione (University of Grenoble, France) Eli Singerman (Intel, Israel) Enrico Tronci (Conference Chair) (University of Rome, Italy) Ganesh Gopalakrishnan (University of Utah, USA) Hans Eveking (T.U. Darmstadt, Germany) John O'Leary (Intel, USA) Ken McMillan (Cadence, USA) Laurence Pierre (University of Marseille, France) Limor Fix (Intel, Israel) Mark Aagaard (University of Waterloo, Canada) Mary Sheeran (Chalmers Univ. and Prover Technology, Sweden) Moshe Vardi (Rice University, USA) Ofer Strichman (Carnegie-Mellon University, USA) Steve Johnson (Indiana University, USA) Thomas Kropf (Bosch, Germany) Tiziana Margaria (Univ. of Dortmund and METAFrame Techn., Germany) Tom Melham (University of Oxford,UK) Warren Hunt (University of Texas at Austin, USA) ****************************************************************************** From Jon.Fairbairn@cl.cam.ac.uk Wed Apr 9 11:10:14 2003 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Wed, 09 Apr 2003 11:10:14 +0100 Subject: Curiosity Message-ID: <2577.1049883014@cl.cam.ac.uk> Is there any reason why the list type is defined in the Report as data [a] = [] | a : [a] deriving (Eq, Ord) rather than data [a] = [] | (:) {head:: a, tail:: [a]} deriving (Eq, Ord) (which would shorten Prelude.List somewhat)? -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From john@repetae.net Wed Apr 9 12:00:43 2003 From: john@repetae.net (John Meacham) Date: Wed, 9 Apr 2003 04:00:43 -0700 Subject: Curiosity In-Reply-To: <2577.1049883014@cl.cam.ac.uk> References: <2577.1049883014@cl.cam.ac.uk> Message-ID: <20030409110043.GB2750@momenergy.repetae.net> because that would imply you could use the record update syntax which you cannot do in haskell. as in: xs = [1,2,3] ys = xs {head = 4} -- bad code John On Wed, Apr 09, 2003 at 11:10:14AM +0100, Jon Fairbairn wrote: > Is there any reason why the list type is defined in the Report as > > data [a] = [] | a : [a] deriving (Eq, Ord) > > rather than > > data [a] = [] | (:) {head:: a, tail:: [a]} deriving (Eq, Ord) > > (which would shorten Prelude.List somewhat)? > > -- > Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk > 31 Chalmers Road jf@cl.cam.ac.uk > Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) > > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > -- --------------------------------------------------------------------------- John Meacham - California Institute of Technology, Alum. - john@foo.net --------------------------------------------------------------------------- From Jon.Fairbairn@cl.cam.ac.uk Wed Apr 9 15:24:19 2003 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Wed, 09 Apr 2003 15:24:19 +0100 Subject: Curiosity In-Reply-To: Your message of "Wed, 09 Apr 2003 04:00:43 PDT." <20030409110043.GB2750@momenergy.repetae.net> Message-ID: <3230.1049898259@cl.cam.ac.uk> On 2003-04-09 at 04:00PDT John Meacham wrote: > because that would imply you could use the record update syntax which > you cannot do in haskell. > > as in: > > xs = [1,2,3] > ys = xs {head = 4} -- bad code But since this is the report we are talking about, were the change made, that would no longer be bad code. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From awfurtado@homelink.com.br Wed Apr 9 19:23:28 2003 From: awfurtado@homelink.com.br (Andre W B Furtado) Date: Wed, 9 Apr 2003 15:23:28 -0300 Subject: Fw: [HOpenGL] Haddock installation question Message-ID: <002f01c2fec5$238f1ff0$0601a8c0@TESTE> I got the following error while trying to compile Haddock (./configure step): error: 'lex' or 'flex' is required to compile GHC >From where can I download 'lex' or 'flex'? Do they come with Cygwin/GHC installation packages? My config is: Windows XP under Cygwin, GHC-5.04.2 Thanks, -- Andre From m.p.donadio@ieee.org Wed Apr 9 19:34:23 2003 From: m.p.donadio@ieee.org (Matthew Donadio) Date: Wed, 09 Apr 2003 14:34:23 -0400 Subject: Fw: [HOpenGL] Haddock installation question References: <002f01c2fec5$238f1ff0$0601a8c0@TESTE> Message-ID: <3E9467AF.28436545@ieee.org> Andre W B Furtado wrote: > I got the following error while trying to compile Haddock (./configure > step): > > error: 'lex' or 'flex' is required to compile GHC > > >From where can I download 'lex' or 'flex'? Do they come with Cygwin/GHC > installation packages? > > My config is: Windows XP under Cygwin, GHC-5.04.2 Flex should be available with Cygwin. Start the Cygwin Net Installer, choose an installation site, and look for flex in with the development applications. Hope this helps. -- Matthew Donadio (m.p.donadio@ieee.org) From ajb@spamcop.net Thu Apr 10 00:54:01 2003 From: ajb@spamcop.net (Andrew J Bromage) Date: Thu, 10 Apr 2003 09:54:01 +1000 Subject: Curiosity In-Reply-To: <3230.1049898259@cl.cam.ac.uk> References: <20030409110043.GB2750@momenergy.repetae.net> <3230.1049898259@cl.cam.ac.uk> Message-ID: <20030409235401.GA22713@smtp.alicorna.com> G'day all. On Wed, Apr 09, 2003 at 03:24:19PM +0100, Jon Fairbairn wrote: > But since this is the report we are talking about, were the > change made, that would no longer be bad code. This actually looks like quite a good change for the post-98 era. Are we taking submissions on the next version yet? Cheers, Andrew Bromage From ashley@semantic.org Thu Apr 10 17:37:58 2003 From: ashley@semantic.org (Ashley Yakeley) Date: Thu, 10 Apr 2003 09:37:58 -0700 Subject: ANNOUNCE: Haskell/Java VM Bridge 0.2 Release Message-ID: <200304101637.JAA28598@mail4.halcyon.com> Release 0.2 of Haskell/Java VM Bridge is now available in source-code form. New in Version 0.2: Haskell: * 'Haskell' now a separate Autotools project installing in /usr/lib/jvm-bridge/ * New array region access functions * Correct array types in autogenerated class interfaces * Subtype parameters in autogenerated class interfaces * VMLayer 'env' parameter now implicit * Various changes in the BasicLayer * new native StartExecuteFunction function called by getExecuteFunctionClass, defineCallbackClass Native: * Mac OS X support * Beginnings of MinGW32/Cygwin support * New Sun 1.4 JVM * Now installs in /usr/lib/jvm-bridge/ * ExecuteFunction bindings now done at run-time Haskell/Java VM Bridge allows Haskell programs access to the Java Virtual Machine. It comes in two parts: the 'Native' part, that abstracts away differences in the various Java VMs, and the 'Haskell' part that provides a Haskell API. The Native part is not Haskell-specific, and could potentially be used by other languages wishing to access the Java VM. Features include: * Calling of Java methods, access to fields, array-handling; * Integration of garbage collectors; * Reconciliation of exception models; * Reconciliation of thread models, including 'synchronized' monitor support and the ability to fork Haskell actions as Java threads; * Strong typing for Java classes and method argument lists (as tuples), and use of Haskell lists as arrays; * Creation of Java classes 'on the fly' (using DefineClass and the Java Class File Format) that can have Haskell callback methods; * Lifted monads which do all the necessary JNI class and method/field ID preloading and 'JNIEnv'-pointer variable handling for you -- these can be automatically generated via a tool (MakeJVMModule); * Layered design includes lower-level IO-based interface; * Automatic generation of modules for Java API classes; * All relevant imports, flags and libraries etc. handled by a single GHC package 'javavm'; * No 'unsafe' Haskell calls or pure function FFI anywhere; * Easy to port to new Java VMs. This release should be 'beta' quality, but has undergone little testing. You will need: * An x86 machine running some form of Unix, or a Mac OS X machine; * GHC 5.02.4 or later; In particular, GHC 5.02.2 and earlier will not work on Mac OS X. * A Java VM. It's been tested only with Sun's JVM, but should (may?) work with a number of others. Haddock documentation is currently blocked on a bug in Haddock ("implicit parameters"). Should that be fixed, you will be able to build API documentaion by doing "make doc". Some simple examples have been included such as a program that shows a Java Frame containing an instance of a Haskell-defined subclass of Canvas that has a Haskell 'paint' method that draws an oval. You should be able to figure out most of it from that. Haskell/JVM Bridge and source code is licensed under the GNU Lesser GPL. Future plans: * port to Cygwin * use hierarchical module structure * separate out pure (non-FFI) Haskell into a separate package * better typing for the IO-based layer -- Ashley Yakeley, Seattle WA Almost empty page: From sulzmann@comp.nus.edu.sg Fri Apr 11 10:42:43 2003 From: sulzmann@comp.nus.edu.sg (Martin Sulzmann) Date: Fri, 11 Apr 2003 17:42:43 +0800 (GMT-8) Subject: ANNOUNCE: New Chameleon relase Message-ID: <16022.36095.741289.168072@sf0.comp.nus.edu.sg> New features: * Interactive Debugging in Haskell See http://www.comp.nus.edu.sg/~sulzmann/chameleon/ for details. Martin From joe@informatik.uni-leipzig.de Fri Apr 11 12:13:25 2003 From: joe@informatik.uni-leipzig.de (Johannes Waldmann) Date: Fri, 11 Apr 2003 13:13:25 +0200 (MET DST) Subject: setenv? Message-ID: We have System.getEnv - is there setEnv as well? in System? in Posix? -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/207 -- From per@L4i.se Fri Apr 11 13:52:28 2003 From: per@L4i.se (Per Larsson) Date: Fri, 11 Apr 2003 14:52:28 +0200 Subject: setenv? In-Reply-To: References: Message-ID: <200304111452.29131.per@L4i.se> On Friday 11 April 2003 13.13, Johannes Waldmann wrote: > We have System.getEnv - is there setEnv as well? in System? in Posix? In module Posix you have: setEnvironment, getEnvironment, setEnvVar, getEnvVar and removeEnvVar. Cheers Per From Steven.Krauwer@let.uu.nl Wed Apr 9 16:05:11 2003 From: Steven.Krauwer@let.uu.nl (Steven Krauwer) Date: Wed, 9 Apr 2003 17:05:11 +0200 Subject: CfP: ELSNET/ENABLER Resources Infrastructure Workshop at ACL2003 Message-ID: <20030409170511.A15232@syntax.let.uu.nl> ACL2003 Resources Information Infrastructure Workshop _________________________________________________________________ Last CALL for PAPERS Towards a Resources Information Infrastructure Workshop at ACL2003 in Sapporo (Japan) July 11 and 12 2003 Organised by ENABLER / ELSNET Description The problem addressed by this workshop is the well-known information problem. People are creating, exploring and exploiting language resources all over the world. Those who are working with resources know a lot about their own and other resources, and they are generally prepared to share this knowledge, their expertise and in many cases even their resources with others via publications in journals, presentations at conferences, and via the web. Unfortunately this information, however public, is not accessible in any systematic way for those who need resources, who want to know what sort of resources exist, how resources should be annotated, which standards to adhere to, which tools to use, etc etc. We will call this problem the 'Resources Information Problem'. The problem has also a geographical dimension: As work on specific languages is very often concentrated in specific parts of the world, much relevant information has a tendency to stay in one geographical place. This is an obstacle for those who are working on these same languages in different parts of the world, and it makes it harder to port knowledge and expertise gained on one language to other languages. The above observation are far from novel, and it would be naive to think that the problems will ever go away. At the same time one can observe that there are organisations (associations, agencies, projects, networks, etc) that have access to parts or fragments of this information and that have their own infrastructures that facilitate access to this information by internal or external people. The purpose of this workshop is to investigate how we can exploit the existing infrastructures to a maximum in order to facilitate world-wide access to information on language resources. The role of the workshop will be to bootstrap this process. Approach * First of all we will try to make an initial map of the language resources landscape world-wide. This map will include actors, organisations, repositories, standards, projects, tool libraries, etc etc. All participants will be asked beforehand to submit pointers to such items. They will be collected and published. * At the workshop we will invite representatives of a number of organisations that can be seen as key actors in the field, and they will be asked to present ideas about the way their organisation could contribute to solving the Resources Information Problem. These ideas could range from very concrete and immediately implementable proposals to longer term and visionary actions. * A round table discussion at the workshop will aim at the creation of convergence, coherence and synergies between the proposed actions. The intended output is a catalogue of actions to facilitate access to resources information that could be implemented (almost) immediately, a skeleton plan for longer term actions, and firm commitment from key players to make these things happen. Target audience Representatives of parties that could play a key role in providing access to resources information, such as (but not limited to) * Resources distribution agencies, e.g. LDC and ELDA/ELRA * Professional organisations, e.g. ACL, ISCA, and their regional branches, e.g. EACL, AACL, JACL, Asian NLP federation * Networks and resources infrastructure projects, e.g. ENABLER, ISLE. ELSNET * Committees, e.g. ICWLR, COCOSDA * National resources or infrastructure projects, e.g. Technolangue, Collate * International actions, e.g. OLAC * Researchers and developers interested in improving the language resources infrastructure for our community Invited and submitted papers We expect to invite some 15 representatives to give their presentations, but in addition we are issuing an open call for papers addressing the resources information problem and possible solutions. These papers will be reviewed in the usual way. Submission format Please submit full papers of maximum 8 pages (including references, figures etc). Authors should follow the main conference ACL style format. Electronic submission only. Send the pdf, postscript, or MS Word form of your submission to: Steven Krauwer (steven.krauwer@elsnet.org) who will also answer any queries regarding the submission. Important Dates Submission deadline for workshop papers: 13 April 2003 Notification of accepted papers: 14 May 2003 Deadline for camera ready copies 29 May 2003 Workshop dates: 11-12 July 2003 Workshop Format It will be a two-day workshop, with invited and submitted presentations in the mornings, and topical panels and round table discussion in the afternoons, including an open meeting of the newly created International Coordination Committee for Written Language Resources. Programme Committee As this workshop is jointly organized by ELSNET and ENABLER (two EU funded projects aimed at providing collaboration infrastructures), we have invited all ca 60 members of the ELSNET and ENABLER Boards to constitute the core programme committee. We may want to invite additional members from Asia and other parts of the world in order to ensure sufficient geographical coverage. A full list of PC members will be published on the workshop website at http://www.elsnet.org/acl2003-workshop The workshop will be jointly chaired by Steven Krauwer (ELSNET) and Nicoletta Calzolari/Antonio Zampolli (ENABLER) Historical note This workshop can be seen as a follow-up of the workshop organised at ACL2000 in Hong Kong, entitled 'Towards infrastructures for global collaboration'. One of the conclusions of this workshop was that the field of language resources would offer good opportunities for collaborative actions, and the first concrete goal was the creation of an international resources federation, a first step towards which is now embodied by the proposal to set up an International Committee for Written Language Resources. The workshop should lead to the definition of concrete actions to be carried out under the auspices of ICWLR, in collaboration with other organisations. Contact info Steven Krauwer (steven.krauwer@elsnet.org), ELSNET (http://www.elsnet.org) From nr@eecs.harvard.edu Fri Apr 11 15:34:52 2003 From: nr@eecs.harvard.edu (Norman Ramsey) Date: Fri, 11 Apr 2003 10:34:52 -0400 (EDT) Subject: seeking lore of the QuickCheck masters Message-ID: <20030411143452.7311E4051@labrador.eecs.harvard.edu> I am playing around with an implementation of a little language, and I would like to use QuickCheck to test my code. My problem is that I want to test only well-typed terms. I don't know how to craft my `arbitrary' functions so that the probability of generating a well-typed term is more than vanishingly small. Can anybody pass on interesting tips and tricks that might help? Norman From slucas@dsic.upv.es Fri Apr 11 17:24:32 2003 From: slucas@dsic.upv.es (Salvador Lucas) Date: Fri, 11 Apr 2003 17:24:32 +0100 Subject: RDP'03 - Call for participation Message-ID: <3E96EC3C.46526B0A@dsic.upv.es> [Apologies for multiple copies of this announcement] ****************************************************************** ****************** Call for participation ****************** ****************************************************************** Federated Conference on Rewriting, Deduction and Programming (RDP) including RTA - TLCA - FTP - IFIP WG 1.6 - RULE - UNIF - WFLP - WRS - WST http://www.dsic.upv.es/~rdp03 Valencia, Spain, June 8 - 14, 2003 ------------------------------------------------------------------ We are pleased to announce that the registration and hotel reservation procedures for attending RDP 2003 are open now. Please, follow this link http://www.dsic.upv.es/~rdp03/org/registration_info.html to formalize your registration. A number of rooms have been booked in various hotels near the Conference venue. Please remember that the number of rooms is limited. Requests will be processed on a first come first served basis and will be subject to space availability. Please, follow this link http://www.dsic.upv.es/~rdp03/org/hotel_info.html to eventually formalize your accomodation in one of such hotels. IMPORTANT: The deadline for early registration/accomodation is M a y 1 5, 2 0 0 3 RDP 2003 will take place at the ADEIT building of the "Fundacio Universitat Empresa de Valencia": Plaza Virgen de la Paz, 3 E-46001 Valencia Spain Please, look at the conference WWW site for further travelling information (available soon). The conference will be hosted by the Departamento de Sistemas Informaticos y Computacion (DSIC) at the Universidad Politecnica de Valencia. PARTICIPANTS 14th Int. Conf. on Rewriting Techniques and Applications, RTA'03 6th Int. Conf. on Typed Lambda Calculi and Applications, TLCA'03 4th Int. Workshop on First Order Theorem Proving, FTP'03 IFIP Working Group 1.6 on Term Rewriting 4th Int. Workshop on Rule Based Programming, RULE'03 17th Int. Workshop on Unification, UNIF'03 12th Int. Workshop on Functional and (Constraint) Logic Prog., WFLP'03 3rd Int. Workshop on Red. Strat. in Rewriting and Programming, WRS'03 6th Int. Workshop on Termination, WST'03 DATES RDP : June 8 - 14, 2003 RTA'03 : June 9 - 11 TLCA'03: June 10 - 12 FTP'03 : June 12 - 14 WG 1.6 : June 12 RULE'03: June 9 UNIF'03: June 8 - 9 WFLP'03: June 12 - 13 WRS'03 : June 8 WST'03 : June 13 - 14 ORGANIZERS The ELP group at the Universidad Politecnica de Valencia Officials: Salvador Lucas (chair of the organizing committee) Maria Alpuente (workshops chair) Jose Hernandez (local arrangements) Javier Oliver (secretary) Maria Jose Ramirez (local arrangements chair) German Vidal (publicity chair) CONTACT Salvador Lucas Departamento de Sistemas Informaticos y Computacion (DSIC) Universidad Politecnica de Valencia Camino de Vera, s/n E-46022 Valencia (Spain) phone: + 34 96 387 7353 (73531) fax: + 34 96 387 7359 e-mail: slucas@dsic.upv.es URL: http://www.dsic.upv.es/users/elp/slucas.html FURTHER INFORMATION RDP website: http://www.dsic.upv.es/~rdp03 The ELP group: http://www.dsic.upv.es/users/elp/elp.html ****************************************************************** From voigt@tcs.inf.tu-dresden.de Mon Apr 14 08:15:21 2003 From: voigt@tcs.inf.tu-dresden.de (Janis Voigtlaender) Date: Mon, 14 Apr 2003 09:15:21 +0200 Subject: Summer School and Workshop on Proof Theory, Computation and Complexity - Announcement Message-ID: <3E9A6009.20275FA3@tcs.inf.tu-dresden.de> Summer School and Workshop on Proof Theory, Computation and Complexity Technische Universitaet Dresden June 23-July 4, 2003 Preliminary Program and Call for Participation We plan the following courses and workshop for graduate students and researchers. Like for last year's events on Proof Theory and Computation (Dresden) and Proof, Computation, Complexity (Tuebingen), we aim at a meeting where people have plenty of time to exchange ideas. The summer school consists of eight advanced courses; the workshop takes place in the last two days. For participating in the summer school we ask for a small fee (currently undetermined). We are looking into the possibility of providing grants to participants who ask for them. Registration is requested, please send an email to , making sure you include a very brief bio (5-10 lines) stating your experience, interests, home page, etc. We will select applicants in case of excessive demand. We will provide assistance in finding an accommodation in Dresden. Week 1, June 23-27: courses on Denotational Semantics of Lambda Calculi Achim Jung (Birmingham, UK) Proof Theory with Deep Inference Alessio Guglielmi (Dresden, Germany) Five Lectures on Proof-Analysis Sara Negri (University of Helsinki and Academy of Finland) Mass Problems Stephen Simpson (Penn State, USA) Week 2, June 30-July 2: courses on Natural Deduction: Some Recent Developments Jan von Plato (Helsinki, Finland) Semantics and Cut-elimination for Church's (Intuitionistic) Theory of Types, with Applications to Higher-order Logic Programming Jim Lipton (Wesleyan, USA) Dependent Type Theories Peter Aczel (Manchester, UK) Term-rewriting and Termination in Proof Theory Roy Dyckhoff (St Andrews, Scotland) July 3-4: workshop (consult the web site for details) Dresden, on the river Elbe, is one of the most important art cities of Germany. You can find world-class museums and wonderful architecture and surroundings. We will organize trips and social events. This program is still subject to variation, please check the web site. Please distribute this message broadly. From cedgar_@hotmail.com Fri Apr 11 19:51:28 2003 From: cedgar_@hotmail.com (edgar cubides) Date: Fri, 11 Apr 2003 13:51:28 -0500 Subject: Help Support Message-ID: Hi, i'm doing my undergraduate project about a HUGS tool. I have right now the following components: - A software client/server that is compilable on runHUGS. The problem is if i compile this software using GHC, can i run it on line.? How can i do this? I apreciate any documentation about it. Thanks for your time. _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From luzm@comp.nus.edu.sg Mon Apr 14 06:49:12 2003 From: luzm@comp.nus.edu.sg (Kenny Lu Zhuo Ming) Date: Mon, 14 Apr 2003 13:49:12 +0800 Subject: update fun->pdf? Message-ID: <002101c30249$952edb50$22528489@comp.nus.edu.sg> This is a multi-part message in MIME format. ------=_NextPart_000_001E_01C3028C.A1CF72F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I've found that the fun->pdf link in www.haskell.org/libraries/ broken, = does anyone know whether there=20 is an update of it? or any other library that equivalent? Regards, Kenny ------=_NextPart_000_001E_01C3028C.A1CF72F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi all,
 
I've found that the fun->pdf link in = www.haskell.org/libraries/= =20 broken, does anyone know whether there=20
is an update of it? or any other = library that=20 equivalent?
 
Regards,
Kenny
------=_NextPart_000_001E_01C3028C.A1CF72F0-- From m.p.donadio@ieee.org Mon Apr 14 14:30:21 2003 From: m.p.donadio@ieee.org (Matthew Donadio) Date: Mon, 14 Apr 2003 09:30:21 -0400 Subject: update fun->pdf? References: <002101c30249$952edb50$22528489@comp.nus.edu.sg> Message-ID: <3E9AB7ED.1553FBF1@ieee.org> > I've found that the fun->pdf link in www.haskell.org/libraries/ > broken, does anyone know whether there > is an update of it? or any other library that equivalent? Try looking for it in http://www.archive.org/ I recovered some of Jan's other libraries using the Wayback Machine. -- Matthew Donadio (m.p.donadio@ieee.org) From simons@cryp.to Mon Apr 14 18:31:06 2003 From: simons@cryp.to (Peter Simons) Date: 14 Apr 2003 19:31:06 +0200 Subject: Arrows and the IO monad Message-ID: <87ptnpgf51.fsf@peti.cryp.to> Hi, after reading the excellent paper "Generalising Monads to Arrows" from John Hughes, I am trying to use an arrow-based stream processor of type 'SP a b' to implement a network daemon. So far I have defined the arrow successfully: > data SP a b = Put b (SP a b) > | Get (a -> SP a b) > | Null > deriving (Show) > > instance Arrow SP where > arr f = get (\x -> put (f x) (arr f)) > > _ >>> Null = Null > sp1 >>> Put c sp2 = Put c (sp1 >>> sp2) > Null >>> Get _ = Null > Put c sp1 >>> Get f2 = sp1 >>> f2 c > Get f1 >>> Get f2 = Get (\c -> f1 c >>> Get f2) > > first f = bypass [] f > where > bypass ds (Get f) = Get (\(b,d) -> bypass (ds ++ [d]) (f b)) > bypass [] (Put c sp) = Get (\(_,d) -> Put (c,d) (bypass [] sp)) > bypass (d:ds) (Put c sp) = Put (c,d) (bypass ds sp) But now I have to make the stream processors interact with the IO monad, because I want the actual reading and writing to take place in the processor arrow. Is there any good way to achieve that without being forced to use the type 'SP (IO a) (IO b)' throughout the arrow? Can I maybe split the data flow for simple non-IO processors off the I/O monad temporarily? Or is there a way to combine my SP arrow with the IO monad in way that IO actions can be lifted to my SP arrow? Can anyone recommend some further reading material concerning this topic? Any feedback is appreciated! Peter From Malcolm.Wallace@cs.york.ac.uk Tue Apr 15 11:40:25 2003 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Tue, 15 Apr 2003 11:40:25 +0100 Subject: seeking lore of the QuickCheck masters In-Reply-To: <20030411143452.7311E4051@labrador.eecs.harvard.edu> References: <20030411143452.7311E4051@labrador.eecs.harvard.edu> Message-ID: <20030415114025.0f004774.Malcolm.Wallace@cs.york.ac.uk> nr@eecs.harvard.edu (Norman Ramsey) writes: > I am playing around with an implementation of a little language, > and I would like to use QuickCheck to test my code. My problem is > that I want to test only well-typed terms. I don't know how to craft > my `arbitrary' functions so that the probability of generating a well-typed > term is more than vanishingly small. Can anybody pass on interesting > tips and tricks that might help? You want a generator that can produce an arbitrary code fragment, *given* what type you want it to have. So first, generate an arbitrary type, then generate an arbitrary expression for it. Assuming that your little language is sort-of functional, then to generate a code fragment for a given type, say Int, you might have the following choices: * Generate a literal value :: Int * Generate a conditional. e.g. if then else * Generate a case. e.g. case of -> -> * and so on for other language constructs. * Generate an application of a unary function :: ArbitraryType a => a -> Int or perhaps :: ArbitraryTypeInvolving Int a => a -> Int to a value of the constrained type. * Generate an application of a binary function :: (ArbitraryType a) => a -> (a -> Int) or :: (ArbitraryType a, ArbitraryType b) => a -> (b -> Int) or :: (ArbitraryTypeInvolving Int a) => a -> (a -> Int) or :: (ArbitraryTypeInvolving Int a, ArbitraryType b) => a -> (b -> Int) or :: (ArbitraryTypeInvolving Int b, ArbitraryType a) => a -> (b -> Int) to a value of the constrained type. * and so on for more complex types. It is quite a lot trickier than this little sketch, I'm sure, but I hope this helps to spark some more ideas. Regards, Malcolm From Keith.Wansbrough@cl.cam.ac.uk Tue Apr 15 12:36:43 2003 From: Keith.Wansbrough@cl.cam.ac.uk (Keith Wansbrough) Date: Tue, 15 Apr 2003 12:36:43 +0100 Subject: update fun->pdf? In-Reply-To: Your message of "Mon, 14 Apr 2003 09:30:21 EDT." <3E9AB7ED.1553FBF1@ieee.org> Message-ID: > > I've found that the fun->pdf link in www.haskell.org/libraries/ > > broken, does anyone know whether there > > is an update of it? or any other library that equivalent? > > Try looking for it in > > http://www.archive.org/ > > I recovered some of Jan's other libraries using the Wayback Machine. If you do this, please place a copy on your own page so that it's preserved for others. Even better, arrange for a "(now available at...)" link to be added to the haskell.org page. We can't rely on the Wayback Machine being there forever. Thanks. --KW 8-) From Keith.Wansbrough@cl.cam.ac.uk Wed Apr 16 13:49:02 2003 From: Keith.Wansbrough@cl.cam.ac.uk (Keith Wansbrough) Date: Wed, 16 Apr 2003 13:49:02 +0100 Subject: ANNOUNCE: HaWiki, the Haskell Wiki Message-ID: Hi all... following recent discussions, the Haskell Wiki has been upgraded. It is now running MoinMoin http://moin.sourceforge.net/, and has been renamed HaWiki. You can access it from the Haskell homepage, http://www.haskell.org, or directly at http://www.haskell.org/hawiki/ The old Wiki has been replaced by a redirection page; this is intentionally not automatic. Please update your old links. All the old content has been copied across (as of about an hour ago). The following have been lost: * external [1]-style links. * some formatting * the change history Please could people look at the various pages, and fix any problems they find, or let me know directly. I expect the new wiki to be *much* more stable than the old one, but let me know if there are any problems. The new Wiki has many more features, and looks a lot cooler. I hope it will continue to be a useful resource for the Haskell community. As the front page says, A WikiWikiWeb is a collaborative hypertext environment, with an emphasis on easy access to and modification of information. Everyone should feel free to add pages and information. This should be a repository for answers to all FAQs, for useful code fragments and techniques, for discussion and documents related to Haskell projects, and so on. Cheers, --KW 8-) -- Keith Wansbrough http://www.cl.cam.ac.uk/users/kw217/ University of Cambridge Computer Laboratory. From magnus@cse.ogi.edu Wed Apr 16 01:40:49 2003 From: magnus@cse.ogi.edu (Magnus Carlsson) Date: Tue, 15 Apr 2003 17:40:49 -0700 Subject: Arrows and the IO monad In-Reply-To: <87ptnpgf51.fsf@peti.cryp.to> References: <87ptnpgf51.fsf@peti.cryp.to> Message-ID: <16028.42641.754332.600943@silica.cse.ogi.edu> Hi Peter, One possibility is to add a constructor that deals with I/O to the data type for stream processors. You can read about it at http://www.cs.chalmers.se/~hallgren/Thesis/fudgets-implementation.html#fudgets-on-monadIO The extended type is called F' there: data F' i o = PutF o (F' i o) | GetF (i -> F' i o) | NullF | DoIoF (IO (F' i o)) and one way to perform IO operations inside a stream processor is suggested by: doIoF :: IO a -> (a -> F' i o) -> F' i o doIoF io c = DoIoF (fmap c io) Hope this helps, /M Peter Simons writes: > Hi, > > after reading the excellent paper "Generalising Monads to Arrows" from > John Hughes, I am trying to use an arrow-based stream processor of > type 'SP a b' to implement a network daemon. So far I have defined the > arrow successfully: > > > data SP a b = Put b (SP a b) > > | Get (a -> SP a b) > > | Null > > deriving (Show) > > > > instance Arrow SP where > > arr f = get (\x -> put (f x) (arr f)) > > > > _ >>> Null = Null > > sp1 >>> Put c sp2 = Put c (sp1 >>> sp2) > > Null >>> Get _ = Null > > Put c sp1 >>> Get f2 = sp1 >>> f2 c > > Get f1 >>> Get f2 = Get (\c -> f1 c >>> Get f2) > > > > first f = bypass [] f > > where > > bypass ds (Get f) = Get (\(b,d) -> bypass (ds ++ [d]) (f b)) > > bypass [] (Put c sp) = Get (\(_,d) -> Put (c,d) (bypass [] sp)) > > bypass (d:ds) (Put c sp) = Put (c,d) (bypass ds sp) > > But now I have to make the stream processors interact with the IO > monad, because I want the actual reading and writing to take place in > the processor arrow. Is there any good way to achieve that without > being forced to use the type 'SP (IO a) (IO b)' throughout the arrow? > > Can I maybe split the data flow for simple non-IO processors off the > I/O monad temporarily? > > Or is there a way to combine my SP arrow with the IO monad in way that > IO actions can be lifted to my SP arrow? > > Can anyone recommend some further reading material concerning this > topic? > > Any feedback is appreciated! > > Peter > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell From haskellmail@yahoo.com.sg Thu Apr 17 09:26:56 2003 From: haskellmail@yahoo.com.sg (Kenny Lu Zhuo Ming) Date: Thu, 17 Apr 2003 16:26:56 +0800 Subject: compilation problem in glibc 2.3.2-27.9 RedHat 9 Message-ID: <004401c304bb$26017110$22528489@comp.nus.edu.sg> This is a multi-part message in MIME format. ------=_NextPart_000_0041_01C304FE.29D42880 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, recently I've upgraded my RedHat box from 8 to 9. This immediately gave = rise to a lot of problem due to incompatibility (I guess). When I try to = compile my haskell library, for example (HaXml), it halted with this = error message /usr/local/lib/ghc-5.02.3/libHSrts.a(RtsFlags.o)(.text+0x1b0): In = function `setupRtsFlags': : undefined reference to `__ctype_b' collect2: ld returned 1 exit status I then try to recompile my ghc from source, the compilation terminates = with the same error. for which I thought it is due to update on static links from glibc = version 2.2 to 2.3. But I think this has already been fixed by some = previous version.=20 This problem is resolved until I reverted my glibc package back to = 2.3.2-4.80 Any of you have ever encoutered the same issue? Regards, Kenny ------=_NextPart_000_0041_01C304FE.29D42880 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
recently I've upgraded my RedHat box = from 8 to 9.=20 This immediately gave rise to a lot of problem due to incompatibility (I = guess). When I try to compile my haskell library, for example = (HaXml), it=20 halted with this error message
 
 
/usr/local/lib/ghc-5.02.3/libHSrts.a(RtsFlags.o)(.text+0x1b0): = In=20 function `setupRtsFlags':
: undefined reference to = `__ctype_b'
collect2:=20 ld returned 1 exit status
 
I then try to recompile my ghc from = source, the=20 compilation terminates with the same error.
 
for which I thought it is due to update on static links from glibc = version=20 2.2 to 2.3. But I think this has already been fixed by some previous = version.=20
 
This problem is resolved until I reverted my glibc package back to=20 2.3.2-4.80
 
Any of you have ever encoutered the same issue?
 
Regards,
Kenny
------=_NextPart_000_0041_01C304FE.29D42880-- From c_minoli@hotmail.com Fri Apr 18 16:56:51 2003 From: c_minoli@hotmail.com (Cesar Augusto Acosta Minoli) Date: Fri, 18 Apr 2003 15:56:51 +0000 Subject: Help! catching a (1.#QNaN) Message-ID:
Hi
I would like to catch when my code produce a QNAN "Quiet Not a Number" (I'm working with Float Numbers) . I founded in Prelude Module  the function "IsNaN" but, it doesn't Work. (it returns FALSE in all cases).
So, anybody Knows how detect a QNaN in Haskell?
Cesar Acosta


Help STOP SPAM with the new MSN 8 and get 2 months FREE* From mark@chaos.x-philes.com Fri Apr 18 20:02:39 2003 From: mark@chaos.x-philes.com (Mark Carroll) Date: Fri, 18 Apr 2003 15:02:39 -0400 (EDT) Subject: Help! catching a (1.#QNaN) In-Reply-To: Message-ID: On Fri, 18 Apr 2003, Cesar Augusto Acosta Minoli wrote: > I would like to catch when my code produce a QNAN "Quiet Not a Number" > (I'm working with Float Numbers) . I founded in Prelude Module=A0 the > function "IsNaN" but, it doesn't Work. (it returns FALSE in all cases). > So, anybody Knows how detect a QNaN in Haskell? What do you mean, "it doesn't Work"? Can you give an example of short Haskell code from which you expect SNaNs and QNaNs so we can try them out and play? Which Haskell compiler on which architecture are you using? I find that, for example, isNaN (0/0) is True in GHC and False in Hugs on Linux, which is mildly surprising - I thought it should always be true? -- Mark From oleg@pobox.com Sun Apr 20 23:25:12 2003 From: oleg@pobox.com (oleg@pobox.com) Date: Sun, 20 Apr 2003 15:25:12 -0700 (PDT) Subject: Polymorphic stanamically balanced binary trees Message-ID: <200304202225.h3KMPCOH066923@adric.fnmoc.navy.mil> We present a datatype of polymorphic binary trees. Nodes within a single tree can have values of arbitrary types. The tree data structure is subjected to a balancing constraint: for each non-leaf node, the heights of its two children can differ at most by one. Here, by definition the height of a node is 1 + max of the heights of its children. A leaf node has the height of 0. The main feature of the present approach is a blended static and dynamic enforcement of the balancing constraint. Whenever possible, the typechecker verifies the constraint and flags an attempt to make an unbalanced tree as a type error. A user cannot construct an unbalanced tree by composing make_leaf and make_node constructors. This static enforcement of a dependent type constraint is good. However, it's obviously limited. To verify type constraints, the compiler needs to see the entire chain of constructor applications. That chain however may not be not known until the run time -- and it can depend on external conditions. How can we guarantee that a program that builds binary trees from user input data will not return an unbalanced tree? How can we typecheck a function that builds a tree recursively, with the recursion depth unknown until the run-time. Obviously, a run-time check is needed. The following code shows a simple approach to a combined static and dynamic checking. By default, a static check is enforced. If the user cannot placate the typecheker, who keeps complaining about infinite types, the user can delay the check until the run time, by staging the typecheck. We enclose the dependent type into an existential envelope to be opened and checked later. To the end user, all these machinations are more or less transparent. To build nodes, the user will invoke the same function, make_node. The latter does a static check, if it can. Otherwise, it defers the check till the run time. Another feature of the following code is an undefined arithmetics. We can increment and compare undefined values, provided they are appropriately typed. In fact, the height of our tree data structure is represented by bottom. The following snippet from a uvaluator demonstrates an undefined type subtraction: instance (UNUM u) => UNUM (Succ u) where uval _ = 1 + (uval (undefined::u)) Finally, yet another feature of the code is polymorphic recursion, which specifically bypasses the monomorphic restriction. I should point out a particularly apt error message that I received from GHCi: langs/Haskell/statically-balanced-trees.hs:63: My brain just exploded. I can't handle pattern bindings for existentially-quantified constructors. In the binding group (BU (cv :: ct)) = check (uval au) (uval bu) In the definition of `heightc': let (BU (cv :: ct)) = check (uval au) (uval bu) in BU $ (undefined :: Succ ct) It happened around midnight, when I was quite exhausted already. I typed ":r", read the first line of the message "My brain just exploded." and said, "Yeah, tell me about it...". And then I jumped from the chair, having realized what I've been talking with. BTW, I replaced 'let' with 'case' and the error disappeared. Incidentally, this code gives another example of the undefined arithmetics: incrementing the type of an existential bottom. The literate Haskell code follows. To run it, do ghci -fglasgow-exts -fallow-undecidable-instances /tmp/code-file.lhs To verify the balancing condition at compile type, we need an appropriate arithmetic type. We chose the following. We should stress that Zero and Succ are type constructors. There are no data constructors. In fact, those types have no values except the bottom. > data Zero > data Succ a > type One = Succ Zero > > class UNUM u where > uval:: u -> Int Note that uval converts a type to a value. We can apply uval to undefined and get the right answer, provided that undefined is typed appropriately. > instance UNUM Zero where > uval _ = 0 > instance (UNUM u) => UNUM (Succ u) where > uval _ = 1 + (uval (undefined::u)) The following datatype BU is a run-time representation of UNUMs. All UNUM types have the same value: the bottom. Therefore, the BU value represents UNUM's type without the value of the latter. We might suppose that BU is quite compact: it only needs to keep track of the enclosed type without worrying about the enclosed value. > data BU = forall u. (UNUM u) => BU u Incidentally, the following function umake is the inverse of uval. The function uval converts a UNUM type to an Int value. The function umake goes the other way around: from values to types. The function demonstrates the type arithmetics in a value form. We create and deconstruct types, whereas the value remains the same: undefined. We should also point out that umake implements a polymorphic recursion, getting around the monomorphic restriction. > umake 0 = BU (undefined::Zero) > umake n = case (umake (n-1)) of (BU (x::z)) -> BU $ (undefined::(Succ z)) > --test: case (umake 5) of (BU x) -> uval x The following class HeightC expresses the balancing constraint. The class and its instances do both static and dynamic checks. > class HeightC lheight rheight pheight | lheight rheight -> pheight where > heightc:: lheight -> rheight -> (Bool,pheight) > heightc a b = (True,(undefined::pheight)) > -- The static portion of the constraint > instance HeightC Zero Zero (Succ Zero) > instance HeightC (Succ h) (Succ h) (Succ (Succ h)) > instance HeightC h (Succ h) (Succ (Succ h)) > instance HeightC (Succ h) h (Succ (Succ h)) The following instance does a dynamic check. It opens existential envelopes with deferred types, does the check, and puts the result back into the envelope. In a manner of speaking, we stage the typecheck. > instance HeightC BU BU BU where > heightc a@(BU au) b@(BU bu) = > case check (uval au) (uval bu) of > (BU (cv::ct)) -> (True, BU $ (undefined::(Succ ct))) > where > check av bv | av == bv = a > check av bv | av == (bv + 1) = a > check av bv | bv == (av + 1) = b The following declarations introduce the polymorphic tree datatype. > data Nil = Nil deriving Show > data Leaf v h l r = Leaf v h > data Node v h l r = Node v h l r > > class BBTree ntype vtype ht lchildtype rchildtype where > left:: ntype vtype ht lchildtype rchildtype -> lchildtype > right:: ntype vtype ht lchildtype rchildtype -> rchildtype > is_leaf:: ntype vtype ht lchildtype rchildtype -> Bool > value:: ntype vtype ht lchildtype rchildtype -> vtype > reheight::(UNUM ht) => > ntype vtype ht lchildtype rchildtype -> > ntype vtype BU lchildtype rchildtype > height:: ntype vtype ht lchildtype rchildtype -> ht > height _ = (undefined::ht) > > -- A statically-typed leaf > instance BBTree Leaf vtype Zero Nil Nil where > value (Leaf v h) = v > is_leaf = const True > reheight (Leaf v h) = (Leaf v (BU h)) > > -- A dynamically-typed leaf > instance BBTree Leaf vtype BU Nil Nil where > value (Leaf v h) = v > is_leaf = const True > height (Leaf v h) = h > > -- A stanamically-typed node > instance BBTree Node vtype height lchildtype rchildtype where > is_leaf = const False > value (Node v h a b) = v > left (Node v h a b) = a > right (Node v h a b) = b > reheight (Node v h a b) = (Node v (BU h) a b) > height (Node v h a b) = h Constructors: > make_leaf:: vtype -> Leaf vtype Zero Nil Nil > make_leaf v = Leaf v (undefined::Zero) > > make_node:: (BBTree lnt lvt lh cl cr, BBTree rnt rvt rh cl' cr', > HeightC lh rh ph) > => vtype -> (lnt lvt lh cl cr) -> (rnt rvt rh cl' cr') -> > Node vtype ph (lnt lvt lh cl cr) (rnt rvt rh cl' cr') > make_node v l r = let (c,h) = heightc (height l) (height r) > in if c then Node v h l r else error "balance error" Let's make our trees instances of a class Show, so we have something to show. > instance (Show vtype, BBTree Leaf vtype height Nil Nil) => > Show (Leaf vtype height Nil Nil) > where > show = show . value > > instance (Show vtype, BBTree Node vtype height lchildtype rchildtype, > Show lchildtype, Show rchildtype) > => > Show (Node vtype height lchildtype rchildtype) > where > show x = "[" ++ (show $ value x) ++ ": " ++ (show $ left x) > ++ "," ++ (show $ right x) ++ "]\n" Examples follow. They show off the true polymorphic nature of the trees. > leaf1 = make_leaf 'a' > leaf2 = make_leaf (1::Int) > tree1 = make_node "b" leaf1 leaf2 > tree2 = make_node (Just 'a') tree1 leaf1 We can print out each of these trees by 'showing' them, or just by typing leaf1, tree1, etc. at the GHCi prompt. However, if we try the following, *> tree3 = make_node False tree2 leaf1 we get a type error at compile time: No instance for (HeightC (Succ (Succ Zero)) Zero ph) arising from use of `make_node' at stanamically-balanced-trees.lhs:222 In the definition of `tree3': make_node False tree2 leaf1 The error tells us of an attempt to build an unbalanced node, whose children have heights two and zero. As we mentioned above, static checks are sometimes too restrictive and insufficient. For example, suppose we want to write a function that builds a full binary tree. The first attempt could be as follows: *> make_bbtree1 n = makeit n 0 *> where *> makeit 0 counter = make_leaf counter *> makeit n counter = make_node counter (makeit n' c') (makeit n' (c'+1)) *> where *> n' = n -1 *> c' = 2*counter Alas, it does not typecheck. First, we get an error stemming from a monomorphic restriction. Even if we managed to get around that (as we do in the following), we would still get an error message about an infinite type. The compiler cannot tell, statically, that (makeit n' c') and (makeit n' (c'+1)) construct trees of the same height. Indeed, the height of the tree is a function of 'n', which is a run-time value. Clearly, a run-type check is needed. To defer static checks till the run-time, we need to enclose our types into an envelope: > data BW = forall ntype vtype lchildtype rchildtype . > (Show (ntype vtype BU lchildtype rchildtype), > BBTree ntype vtype BU lchildtype rchildtype) => > BW (ntype vtype BU lchildtype rchildtype) Now we can write our function as follows: > make_bbtree2 n = makeit n 0 > where > makeit 0 counter = BW $ reheight $ make_leaf counter > makeit n counter = case (wlk,wrk) of > (BW lk, BW rk) -> BW $ make_node counter lk rk > where > wlk = (makeit n' c') > wrk = (makeit n' (c'+1)) > n' = n -1 > c' = 2*counter Now it types, and actually works: > bwshow (BW t) = show t > bwh (BW t) = height t we can try "bwshow $ make_bbtree2 1" and "bwshow $ make_bbtree2 5" We should point out that the invocation "make_node counter lk rk" has exactly the same form as make_node in tree2 above. However, the latter does a static check whereas the former checks the heights dynamically. To see that the dynamic checking really works, suppose we wrote make_bbtree as follows (with a small typo): > make_bbtree3 n = makeit n 0 > where > makeit 0 counter = BW $ reheight $ make_leaf counter > makeit n counter = case (wlk,wrk) of > (BW lk, BW rk) -> BW $ make_node counter lk rk > where > wlk = (makeit n' c') > wrk = (makeit 0 (c'+1)) > n' = n -1 > c' = 2*counter > If we try "bwshow$ make_bbtree3 3", we get a run-time exception alerting us of a violation of the balancing condition. From c_minoli@hotmail.com Mon Apr 21 17:27:48 2003 From: c_minoli@hotmail.com (Cesar Augusto Acosta Minoli) Date: Mon, 21 Apr 2003 16:27:48 +0000 Subject: Help! catching a (1.#QNaN) Message-ID:
Hi,
I wanna thanks to Mark Carroll , his comments help me to Solve (1.#QNaN) problem.


MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*. From afie@cs.uu.nl Tue Apr 22 14:19:48 2003 From: afie@cs.uu.nl (Arjan van IJzendoorn) Date: Tue, 22 Apr 2003 15:19:48 +0200 Subject: Haskell's syntax Message-ID: <010a01c308d1$d99ce0f0$ec50d383@sushi> Hello everyone, I teach Haskell to our first-year students and I find that Haskell's syntax is confusing to many. Some examples: (1) You define data types with vertical bars (|) but in the world of expressions vertical bars (i.e. guards) are exactly what you can not use to discriminate between constructors. (2) Pattern-matching and guards are very often mixed up. Both are used for making choices and they overlap somewhat but not completely in expression power. For learning a language it would be nice if one construct did it all, guards including pattern guards maybe. (3) Types and expressions look very much alike. Say we have: data Tree a = Bin (Tree a) a (Tree a) | Nil. Around half (!) of the students now write (on a written test): size (Bin (Tree left) x (Tree right)) = ... mixing up the two worlds completely. Do other teachers have the same experience? Regards, Arjan From simonpj@microsoft.com Tue Apr 22 15:00:39 2003 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 22 Apr 2003 15:00:39 +0100 Subject: FW: Library infrastructure Message-ID: Gentle Haskellers Haskell has now got a decent, hierarchical module system, supported by GHC, Hugs and NHC, and the library structure is now quite well populated. For example, here are the "base" libraries shipped with GHC (similar libraries come with Hugs and Nhc): http://www.haskell.org/ghc/docs/latest/html/base/index.html Languages flourish when libraries are plentiful, reliable, and well documented. In an open-source community like the Haskell community, plentiful libraries depend on contributions from the community. =20 The difficulty is that it is currently not obvious what Joe Programmer=20 should do to contribute a library to the community. I think this difficulty is a major obstacle to Haskell's progress,=20 perhaps even the largest single obstacle today. =20 One route to getting a library widely distributed is to get it into the "libraries" source tree used by GHC, Hugs, and NHC. That has the merit that the library will be distributed with each of these compilers. But it's too much of a "cathedral" approach. There is no way to distribute libraries between releases, and it makes the distributions ever larger and more complex for the GHC/Hugs/Nhc teams to build. =20 To complement this, there ought to be an easy "bazaar" way for Joe Programmer to implement a library, build distributions, put them up on his web site for others to download, and add a link to some central library index so that people can find it. Sadly this is not an entirely simple task, because (a) the library should work on all Haskell implementations, and (b) should be packaged for binary installation on a variety of platforms (Windows, Linux, OpenBSD, Mac etc). Indeed, since GHC, Hugs and Nhc have different packaging mechanisms, there's a kind of (a)*(b) product involved. The bottom line is that today the obstacles are high enough to discourage all but the most motivated. What is needed is some kind of software infrastructure to automate the common tasks, and to give clear instructions about the non-automatable parts. This infrastructure should not be part of the (complicated) GHC (or Hugs, or Nhc) build systems; indeed, while it will certainly contain implementation-specific parts, its structure should be implementation independent. Simon Marlow emitted a message a while ago about this, but discussion petered out: =20 http://www.haskell.org/pipermail/glasgow-haskell-users/2002-November/thr ead.html#4322 The lack of this library-building infrastructure is a serious problem. Solving it, or even partially solving it, would be a huge step forward. So this message is really to try to kick-start the process again. Is anyone willing to invest effort in making this happen? =20 It's probably a task that is too big for one person. I think what we need is A library-infrastructure Czar, who will=20 a) do the core design and implementation b) coordinate the whole thing to make sure progress happens A bunch of library-infrastructure Supporters, who are willing a) to contribute thoughtfully to the design b) to implement pieces of it, for example pieces specific to one implementation (e.g. GHC) or one target architecture (e.g. PowerPC) Perhaps the first thing to do is to assemble list of people who would be willing to contribute as supporters (in the above sense), hoping that a Czar may then emerge by popular acclaim. Would you like to reply, perhaps to the 'libraries@haskell.org' list, so indicate interest. I really think this is important. If we do not collectively evolve a way to develop libraries in "bazaar" mode, I think Haskell will at best develop more slowly, and at worst wither away. Simon PS1: This is all distinct from the question of library *content* --- that is, what the module name, discussion about the signature of the exported types and functions are --- which does seem be handled OK by the 'libraries' list. This message concerns library-building *infrastructure*. PS2: Another entirely-orthogonal question is where library source code *lives*. One possibility is to use the same CVS repository that GHC/Hugs/Nhc use for libraries, albeit in a separate subtree. Perhaps fptools/user-libs/joe-bloggs/*. Another possibility is SourceForge. Finding backed-up CVS space for source code is not a problem. From joe@informatik.uni-leipzig.de Tue Apr 22 15:06:15 2003 From: joe@informatik.uni-leipzig.de (Johannes Waldmann) Date: Tue, 22 Apr 2003 16:06:15 +0200 (MET DST) Subject: Haskell's syntax In-Reply-To: <010a01c308d1$d99ce0f0$ec50d383@sushi> Message-ID: > (3) Types and expressions look very much alike. Say we have: > data Tree a = Bin (Tree a) a (Tree a) | Nil. I encourage my students to always use named record notation data Tree a = Bin { left :: Tree a, ... } > Around half (!) of the students now write (on a written test): > size (Bin (Tree left) x (Tree right)) = ... sure they had this in their mind: size (Bin ( left :: Tree a ) ( x :: a ) ( right :: Tree a )) = ... (i. e. they wanted to specify the types of formal parameters at the most natural place - at their first appearance in the text) I think the following is conceptually cleaner size ( t @ Bin { } ) = let l = left t r = right t in size l + 1 + size r (it separates matching and binding) altough the first line looks rather cryptic. NB: I wouldn't mind the language enforcing the students ( and me ) to write size ( t @ Bin { } :: Tree a ) = let l :: Tree a = left t r :: Tree a = right t in size l + 1 + size r Best regards, -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/207 -- From Yoann.Padioleau@irisa.fr Tue Apr 22 15:21:36 2003 From: Yoann.Padioleau@irisa.fr (Yoann Padioleau) Date: 22 Apr 2003 16:21:36 +0200 Subject: FW: Library infrastructure In-Reply-To: "Simon Peyton-Jones"'s message of "Tue, 22 Apr 2003 15:00:39 +0100" References: Message-ID: "Simon Peyton-Jones" writes: > Gentle Haskellers > > Haskell has now got a decent, hierarchical module system, supported by > GHC, Hugs and NHC, and the library structure is now quite well > populated. For example, here are the "base" libraries shipped with GHC > (similar libraries come with Hugs and Nhc): > http://www.haskell.org/ghc/docs/latest/html/base/index.html > > Languages flourish when libraries are plentiful, reliable, and well > documented. In an open-source community like the Haskell community, > plentiful libraries depend on contributions from the community. > > The difficulty is that it is currently not obvious what Joe > Programmer > should do to contribute a library to the community. > > I think this difficulty is a major obstacle to Haskell's > progress, > perhaps even the largest single obstacle today. I always find cvs difficult to use, why not put a wiki website for the library code where everyone could *easily* contribute. There needs some control, but simply not allowing a user to add some code that does not compile can do the tricks. -- Yoann Padioleau, INSA de Rennes, France, Opinions expressed here are only mine. Je n'écris qu'à titre personnel. **____ Get Free. Be Smart. Simply use Linux and Free Software. ____** From paul.hudak@yale.edu Tue Apr 22 15:24:47 2003 From: paul.hudak@yale.edu (Paul Hudak) Date: Tue, 22 Apr 2003 10:24:47 -0400 Subject: Haskell's syntax References: <010a01c308d1$d99ce0f0$ec50d383@sushi> Message-ID: <3EA550AF.AB24BAEB@yale.edu> Of these I think that (3) is most serious. What I do is tell students that a data type declaration such as: data Tree a = Bin (Tree a) a (Tree a) | Nil is really a kind of shorthand for: data Tree a where Bin :: Tree a -> a -> Tree a -> Tree a Nil :: Tree a which better separates the worlds of types and terms (and happens to look like a type class declaration). Hope this helps, -Paul Arjan van IJzendoorn wrote: > Hello everyone, > > I teach Haskell to our first-year students and I find that Haskell's syntax > is confusing to many. Some examples: > > (1) You define data types with vertical bars (|) but in the world of > expressions vertical bars (i.e. guards) are exactly what you can not use to > discriminate between constructors. > > (2) Pattern-matching and guards are very often mixed up. Both are used for > making choices and they overlap somewhat but not completely in expression > power. For learning a language it would be nice if one construct did it all, > guards including pattern guards maybe. > > (3) Types and expressions look very much alike. Say we have: > data Tree a = Bin (Tree a) a (Tree a) | Nil. > Around half (!) of the students now write (on a written test): > size (Bin (Tree left) x (Tree right)) = ... > mixing up the two worlds completely. > > Do other teachers have the same experience? > > Regards, Arjan From afie@cs.uu.nl Tue Apr 22 15:47:28 2003 From: afie@cs.uu.nl (Arjan van IJzendoorn) Date: Tue, 22 Apr 2003 16:47:28 +0200 Subject: Haskell's syntax References: <010a01c308d1$d99ce0f0$ec50d383@sushi> <3EA550AF.AB24BAEB@yale.edu> Message-ID: <015101c308de$18d4b160$ec50d383@sushi> Hello Paul, > Of these I think that (3) is most serious. What I do is tell students > that a data type declaration such as: > > data Tree a = Bin (Tree a) a (Tree a) | Nil > > is really a kind of shorthand for: > > data Tree a where > Bin :: Tree a -> a -> Tree a -> Tree a > Nil :: Tree a I like this. And it solves both (3) and (1) (because the bars are gone). Thanks, Arjan From holzmueller@ics-ag.de Tue Apr 22 16:11:34 2003 From: holzmueller@ics-ag.de (=?ISO-8859-1?Q?Bernd_Holzm=FCller?=) Date: Tue, 22 Apr 2003 17:11:34 +0200 Subject: How to define an operator to show a sequence of polymorphic things References: <010a01c308d1$d99ce0f0$ec50d383@sushi> <3EA550AF.AB24BAEB@yale.edu> <015101c308de$18d4b160$ec50d383@sushi> Message-ID: <3EA55BA6.5020907@ics-ag.de> Hi all, I'd like to have a better way for "showing" a list of things, e.g. show (f1 t) ++ show (f2 t) ++ show (f3 t) ++ .... I would love to just write: (f1 # f2 # f3) t but I do not see how to define an operator like # in Haskell without applying show over again on the first arguments (i.e. f1 and f2). Because polymorphic lists are not possible, I can not define # as to write [f1,f2,f3] # t either. Any idea? Regards, Bernd From m.p.donadio@ieee.org Tue Apr 22 16:24:25 2003 From: m.p.donadio@ieee.org (Matthew Donadio) Date: Tue, 22 Apr 2003 11:24:25 -0400 Subject: FW: Library infrastructure References: Message-ID: <3EA55EA9.E8EDA385@ieee.org> I think one way to look at this is to examine similar ideas for other systems that work well. The FreeBSD ports tree is very successful in bringing in a diverse set of libraries and programs. Dependencies and builds are pretty much handled automagically through some (rather complicated) Makefiles. They have also provided a fairly nice web interface for browsing and searching the ports tree. Contributions and updates are handled through CVS. Conceivably, this could handle issues like building and installing libraries for each installed compiler, and eliminate the need to distribute binaries. I think that building and including libraries has to be standardized across the different compilers. One big benefit of using unix is that the C suite is basically consistent across platforms. Other random thoughts... I think that in addition to the Report and Tutorial, a Best Practices document needs to be developed. This would outline the preferable naming conventions, indentation, make targets, and also recommend the use of tools like Haddock of HDoc for generating consistent documentation. I am willing to use my DSP library as a guinea pig for any ideas (it is still a little immature, though), and to help out where I can. -- Matthew Donadio (m.p.donadio@ieee.org) From Malcolm.Wallace@cs.york.ac.uk Tue Apr 22 16:35:25 2003 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Tue, 22 Apr 2003 16:35:25 +0100 Subject: How to define an operator to show a sequence of polymorphic things In-Reply-To: <3EA55BA6.5020907@ics-ag.de> References: <010a01c308d1$d99ce0f0$ec50d383@sushi> <3EA550AF.AB24BAEB@yale.edu> <015101c308de$18d4b160$ec50d383@sushi> <3EA55BA6.5020907@ics-ag.de> Message-ID: <20030422163525.402f4707.Malcolm.Wallace@cs.york.ac.uk> Bernd Holzmüller writes: > I'd like to have a better way for "showing" a list of things, e.g. > > show (f1 t) ++ show (f2 t) ++ show (f3 t) ++ .... > > I would love to just write: (f1 # f2 # f3) t but I do not see how to > define an operator like # in Haskell without applying show over again on > the first arguments (i.e. f1 and f2). Because polymorphic lists are not > possible, I can not define # as to write [f1,f2,f3] # t either. How about the following? infixr # (#) :: (Show b) => (a->b) -> (a->String) -> (a->String) f # g = \t-> show (f t) ++ g t newline, empty :: a -> String newline _ = "\n" empty _ = "" which you could use like (f1 # f2 # f3 # newline) t Regards, Malcolm From thgibbs@deltafarms.com Tue Apr 22 16:54:58 2003 From: thgibbs@deltafarms.com (Tanton Gibbs) Date: Tue, 22 Apr 2003 10:54:58 -0500 Subject: FW: Library infrastructure References: <3EA55EA9.E8EDA385@ieee.org> Message-ID: <02f501c308e7$883e2eb0$8add550a@Corp.Acxiom.net> Don't forget three others: CPAN, CTAN, and SourceForge Each of these is a distribution model with, I think, CPAN/CTAN being more accessable than SourceForge because of thier categorization scheme. Furthermore, CPAN lets you download using the CPAN.pm module which is very nice: for example, it will download dependent modules as well as requested ones if you don't have them. You can further compare those schemes with something like the boost libraries for C++. These libraries are submitted to a rigourous inclusion process that weeds out most of the weaker libraries (or people). I actually would not recommend this approach as it seems to cut down on the actual usefulness of the library because it often requires the library to be too general to be useful. HTH, Tanton ----- Original Message ----- From: "Matthew Donadio" To: "Simon Peyton-Jones" ; ; Sent: Tuesday, April 22, 2003 10:24 AM Subject: Re: FW: Library infrastructure > I think one way to look at this is to examine similar ideas for other > systems that work well. > > The FreeBSD ports tree is very successful in bringing in a diverse set > of libraries and programs. Dependencies and builds are pretty much > handled automagically through some (rather complicated) Makefiles. They > have also provided a fairly nice web interface for browsing and > searching the ports tree. Contributions and updates are handled through > CVS. Conceivably, this could handle issues like building and installing > libraries for each installed compiler, and eliminate the need to > distribute binaries. > > I think that building and including libraries has to be standardized > across the different compilers. One big benefit of using unix is that > the C suite is basically consistent across platforms. > > Other random thoughts... > > I think that in addition to the Report and Tutorial, a Best Practices > document needs to be developed. This would outline the preferable > naming conventions, indentation, make targets, and also recommend the > use of tools like Haddock of HDoc for generating consistent > documentation. > > I am willing to use my DSP library as a guinea pig for any ideas (it is > still a little immature, though), and to help out where I can. > > -- > Matthew Donadio (m.p.donadio@ieee.org) > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > > From afie@cs.uu.nl Tue Apr 22 17:08:32 2003 From: afie@cs.uu.nl (Arjan van IJzendoorn) Date: Tue, 22 Apr 2003 18:08:32 +0200 Subject: Haskell's syntax References: <010a01c308d1$d99ce0f0$ec50d383@sushi> <3EA550AF.AB24BAEB@yale.edu> <015101c308de$18d4b160$ec50d383@sushi> <3EA559AD.10106@udo.edu> Message-ID: <017b01c308e9$6b850df0$ec50d383@sushi> Hello Peter, > I don't know why you mind the bar. It always denotes disjoint union. signum x | x < 0 = -1 | x == 0 = 0 | otherwise = 1 The guards are not disjoint and '|' is not an operator, it *begins* a guarded expression. > data Tree a = Bin (Tree a) a (Tree a) | Nil > > directly represents the domain equation whose least solution is > the semantics of Tree a. It cannot be written more clearly. :-) We're talking first-year students here. Greetings, Arjan From davidb@home.se Tue Apr 22 17:14:02 2003 From: davidb@home.se (David Bergman) Date: Tue, 22 Apr 2003 12:14:02 -0400 Subject: Haskell's syntax In-Reply-To: <3EA550AF.AB24BAEB@yale.edu> Message-ID: <000301c308ea$31164b60$6701a8c0@ALBINONI> I understand that clarity is vital, but I kind of hoped that Haskell would grow up to be a combination of a professional language and a communicative and cognitive tool for testing computer-scientific ideas in (much) higher education. It is not necessarily the case that clarity from a well-educated computer scientist's or a professional software developer's point of view is the same as clarity for beginners. It is kind of sad that we are stuck with beginners' languages, such as Java and VB. What works for beginners might not always be the best choice for us highly experienced engineers and scientists. The problem is that if you want to make a language popular in actual use, you have to infiltritate the educative system, since the beginners of today are the professionals behind systems built in two years. This crazy IT world makes doctors out of nurses... The clean and formal touch of Haskell (as well as of Oz and other declarative languages) makes it highly attractive to (1) highly educated professionals and (2) computer-science students (via their teachers.) But beside that "aura," the two groups have different needs. Maybe we have to invent Haskell++, to obfuscate things just enough to keep students out of the way, enable the insertion of features viable for use amongst professionals and in (much) higher education. Or, perhaps, to go the other way, HaskellScript, as a gift to students :-) I hope this mail did not sound too negative (re-reading it, it does...), but I just wonder if anyone else has experienced the conflicting requirements on this (and other) languages? PS Paul, sorry for getting this as a private mail the first time, I hit the "reply" button -- just shows how professional I am ;-) DS /David From ddarius86@hotmail.com Tue Apr 22 17:19:59 2003 From: ddarius86@hotmail.com (Derek Elkins) Date: Tue, 22 Apr 2003 12:19:59 -0400 Subject: How to define an operator to show a sequence of polymorphic things Message-ID: >From: Bernd Holzmüller >To: Haskell@haskell.org >Subject: How to define an operator to show a sequence of polymorphic things >Date: Tue, 22 Apr 2003 17:11:34 +0200 > >Hi all, > >I'd like to have a better way for "showing" a list of things, e.g. > >show (f1 t) ++ show (f2 t) ++ show (f3 t) ++ .... > >I would love to just write: (f1 # f2 # f3) t but I do not see how to define >an operator like # in Haskell without applying show over again on the first >arguments (i.e. f1 and f2). Because polymorphic lists are not possible, I >can not define # as to write [f1,f2,f3] # t either. > >Any idea? > >Regards, Bernd > >_______________________________________________ >Haskell mailing list >Haskell@haskell.org >http://www.haskell.org/mailman/listinfo/haskell x # r = show x ++ r end = "" 1 # True # 'a' # end ==> "1True'a'" _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From la@iki.fi Tue Apr 22 17:46:33 2003 From: la@iki.fi (Lauri Alanko) Date: Tue, 22 Apr 2003 19:46:33 +0300 Subject: How to define an operator to show a sequence of polymorphic things In-Reply-To: <20030422163525.402f4707.Malcolm.Wallace@cs.york.ac.uk> References: <010a01c308d1$d99ce0f0$ec50d383@sushi> <3EA550AF.AB24BAEB@yale.edu> <015101c308de$18d4b160$ec50d383@sushi> <3EA55BA6.5020907@ics-ag.de> <20030422163525.402f4707.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <20030422164633.GA5875@la.iki.fi> On Tue, Apr 22, 2003 at 04:35:25PM +0100, Malcolm Wallace wrote: > infixr # > (#) :: (Show b) => (a->b) -> (a->String) -> (a->String) > f # g = \t-> show (f t) ++ g t Or, to avoid unnecessary overhead: (f # g) t = shows (f t) (g t) Lauri Alanko la@iki.fi From m.p.donadio@ieee.org Tue Apr 22 18:05:43 2003 From: m.p.donadio@ieee.org (Matthew Donadio) Date: Tue, 22 Apr 2003 13:05:43 -0400 Subject: FW: Library infrastructure References: <3EA55EA9.E8EDA385@ieee.org> <02f501c308e7$883e2eb0$8add550a@Corp.Acxiom.net> Message-ID: <3EA57667.9A45CC4E@ieee.org> Tanton Gibbs wrote: > Don't forget three others: CPAN, CTAN, and SourceForge Yes, they are nice, but they dosn't totally solve the building process (though I could be worng about CPAN; I try to ignore perl :) ). The ports tree handles this. For those unfamiliar with the BSD ports tree, here is how it would be handled in the Haskell world. You would have a set of directories in the same tree, lets say /usr/haskell/ Libraries would live in this tree, and you would group them into rough categories. There would also be a directory with Makefile includes. Each library would include a Makefile to build the library. These Makefiles only define download sites, dependencies, tool requirements, and limitations. They include other Makefiles to do the real work. There would probably be ghc.mk, nhc.mk, and hugs.mk with compiler specific things, and also hdoc.mk, haddock.mk, etc, for tools. There would be a master Makefile that would detect which compilers are installed, and build library versions for each. This master makefile would also handle tasks like downloading the source, applying patches, etc. In the BSD world, this works very well. You can install the minimal OS on a machine, cd to /usr/ports/editors/AbiWord2, type make install, and have it download, build, and install _everything_ needed (GNU make, X11, Gnome, etc) to build AbiWord for Gnome2. Maybe I will create a quick mock up. Another way to do this is to standardize a library format (analygous to Java JARs), and to extend the build process in hmake (or create a hlibtool), so you could do something like hmake -ghc -installlib http://some.site/some/path/somelib.tar.gz To automate everything. Just some caffine inspired thoughts... -- Matthew Donadio (m.p.donadio@ieee.org) From martin.holters@gmx.de Sat Apr 19 15:27:21 2003 From: martin.holters@gmx.de (Martin Holters) Date: Sat, 19 Apr 2003 16:27:21 +0200 Subject: Help! catching a (1.#QNaN) In-Reply-To: References: Message-ID: <200304191627.22707.martin.holters@gmx.de> > > I would like to catch when my code produce a QNAN "Quiet Not a Number" > > (I'm working with Float Numbers) . I founded in Prelude Module the > > function "IsNaN" but, it doesn't Work. (it returns FALSE in all cases). > > So, anybody Knows how detect a QNaN in Haskell? > > What do you mean, "it doesn't Work"? Can you give an example of short > Haskell code from which you expect SNaNs and QNaNs so we can try them out > and play? Which Haskell compiler on which architecture are you using? I > find that, for example, isNaN (0/0) is True in GHC and False in Hugs on > Linux, which is mildly surprising - I thought it should always be true? Try isIEEE 0.0 GHC: True Hugs: False Not very satisfying, I think, but it explains the different behaviour for isNaN , at least. cu Martin From tcse-ICSM06996-1202@tcse.org Sat Apr 19 18:43:18 2003 From: tcse-ICSM06996-1202@tcse.org (Working Conference on Reverse Engineering) Date: Sat, 19 Apr 2003 10:43:18 -0700 Subject: Reverse Engineering call for papers - WCRE 2003 Message-ID: The 10th Working Conference on Reverse Engineering WCRE 2003 Victoria, British Columbia, Canada November 13 - 16, 2003 http://www.cs.ualberta.ca/~wcre2003/ Call for Papers ------------------------------------------------------------------- The Working Conference on Reverse Engineering (WCRE) is the premier research conference on the theory and practice of recovering information from existing systems. Now preparing to hold our tenth meeting, we explore innovative methods of extracting the many kinds of information that can be recovered from the data, software, and other components that comprise systems, and examine innovative ways of using this information in system understanding, renovation, and system reengineering. Topics discussed at WCRE include but are not limited to: * Software maintenance & evolution * Program analysis and slicing * Decompilation & binary translation * Refactoring * Program comprehension * Program transformations * Software architecture extraction * Cluster and concept analysis * Requirements reengineering * Object identification * Software migrations * Browsing & searching legacy sys. * User interface reengineering * Software visualization * Web-enabling legacy systems * XML, meta-data, and data-exchange * Web-site reverse engineering * Reverse engineering tool support * Transitioning to product lines * Documentation generation * Data reverse engineering * Formal methods for rev. eng. * Experience reports * Programming knowledge * Reengineering patterns representations * Collaborative reengr efforts * Requirements traceability * Software process implications * Dynamic analysis * Reverse engineering economics * UML and round trip engineering * Preprocessing and parsing * Software metrics * Software components * Migration to model-driven * Web services architectures * Reverse engr in homeland security ------------------------------------------------------------------- Submission of Papers Papers should describe original and significant work in the research and practice of reverse engineering. Papers should be limited to 10 proceedings pages. Papers must not have been previously published nor have been submitted to, or be in consideration for, any journal, book, or other conference. Papers must conform to the IEEE paper guidelines. WCRE 2003 is using an electronic submission process. For more details, please visit: http://www.cs.ualberta.ca/~wcre2003/ ------------------------------------------------------------------- Important Dates May 23, 2003 Submit title + abstract June 6, 2003 Papers due (firm deadline) July 7, 2003 Workshop proposals due July 14, 2003 Notification of acceptance August 15, 2003 Camera-ready papers due (firm!) October 13, 2003 Tool demonstration proposals due ------------------------------------------------------------------- WCRE is sponsored by the IEEE Computer Society\'s Technical Council on Software Engineering (TCSE) and by the the Reengineering Forum ICSM06996-1202 From lmp@di.fct.unl.pt Mon Apr 21 09:39:52 2003 From: lmp@di.fct.unl.pt (=?iso-8859-1?Q?Lu=EDs_Moniz_Pereira?=) Date: Mon, 21 Apr 2003 09:39:52 +0100 Subject: Call for Papers: III CMSRA Message-ID: <005a01c307e1$ae3b1710$f6d016d5@MENS> This is a multi-part message in MIME format. ------=_NextPart_000_005B_01C307EA.0FFF7F10 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =20 Please distribute among your colleagues: ------------------- CALL FOR PAPERS =20 THIRD INTERNATIONAL WORKSHOP ON COMPUTATIONAL MODELS OF SCIENTIFIC REASONING AND APPLICATIONS (III CMSRA) Argentine National Library, Buenos Aires September 14-15, 2003 Draft Papers due by May 30, 2003. A special issue of the=20 Journal of Applied Logic (edited by Dov Gabbay)=20 will be devoted to the best original papers presented in the workshop. (please see also www.lip.uns.edu.ar/cmsra) Purpose ------- The purpose of this workshop is to bring together practitioners in the several fields involved in the computational models of scientific reasoning (Logic, KR&R, Cognitive Sciences, Epistemology and Theory of Science, among others) in order to exchange the results of their ongoing research, share their experiences and speculate about their impact on the new information technologies. Scope ----- The scope of the workshop includes (but is not limited to) the following areas: 1. Inference Procedures Ampliative Inference Argumentative and Defeasible Reasoning Analogy, Induction and Abduction Paraconsistent Logics Plausible and Hypothetical Reasoning Causal and Explanatory Reasoning Hypothesis Formation, Learning and Discovery Coherence, Explanation and Acceptance Procedural Rationality Distributed Scientific Inference=20 2. Philosophical Aspects of the Computational Models of Scientific Reasoning Computational Epistemology and Theory of Science Cognitive Theory Formation Acceptance and Decision Making Reasoning as opposed to Logic Concept Formation and Conceptual Change Design in Scientific Method The Growth of Knowledge 3. Social Metaphors Science as Distributed Computing Models of Science Distributed over Large Networks (grids, semantic webs) Internet Epistemology Self-Organizing Agents Team Theory Rules of Negotiation Social Choice Sociology of Knowledge Evolutionary Epistemology 4. Applications New Information Technologies Computational Theories in the Sciences Intelligent Data Mining Agent-Based Scientific Discovery Modelling Agreement Intelligent Protocols for E-Commerce Program Committee ----------------- Diderik Batens Wijsbegeerte=20 Universiteit Gent - Belgium=20 Diderik.Batens@rug.ac.be=20 Jean-Yves B=E9ziau Institut de Logique Universit=E9 de Neuch=E2tel - Switzerland Jean-Yves.Beziau@unine.ch=20 Ot=E1vio Bueno Department of Philosophy University of South Carolina - USA obueno@sc.edu Walter Carnielli Centre for Logic and Epistemology State University of Campinas - Brasil carniell@cle.unicamp.br =20 Marcelo Coniglio Centre for Logic and Epistemology State University of Campinas - Brasil coniglio@cle.unicamp.br =20 Claudio Delrieux Universidad Nacional del Sur - Argentina claudio@acm.org Steven French School of Philosophy University of Leeds - UK s.r.d.french@leeds.ac.uk Lorenzo Magnani Department of Philosophy & Computational Philosophy Laboratory University of Pavia - ITALY, and Program in Philosophy, Science, and Technology Georgia Institute of Technology - USA lmagnani@cc.gatech.edu David Pearce Universidad Rey Juan Carlos, Madrid - Spain d.pearce@escet.urjc.es Luis Moniz Pereira Centro de Intelig=EAncia Artificial - CENTRIA Universidade Nova de Lisboa - Portugal lmp@di.fct.unl.pt Submission Information ---------------------- Submissions should arrive by May 30. Electronic submissions (LaTeX, Acrobat pdf or poscript) are preferred. Send a 5 page draft paper to: Claudio Delrieux Universidad Nacional del Sur - ARGENTINA p. o. box 127 - (8000) Bahia Blanca - Argentina claudio@acm.org Tel: 54 - 291 - 4595101 ext. 3381 Fax: 54 - 291 - 4595154 Important Dates --------------- May 30: Draft papers (about 5 pages) due June 30: Notification of acceptance July 30: Camera-Ready papers & Prereg. due ------=_NextPart_000_005B_01C307EA.0FFF7F10 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

 

Please = distribute among your colleagues:

-------------------


CALL FOR PAPERS
 
    THIRD INTERNATIONAL WORKSHOP ON
    COMPUTATIONAL MODELS OF SCIENTIFIC
    REASONING AND APPLICATIONS = (
III CMSRA)

    Argentine National Library, = Buenos Aires
    September 14-15, 2003
    Draft Papers due by May 30, 2003.

    A special issue of the
    Journal of Applied Logic (edited by = Dov Gabbay)
    will be devoted to the best original
    papers presented in the = workshop.

    (please see also www.lip.uns.edu.ar/cmsra)

Purpose
-------
  The purpose of this workshop is to bring together
  practitioners in the several fields = involved in
  the computational models of scientific reasoning (Logic,
  KR&R, Cognitive Sciences, Epistemology and Theory of = Science,
  among others) in order to exchange the = results of their
  ongoing research, share their = experiences and speculate
  about their impact on the new = information technologies.


Scope
-----
  The scope of the workshop includes (but is not limited to)
  the following areas:

1. Inference Procedures

    Ampliative Inference
    Argumentative and Defeasible Reasoning
    Analogy, Induction and Abduction
    Paraconsistent Logics
    Plausible and Hypothetical Reasoning
    Causal and Explanatory Reasoning
    Hypothesis Formation, Learning and Discovery
    Coherence, Explanation and Acceptance
    Procedural Rationality
    Distributed Scientific Inference

2. Philosophical Aspects of the Computational
    Models of Scientific Reasoning

    Computational Epistemology and Theory of Science
    Cognitive Theory Formation
    Acceptance and Decision Making
    Reasoning as opposed to Logic
    Concept Formation and Conceptual Change
    Design in Scientific Method
    The Growth of Knowledge

3. Social Metaphors

    Science as Distributed Computing
    Models of Science Distributed over Large
       Networks (grids, semantic webs)
    Internet Epistemology
    Self-Organizing Agents
    Team Theory
    Rules of Negotiation
    Social Choice
    Sociology of Knowledge
    Evolutionary Epistemology

4. Applications

    New Information Technologies
    Computational Theories in the Sciences
    Intelligent Data Mining
    Agent-Based Scientific Discovery
    Modelling Agreement
    Intelligent Protocols for E-Commerce


Program Committee
-----------------

    = Diderik = Batens
    Wijsbegeerte
    Universiteit Gent - = Belgium
    Diderik.Batens@rug.ac.be

    = Jean-Yves B=E9ziau
    = Institut de Logique
    = Universit=E9 de Neuch=E2tel - = Switzerland
    Jean-Yves.Beziau@unine.ch

    = Ot=E1vio = Bueno
    Department of Philosophy
    University = of South Carolina - = USA
    obueno@sc.edu

    Walter = Carnielli
    Centre for Logic and Epistemology
    State = University of Campinas - Brasil
    carniell@cle.unicamp.br
       
    = Marcelo = Coniglio
    Centre for Logic and Epistemology
    State = University of Campinas - Brasil
    coniglio@cle.unicamp.br
       
    = Claudio = Delrieux
    = Universidad = Nacional del Sur - = Argentina=
    claudio@acm.org

    Steven = French
    School of = Philosophy
    University = of Leeds - UK
    s.r.d.french@leeds.ac.uk

    = Lorenzo = Magnani
    Department of Philosophy & Computational = Philosophy Laboratory
    University = of Pavia - ITALY, = and
    Program in Philosophy, Science, and Technology
    Georgia Institute of Technology - = USA
    lmagnani@cc.gatech.edu

    David = Pearce
    = Universidad = Rey Juan = Carlos, Madrid - = Spain
=     d.pearce@escet.urjc.es

    Luis = Moniz Pereira
    Centro = de Intelig=EAncia Artificial - CENTRIA
    Universidade Nova de Lisboa - = Portugal<= br>     lmp@di.fct.unl.pt


Submission Information
----------------------

  Submissions should arrive by May 30. Electronic
  submissions (LaTeX, Acrobat pdf or = poscript)
  are preferred. Send a 5 page draft paper to:

       = Claudio Delrieux
       = Universidad Nacional del Sur - = ARGENTINA=
       p. o. box 127 - (8000) = Bahia Blanca - = Argentina=
       claudio@acm.org
       Tel: 54 - 291 - 4595101 ext. = 3381
       Fax: 54 - 291 - 4595154


Important Dates
---------------
     May 30:    Draft papers (about 5 = pages) due
     June 30:   Notification of = acceptance
     July 30:   Camera-Ready papers & = Prereg. due

------=_NextPart_000_005B_01C307EA.0FFF7F10-- From icalp2003@TUE.nl Tue Apr 22 11:23:42 2003 From: icalp2003@TUE.nl (icalp2003@TUE.nl) Date: Tue, 22 Apr 2003 12:23:42 +0200 Subject: Call for participation ICALP2003 Message-ID: > ------------------------------Call For > Participation----------------------- > We apologize for the reception of multiple copies of this message. > -------------------------------------------------------------------------- > -- > > > ICALP2003 > > Thirtieth International Colloquium on Automata, Languages and > Programming > > > Eindhoven, The Netherlands, June 30 - July 4, 2003 > > http://www.win.tue.nl/icalp2003/ > > DEADLINE FOR EARLY REGISTRATION MAY 28 > > The 30th annual meeting of the European Association of TheoreticalComputer > Science > will be held in Eindhoven, The Netherlands, at the Technische Universiteit > Eindhoven. > > As with the journal Theoretical Computer Science (TCS), the scientific > program of the Colloquium will be split into two parts: Track A of the > meeting will cover Algorithms, Automata, Complexity and Games, while > Track B covers Logic, Semantics and Theory of Programming. The full > program, > containing 84 accepted papers and 6 invited contributions is now > available at the ICALP2003 website ( > http://www.win.tue.nl/icalp2003/Schedule.html ). > > Invited speakers > > Jan Bergstra: Polarized process algebra and program equivalence > Anne Condon: Problems in RNA secondary structure prediction and design > Amos Fiat: Some issues regarding search, censorship, and anonimity in > peer to peer networks > Petra Mutzel: The SPQR-tree data structure in graph drawing > Doron Peled: Model checking and testing combined > Moshe Vardi: Logic and automata, a match made in heaven > > Workshops and surrounding events > > In the weekends preceeding and following ICALP2003 several workshops of > interest to the EACTS-community will be held at the conference venue, a > list is available at conference website > ( http://www.win.tue.nl/icalp2003/Workshops.html ). In the week before > ICALP (June 24-27), two more international conferences in computer > science are hosted by the TU Eindhoven at the same venue: the 24th > International Conference on Application and Theory of Petri Nets, ATPN > 2003, and the Conference on Business Process Management, BPM 2003. > Besides these scientific events, a number of other activities such as > excursions, a social event, a festive award presentation, and an event > on education in theoretical computer science are part of ICALP2003. For > a complete overview, see the "Events" section of the website > ( http://www.win.tue.nl/icalp2003/Events.html ). > > Venue > > Eindhoven is the fifth largest city in the Netherlands, with good > railconnections to the rest of the country and neighbouring countries. > It can be reached by train from Schiphol, the main airport of the > Netherlands, > in only 1.5 hours. The campus of the Technische Universiteit Eindhoven is > located in the centre of the city, within walking distance of the train > station and the conference hotels. > > > Registration > > The important dates for registration are: > Deadline for early registration May 28 > Deadline for late registration June 20 > > The conference website contains an online registration form which also > allows you to make reservations at the conference hotels > ( http://www.win.tue.nl/icalp2003/Registration.html ) > > > Contact information > > ICALP2003 Office > Technische Universiteit Eindhoven > Department of Mathematics and Computing Science > P.O. Box 513 > 5600MB Eindhoven > The Netherlands > > Telephone: +31 40 2474124 > Fax: +31 40 2475361 > E-mail: icalp2003@tue.nl > URL: www.win.tue.nl/icalp2003/ > > > > > > From seth@cql.com Tue Apr 22 21:15:41 2003 From: seth@cql.com (Seth Kurtzberg) Date: Tue, 22 Apr 2003 13:15:41 -0700 Subject: FW: Library infrastructure In-Reply-To: <3EA57667.9A45CC4E@ieee.org> References: <3EA55EA9.E8EDA385@ieee.org> <02f501c308e7$883e2eb0$8add550a@Corp.Acxiom.net> <3EA57667.9A45CC4E@ieee.org> Message-ID: <20030422131541.009cf650.seth@cql.com> Some comments, The BSD ports system: 1. Is intended for a completely different purpose and 2. Has far too many bugs and problems. On #2, I occasionally talk to people who say that the FBSD ports system works for them, but my own experience, and the experience of most of the people I've talked to about it, is that the quality is very variable and many packages simply refuse to install. I did a quick test here and had problems with about 20% of the packages I tried. Other similar systems such as the ports for Net and OpenBSD and emerge all have problems, in varying degrees but in my mind excessive. Going back to #1, the purpose of systems like BSD ports is to handle the downloading, installation, build, and configuration of packages for an operating system. How much of this is relevant to a language library? One primary purpose of these systems is to make it possible for less sophisticated users to install and use O/S packages. This certainly does not apply to users of a complex language such as Haskell, and those in the Haskell development community are not novices who need black box tools to hide the complexity of the software infrastructure. By including automatic downloading, these systems seriously restrict your options as to format and configuration of download sites. I think that is a restriction that is unwise for the situation under discussion. I most certainly do _not_ want a tool that I invoke to install a library to, on the basis of automated dependencies, update other libraries to a later version (or, worse, downgrade to an earlier version). On Tue, 22 Apr 2003 13:05:43 -0400 Matthew Donadio wrote: > Tanton Gibbs wrote: > > Don't forget three others: CPAN, CTAN, and SourceForge > > Yes, they are nice, but they dosn't totally solve the building process > (though I could be worng about CPAN; I try to ignore perl :) ). The > ports tree handles this. > > For those unfamiliar with the BSD ports tree, here is how it would be > handled in the Haskell world. > > You would have a set of directories in the same tree, lets say > /usr/haskell/ > > Libraries would live in this tree, and you would group them into rough > categories. > > There would also be a directory with Makefile includes. > > Each library would include a Makefile to build the library. These > Makefiles only define download sites, dependencies, tool requirements, > and limitations. They include other Makefiles to do the real work. > > There would probably be ghc.mk, nhc.mk, and hugs.mk with compiler > specific things, and also hdoc.mk, haddock.mk, etc, for tools. There > would be a master Makefile that would detect which compilers are > installed, and build library versions for each. This master makefile > would also handle tasks like downloading the source, applying patches, > etc. > > In the BSD world, this works very well. You can install the minimal OS > on a machine, cd to /usr/ports/editors/AbiWord2, type make install, and > have it download, build, and install _everything_ needed (GNU make, X11, > Gnome, etc) to build AbiWord for Gnome2. > > Maybe I will create a quick mock up. > > Another way to do this is to standardize a library format (analygous to > Java JARs), and to extend the build process in hmake (or create a > hlibtool), so you could do something like > > hmake -ghc -installlib http://some.site/some/path/somelib.tar.gz > > To automate everything. > > Just some caffine inspired thoughts... > > -- > Matthew Donadio (m.p.donadio@ieee.org) > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -- Seth Kurtzberg MIS Corp 480-661-1849 seth@cql.com From seth@cql.com Tue Apr 22 21:25:33 2003 From: seth@cql.com (Seth Kurtzberg) Date: Tue, 22 Apr 2003 13:25:33 -0700 Subject: FW: Library infrastructure In-Reply-To: References: Message-ID: <20030422132533.0bb4216d.seth@cql.com> Simon, I think this is an important issue and I am willing to help and participate. The issues for such a system are I believe more complex than is immediately apparent, and some of the early responses indicate that the complexity of the issue may not be well understood. I would recommend a more incremental approach with more limited initial goals. Specifically, with X meaning to be determined: 1. A Haskell library is distributed in X format 2. After downloading, a Haskell library is built using procedure X. All libraries are built using the same sequence. Preferably the sequence is the same for the three compilers, and the build process is smart enough to determine which compiler is available, and adjust accordingly. There should be a build time option to override the automatic compiler choice. 3. A Haskell library is installed into directory (tree?) X. Again, preferably compiler independent, if practical. 4. A Haskell library includes, at a minimum, documentation X in format Y. This is the least interesting (at least to many developers :) ), but the _most_ important, requirement. On Tue, 22 Apr 2003 15:00:39 +0100 "Simon Peyton-Jones" wrote: > Gentle Haskellers > > Haskell has now got a decent, hierarchical module system, supported by > GHC, Hugs and NHC, and the library structure is now quite well > populated. For example, here are the "base" libraries shipped with GHC > (similar libraries come with Hugs and Nhc): > http://www.haskell.org/ghc/docs/latest/html/base/index.html > > Languages flourish when libraries are plentiful, reliable, and well > documented. In an open-source community like the Haskell community, > plentiful libraries depend on contributions from the community. > > The difficulty is that it is currently not obvious what Joe > Programmer > should do to contribute a library to the community. > > I think this difficulty is a major obstacle to Haskell's > progress, > perhaps even the largest single obstacle today. > > One route to getting a library widely distributed is to get it into the > "libraries" source tree used by GHC, Hugs, and NHC. That has the merit > that the library will be distributed with each of these compilers. But > it's too much of a "cathedral" approach. There is no way to distribute > libraries between releases, and it makes the distributions ever larger > and more complex for the GHC/Hugs/Nhc teams to build. > > To complement this, there ought to be an easy "bazaar" way for Joe > Programmer to implement a library, build distributions, put them up on > his web site for others to download, and add a link to some central > library index so that people can find it. Sadly this is not an entirely > simple task, because (a) the library should work on all Haskell > implementations, and (b) should be packaged for binary installation on a > variety of platforms (Windows, Linux, OpenBSD, Mac etc). Indeed, since > GHC, Hugs and Nhc have different packaging mechanisms, there's a kind of > (a)*(b) product involved. The bottom line is that today the obstacles > are high enough to discourage all but the most motivated. > > What is needed is some kind of software infrastructure to automate the > common tasks, and to give clear instructions about the non-automatable > parts. This infrastructure should not be part of the (complicated) GHC > (or Hugs, or Nhc) build systems; indeed, while it will certainly contain > implementation-specific parts, its structure should be implementation > independent. Simon Marlow emitted a message a while ago about this, > but discussion petered out: > > http://www.haskell.org/pipermail/glasgow-haskell-users/2002-November/thr > ead.html#4322 > > The lack of this library-building infrastructure is a serious problem. > Solving it, or even partially solving it, would be a huge step forward. > So this message is really to try to kick-start the process again. Is > anyone willing to invest effort in making this happen? > > It's probably a task that is too big for one person. I think what we > need is > > A library-infrastructure Czar, who will > a) do the core design and implementation > b) coordinate the whole thing to make sure progress happens > > A bunch of library-infrastructure Supporters, who are willing > a) to contribute thoughtfully to the design > b) to implement pieces of it, for example pieces specific to one > implementation > (e.g. GHC) or one target architecture (e.g. PowerPC) > > > Perhaps the first thing to do is to assemble list of people who would be > willing to contribute as supporters (in the above sense), hoping that a > Czar may then emerge by popular acclaim. Would you like to reply, > perhaps to the 'libraries@haskell.org' list, so indicate interest. > > I really think this is important. If we do not collectively > evolve a way > to develop libraries in "bazaar" mode, I think Haskell will at > best develop > more slowly, and at worst wither away. > > Simon > > PS1: This is all distinct from the question of library *content* --- > that is, what the module name, discussion about the signature of the > exported types and functions are --- which does seem be handled OK by > the 'libraries' list. This message concerns library-building > *infrastructure*. > > PS2: Another entirely-orthogonal question is where library source code > *lives*. One possibility is to use the same CVS repository that > GHC/Hugs/Nhc use for libraries, albeit in a separate subtree. Perhaps > fptools/user-libs/joe-bloggs/*. Another possibility is SourceForge. > Finding backed-up CVS space for source code is not a problem. > > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -- Seth Kurtzberg MIS Corp 480-661-1849 seth@cql.com From seth@cql.com Tue Apr 22 21:26:25 2003 From: seth@cql.com (Seth Kurtzberg) Date: Tue, 22 Apr 2003 13:26:25 -0700 Subject: FW: Library infrastructure In-Reply-To: References: Message-ID: <20030422132625.222fcdc6.seth@cql.com> On 22 Apr 2003 16:21:36 +0200 Yoann Padioleau wrote: > "Simon Peyton-Jones" writes: >=20 > > Gentle Haskellers > >=20 > > Haskell has now got a decent, hierarchical module system, supported by > > GHC, Hugs and NHC, and the library structure is now quite well > > populated. For example, here are the "base" libraries shipped with GHC > > (similar libraries come with Hugs and Nhc): > > http://www.haskell.org/ghc/docs/latest/html/base/index.html > >=20 > > Languages flourish when libraries are plentiful, reliable, and well > > documented. In an open-source community like the Haskell community, > > plentiful libraries depend on contributions from the community. =20 > >=20 > > The difficulty is that it is currently not obvious what Joe > > Programmer=20 > > should do to contribute a library to the community. > >=20 > > I think this difficulty is a major obstacle to Haskell's > > progress,=20 > > perhaps even the largest single obstacle today. =20 >=20 > I always find cvs difficult to use, why not put a wiki website for the=20 > library code where everyone could *easily* contribute. > There needs some control, but simply not allowing a user to add some code > that does not compile can do the tricks. NO CODE WITHOUT DOCUMENTATION. >=20 >=20 > --=20 > Yoann Padioleau, INSA de Rennes, France, > Opinions expressed here are only mine. Je n'=E9cris qu'=E0 titre personne= l. > **____ Get Free. Be Smart. Simply use Linux and Free Software. ____** > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries >=20 --=20 Seth Kurtzberg MIS Corp 480-661-1849 seth@cql.com From ddarius@hotpop.com Wed Apr 23 07:53:09 2003 From: ddarius@hotpop.com (Derek Elkins) Date: Tue, 22 Apr 2003 23:53:09 -0700 Subject: FW: Library infrastructure In-Reply-To: <20030422132625.222fcdc6.seth@cql.com> References: <20030422132625.222fcdc6.seth@cql.com> Message-ID: <20030422235309.00000cf8.ddarius@hotpop.com> On Tue, 22 Apr 2003 13:26:25 -0700 Seth Kurtzberg wrote: > On 22 Apr 2003 16:21:36 +0200 > Yoann Padioleau wrote: > > > NO CODE WITHOUT DOCUMENTATION. > But that would rule out just about every current Haskell library :P. (Parsec being a wonderful counter-example) *sigh* From ajb@spamcop.net Wed Apr 23 06:56:08 2003 From: ajb@spamcop.net (Andrew J Bromage) Date: Wed, 23 Apr 2003 15:56:08 +1000 Subject: FW: Library infrastructure In-Reply-To: <3EA57667.9A45CC4E@ieee.org> References: <3EA55EA9.E8EDA385@ieee.org> <02f501c308e7$883e2eb0$8add550a@Corp.Acxiom.net> <3EA57667.9A45CC4E@ieee.org> Message-ID: <20030423055608.GC18770@smtp.alicorna.com> G'day all. On Tue, Apr 22, 2003 at 01:05:43PM -0400, Matthew Donadio wrote: > Yes, they are nice, but they dosn't totally solve the building process > (though I could be worng about CPAN; I try to ignore perl :) ). Not true. So long as your C code (in the case of CPAN) is portable, everything else just works for both CPAN and CTAN. The catch is that code in CTAN and CPAN only need work on one implementation (TeX/LaTeX and Perl respectively). It helps that both LaTeX and Perl have ways to specify a "minimum version required". > The ports tree handles this. The ports tree similarly works because it is only required to work with one OS and compiler. Cheers, Andrew Bromage From simonmar@microsoft.com Wed Apr 23 10:17:24 2003 From: simonmar@microsoft.com (Simon Marlow) Date: Wed, 23 Apr 2003 10:17:24 +0100 Subject: FW: Library infrastructure Message-ID: <9584A4A864BD8548932F2F88EB30D1C60CB5F3BD@tvp-msg-01.europe.corp.microsoft.com> > > NO CODE WITHOUT DOCUMENTATION. > >=20 >=20 > But that would rule out just about every current Haskell library :P. > (Parsec being a wonderful counter-example) >=20 > *sigh* I don't think that's entirely fair. Most of the libraries that come with GHC (and Hugs, and soon Nhc) are documented. See for example http://www.haskell.org/ghc/docs/latest/html/base/index.html Cheers, Simon From ger@tzi.de Wed Apr 23 12:32:37 2003 From: ger@tzi.de (George Russell) Date: Wed, 23 Apr 2003 13:32:37 +0200 Subject: Testing for NaN Message-ID: <3EA679D5.5040705@tzi.de> The standard trick would be: isNaN d = (d /= d) This will not distinguish between quiet and signalling NaN's, on the other hand I wonder why on earth you might be getting signalling NaN's anyway. (A signalling NaN normally corresponds to "badly formatted float". Some compilers give float values initial values of signalling NaN, to make it clear they haven't been initialised; the only other reason I can think of why your program might start having signalling NaNs is because of a cast from some other type. I don't think any arithmetic operations should emit a signalling NaN, unless it was given one.) From mark@chaos.x-philes.com Wed Apr 23 13:56:57 2003 From: mark@chaos.x-philes.com (Mark Carroll) Date: Wed, 23 Apr 2003 08:56:57 -0400 (EDT) Subject: FW: Library infrastructure In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C60CB5F3BD@tvp-msg-01.europe.corp.microsoft.com> Message-ID: On Wed, 23 Apr 2003, Simon Marlow wrote: (snip) > I don't think that's entirely fair. Most of the libraries that come > with GHC (and Hugs, and soon Nhc) are documented. See for example > > http://www.haskell.org/ghc/docs/latest/html/base/index.html Maybe I just always need awkward ones, but all I usually see here is a couple of general sentences for a module and a bunch of function names and type signatures. Even basic things like Data.List.nub, System.Random.split, etc. don't have any sort of explanation: you're left looking at real documentation, or experimenting with your guesses that were insprired by the type signature, to find out what the functions actually do. I am *not* complaining: I am very grateful for what GHC does offer and would love to have some time to help document stuff. But how the stuff at http://www.haskell.org/ghc/docs/latest/html/base/index.html can be thought of as being reasonable documentation, I've no idea! (-: -- Mark From simonmar@microsoft.com Wed Apr 23 14:28:54 2003 From: simonmar@microsoft.com (Simon Marlow) Date: Wed, 23 Apr 2003 14:28:54 +0100 Subject: FW: Library infrastructure In-Reply-To: Message-ID: =20 > On Wed, 23 Apr 2003, Simon Marlow wrote: > (snip) > > I don't think that's entirely fair. Most of the libraries that come > > with GHC (and Hugs, and soon Nhc) are documented. See for example > > > > http://www.haskell.org/ghc/docs/latest/html/base/index.html >=20 > Maybe I just always need awkward ones, but all I usually see here is a > couple of general sentences for a module and a bunch of=20 > function names and type signatures. Function names and type signatures are a lot better than nothing ;-) But seriously, the "non-standard" libraries are, at the moment, far = better documented than the standard ones (where "standard" means those libraries defined by the Haskell 98 report and their hierarchical = equivalents). The example you gave, Data.List.nub, is a function from the standard Haskell 98 List library. Contributions of documentation for any libraries are always welcome, of = course! Cheers, Simon From kentk@md.chalmers.se Wed Apr 23 14:04:51 2003 From: kentk@md.chalmers.se (Kent Karlsson) Date: Wed, 23 Apr 2003 15:04:51 +0200 Subject: Testing for NaN In-Reply-To: <3EA679D5.5040705@tzi.de> Message-ID: <001201c30998$ed5eae30$d5d61081@chalmers95a69n> > cast from some other type. I don't think any arithmetic > operations should emit a signalling NaN, unless it was given one.) According to IEC 60559 (same content as IEEE 754), if conformance is claimed, no arithmetic operation returns a signalling NaN. Given a signalling NaN, an "invalid" bit is set (if not in trapping mode), and a *quiet* NaN is returned. A quiet NaN, on the other hand, does NOT result in the "invalid" bit being set (unless it was already set, or another operand is a signalling NaN). "Errors", like sqrt of a negative value, can also set the "invalid" bit, but returns a quiet NaN. No-one seems to have come up with a really good use for *signalling* NaNs, but seems to be and inheritance from pre-IEEE floating point implementations ("invalid operands")... /kent k From joe@informatik.uni-leipzig.de Wed Apr 23 14:35:23 2003 From: joe@informatik.uni-leipzig.de (Johannes Waldmann) Date: Wed, 23 Apr 2003 15:35:23 +0200 (MET DST) Subject: FW: Library infrastructure In-Reply-To: Message-ID: > .. and a bunch of function names and type signatures.. ( This is slightly unrelated, but anyway: ) you only get the above if you have the module source, or if you can decipher the interface file. A friend told me recently that some interactive Prolog (?) systems have a this nice feature: the user can ask for all identifiers (currently in scope) of a certain type (or mode? or was it LISP anyway?) (so [a] -> [a] should give you reverse and tail). Perhaps one would want to use "type wildcards" as well, or some other form of saying "tell me what functions *mention* that type". Looks like this would be even more useful with a stronly typed language. -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/207 -- From basvandijk@home.nl Wed Apr 23 14:44:52 2003 From: basvandijk@home.nl (Bas van Dijk) Date: Wed, 23 Apr 2003 15:44:52 +0200 Subject: FW: Library infrastructure In-Reply-To: <3EA55EA9.E8EDA385@ieee.org> References: <3EA55EA9.E8EDA385@ieee.org> Message-ID: <200304231544.52111.basvandijk@home.nl> Ideas can also be borrowed from Gentoo Linux (pretty much like FreeBSD). Quote from their website: http://www.gentoo.org/main/en/about.xml : ------------------- Portage is the heart of Gentoo Linux, and performs many key functions. For one, Portage is the software distribution system for Gentoo Linux. To get the latest software for Gentoo Linux, you type one command: emerge sync. This command tells Portage to update your local "Portage tree" over the Internet. Your local Portage tree contains a complete collection of scripts that can be used by Portage to create and install the latest Gentoo packages. Currently, we have over 4000 packages in our Portage tree, with new ones being added all the time. Portage is also a package building and installation system. When you want to install a package, you type emerge packagename, at which point Portage automatically builds a custom version of the package to your exact specifications, optimizing it for your hardware and ensuring that the optional features in the the package that you want are enabled -- and those you don't want aren't. Portage also keeps your system up-to-date. Typing emerge -u world -- one command -- will ensure that all the packages that you want on your system are updated automatically. ------------------- Like FreeBSD, all contributions and updates are handled through CVS. On Tuesday 22 April 2003 17:24, Matthew Donadio wrote: > I think one way to look at this is to examine similar ideas for other > systems that work well. > > The FreeBSD ports tree is very successful in bringing in a diverse set > of libraries and programs. Dependencies and builds are pretty much > handled automagically through some (rather complicated) Makefiles. They > have also provided a fairly nice web interface for browsing and > searching the ports tree. Contributions and updates are handled through > CVS. Conceivably, this could handle issues like building and installing > libraries for each installed compiler, and eliminate the need to > distribute binaries. > > I think that building and including libraries has to be standardized > across the different compilers. One big benefit of using unix is that > the C suite is basically consistent across platforms. > > Other random thoughts... > > I think that in addition to the Report and Tutorial, a Best Practices > document needs to be developed. This would outline the preferable > naming conventions, indentation, make targets, and also recommend the > use of tools like Haddock of HDoc for generating consistent > documentation. > > I am willing to use my DSP library as a guinea pig for any ideas (it is > still a little immature, though), and to help out where I can. From Malcolm.Wallace@cs.york.ac.uk Wed Apr 23 14:43:35 2003 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Wed, 23 Apr 2003 14:43:35 +0100 Subject: FW: Library infrastructure In-Reply-To: References: Message-ID: <20030423144335.24996349.Malcolm.Wallace@cs.york.ac.uk> Johannes Waldmann writes: > A friend told me recently that some interactive Prolog (?) systems > have a this nice feature: the user can ask for all identifiers > (currently in scope) of a certain type (or mode? or was it LISP anyway?) > (so [a] -> [a] should give you reverse and tail). See: Retrieving Reusable Software Components by Polymorphic Type, C. Runciman, I. Toyn, Journal of Functional Programming, 1(2), April 1991, pp191-211. This was available in lazy FP systems before Haskell even appeared. I wonder why no-one has ever implemented the idea for Haskell? It seems like it would be useful. Regards, Malcolm From Keith.Wansbrough@cl.cam.ac.uk Wed Apr 23 14:50:53 2003 From: Keith.Wansbrough@cl.cam.ac.uk (Keith Wansbrough) Date: Wed, 23 Apr 2003 14:50:53 +0100 Subject: FW: Library infrastructure In-Reply-To: Your message of "Tue, 22 Apr 2003 11:24:25 EDT." <3EA55EA9.E8EDA385@ieee.org> Message-ID: Matthew Donadio writes: > I think that in addition to the Report and Tutorial, a Best Practices > document needs to be developed. This would outline the preferable > naming conventions, indentation, make targets, and also recommend the > use of tools like Haddock of HDoc for generating consistent > documentation. Funnily enough, I added a HaskellStyle page to the wiki just yesterday. Please start filling it in with this kind of information. http://www.haskell.org/hawiki/HaskellStyle --KW 8-) -- Keith Wansbrough http://www.cl.cam.ac.uk/users/kw217/ University of Cambridge Computer Laboratory. From dlb@patriot.net Wed Apr 23 14:56:48 2003 From: dlb@patriot.net (David Barton) Date: Wed, 23 Apr 2003 09:56:48 -0400 Subject: FW: Library infrastructure References: <3EA55EA9.E8EDA385@ieee.org> Message-ID: <01e001c309a0$328f5f20$3202a8c0@mauve> Matthew Donadio writes: > I think one way to look at this is to examine similar ideas for other > systems that work well. As a suggestion, I just got done updating cygwin, and I must admit I admire the setup there. You can indicate what packages you are downloading, which you want to keep, which you want to skip on a menu like structure. Once they are downloaded, automatic scripts take care of any building that is necessary. It does just what I think is necessary in updating programs. For those on your system which are already present, it updates automatically, only if necessary (if there has been a version change). Can we just grab this code and update it for our purposes? Dave Barton EDAptive Computing From gdr@integrable-solutions.net Wed Apr 23 14:26:18 2003 From: gdr@integrable-solutions.net (Gabriel Dos Reis) Date: 23 Apr 2003 15:26:18 +0200 Subject: Testing for NaN In-Reply-To: <3EA679D5.5040705@tzi.de> References: <3EA679D5.5040705@tzi.de> Message-ID: George Russell writes: | The standard trick would be: | | isNaN d = (d /= d) | | This will not distinguish between quiet and signalling NaN's, if "d" is a signalling NaN, the above may trap. I.e, the only things one can do with a signalling NaN are: (a) change its value; or (b) pass it around. -- Gaby From gdr@integrable-solutions.net Wed Apr 23 14:28:54 2003 From: gdr@integrable-solutions.net (Gabriel Dos Reis) Date: 23 Apr 2003 15:28:54 +0200 Subject: Testing for NaN In-Reply-To: <001201c30998$ed5eae30$d5d61081@chalmers95a69n> References: <001201c30998$ed5eae30$d5d61081@chalmers95a69n> Message-ID: "Kent Karlsson" writes: [...] | No-one seems to have come up with a really good use | for *signalling* NaNs, but seems to be and inheritance from pre-IEEE | floating point implementations ("invalid operands")... I've seen a software (written in C) that used signalling NaN to tag "unintialized data". I think that was a case of "good use". -- Gaby From koen@cs.chalmers.se Wed Apr 23 16:00:55 2003 From: koen@cs.chalmers.se (Koen Claessen) Date: Wed, 23 Apr 2003 17:00:55 +0200 (MET DST) Subject: FW: Library infrastructure In-Reply-To: Message-ID: Simon Marlow wrote: | But seriously, the "non-standard" libraries are, at | the moment, far better documented than the standard | ones (where "standard" means those libraries defined | by the Haskell 98 report and their hierarchical | equivalents). The example you gave, Data.List.nub, is | a function from the standard Haskell 98 List library. I have a suggestion: can the "documentation" for these libraries contain a link to the place where they are defined in the Haskell report? /Koen From ddarius@hotpop.com Wed Apr 23 19:28:23 2003 From: ddarius@hotpop.com (Derek Elkins) Date: Wed, 23 Apr 2003 11:28:23 -0700 Subject: FW: Library infrastructure In-Reply-To: References: Message-ID: <20030423112823.00004b5d.ddarius@hotpop.com> On Wed, 23 Apr 2003 17:00:55 +0200 (MET DST) Koen Claessen wrote: > Simon Marlow wrote: > > | But seriously, the "non-standard" libraries are, at > | the moment, far better documented than the standard > | ones (where "standard" means those libraries defined > | by the Haskell 98 report and their hierarchical > | equivalents). The example you gave, Data.List.nub, is > | a function from the standard Haskell 98 List library. > > I have a suggestion: can the "documentation" for these > libraries contain a link to the place where they are defined > in the Haskell report? > > /Koen This slightly relates to Johannes Waldmann's reply (the reference is indexed by type too); there's a fairly good start to a reference of the standard Haskell 98 prelude at http://zvon.org/other/haskell/Outputglobal/index.html . From steffen.mazanek@unibw-muenchen.de Wed Apr 23 18:41:01 2003 From: steffen.mazanek@unibw-muenchen.de (Steffen Mazanek) Date: 23 Apr 2003 19:41:01 +0200 Subject: Literate Programming Message-ID: <1051119661.79197.25.camel@pseiko2.studfb.unibw-muenchen.de> --=-k5K+GzgVVTA1TedU8Wav Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello. Simon Marlow wrote: >I don't think that's entirely fair. Most of the libraries that come >with GHC (and Hugs, and soon Nhc) are documented. See for example > > http://www.haskell.org/ghc/docs/latest/html/base/index.html As far as I know (please correct me, if I err) one shortcoming of Haddock is its restriction to .hs-files. I think there are a lot of real literate programmers out there which would prefer a Haskell documentation tool for their literate Haskell scripts. Therefore I present the tool lhs2hs, which may seem very puristic and errorprone at this time (in fact it is). It transforms a .lhs-file into a .hs file. Furthermore tex-comments are used to pass information to e.g. Haddock: Example: %%Haddock:this function... %%Haddock:... >testfun... %%Haddock:another function... \begin{code} ... \end{code} This .lhs file becomes transformed to {-| this function... ... -} testfun... {-| another function... -} ... Ok, its simple, but it can be useful and it is extensible! I have attached the very first version. Type: ghc --make Main.lhs -package util -o lhs2hs ./lhs2hs -h Main.lhs haddock -h Main.hs latex Main.lhs Another idea to simplify literate programming with Haskell: allow XML (introduce a new file extension .xhs), e.g.: sorts a list quicksort... This would allow more transformations! Bye, Steffen --=-k5K+GzgVVTA1TedU8Wav Content-Disposition: attachment; filename=Main.lhs Content-Type: text/x-literate-haskell; name=Main.lhs; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit \documentclass[12pt]{report} \usepackage{verbatim} \begin{document} \newenvironment{code}{\footnotesize\verbatim}{\endverbatim\normalsize} \section*{Introduction} This program's task is to transform a {\em literate haskell script} \texttt{name.lhs} into a "normal" haskell script \texttt{name.hs}. Thereby special tex commentaries can be invoked. This can be extremely useful when you run e.g. documentation tools like Haddock." \section*{Invocation of Haddock} Annotations in Tex have to start with \verb|%%Haddock:|. Call \texttt{lhs2hs} with the option \texttt{-h}. \section*{Implementation} %%Haddock:Module : Main %%Haddock:Copyright : (c) Steffen Mazanek 2003 %%Haddock:License : Go get it :-) %%Haddock: %%Haddock:Maintainer : steffen.mazanek@unibw-muenchen.de %%Haddock:Stability : don't ask *g* %%Haddock:Portability : only with notebooks :-/ %%Haddock: %%Haddock:This module provides a program which transforms %%Haddock:literate Haskell scripts into /normal/ Haskell scripts. %%Haddock:Cool, documenting projects is fun using lhs2hs! \begin{code} module Main where import GetOpt import System import Monad import List \end{code} %%Haddock:This is the main function which is invoked automatically whenever the executable is started. %%Haddock:It reads the command line arguments and extracts several options and the files to transform. \begin{code} main::IO () main = do args <- getArgs case getOpt Permute options args of (flags, args, [] ) -> run flags args (_, _, errors) -> do sequence_ (map putStr errors) putStr usage \end{code} %%Haddock:The Flag data type is somewhat puristic but may evolve in the future. %%Haddock:It looks a bit complicated at first but eases extensibility. \begin{code} data Flag = Flag_Haddock deriving (Show, Eq) \end{code} %%Haddock:"run" works out all the files step by step. Thereby the flags are checked %%Haddock:and complying actions take place. \begin{code} run flags [] = putStrLn "Ready!" run flags (a:args) = do when (not $ endsWith ".lhs" a) (putStrLn "You should invoke .lhs-files!") when (Flag_Haddock `elem` flags) $ do putStrLn $ "Performing Haddock-Transformation on " ++ a c<-readFile a writeFile (takeWhile (/='.') a ++ ".hs") (perform haddock c) run flags args \end{code} %%Haddock:As the name says "endsWith" is the counterpart of "startsWith". \begin{code} endsWith x = elem x . tails perform f = unlines.f.lines \end{code} Here something extremely stupid has happened. The inline \verb|\end{code}| was ambiguous and rose a latex error. So we have added a senseless character (\verb|:|). %%Haddock:The transformation (and hence most of the complexity) are hidden by this function. %%Haddock:It gets the lines of a particular file and performs e.g. some filter operations. \begin{code} haddock::[String]->[String] haddock [] = [] haddock a@(x:xs) | x == "\\begin{code}" = let (p1,p2) = splitCond (== '\\':"end{code}") xs in p1 ++ haddock (tail p2) | x == [] = []:haddock xs | head x == '>' = tail x:haddock xs --tex code | startsWith "%%Haddock:" x = let (p1,p2) = splitCond (not.startsWith "%%Haddock:") a in "{-|":map (tail.dropWhile (/=':')) p1 ++ "-}":haddock p2 | otherwise = haddock xs \end{code} %%Haddock:Somewhat standard but not to find in the libraries. Checks whether a particular %%Haddock:String starts with a certain String or not. %Dies ist ein normaler Latex-Kommentar \begin{code} startsWith [] _ = True startsWith _ [] = False startsWith (x:xs) (y:ys) = x == y && startsWith xs ys \end{code} \begin{code} splitCond::(a->Bool)->[a]->([a],[a]) splitCond p [] = ([],[]) splitCond p (x:xs) | p x = ([], x:xs) | otherwise = let (p1,p2) = splitCond p xs in (x:p1,p2) options = [ Option ['h'] ["haddock"] (NoArg Flag_Haddock) "use haddock comments"] usage = "lhs2hs [options] file" \end{code} \end{document} --=-k5K+GzgVVTA1TedU8Wav-- From moran@galois.com Wed Apr 23 19:26:09 2003 From: moran@galois.com (Andy Moran) Date: Wed, 23 Apr 2003 11:26:09 -0700 Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: <1051119661.79197.25.camel@pseiko2.studfb.unibw-muenchen.de> References: <1051119661.79197.25.camel@pseiko2.studfb.unibw-muenchen.de> Message-ID: <200304231126.09872.moran@galois.com> On Wednesday 23 April 2003 10:41 am, Steffen Mazanek wrote: > Hello. > > Simon Marlow wrote: > >I don't think that's entirely fair. Most of the libraries that come > >with GHC (and Hugs, and soon Nhc) are documented. See for example > > > > http://www.haskell.org/ghc/docs/latest/html/base/index.html > > As far as I know (please correct me, if I err) one shortcoming of > Haddock is its restriction to .hs-files. This seems like a good way of transitioning from .lhs to haddock'd .hs. In the long run, I think we (meaning Simon :-) should to extend haddock to take the place of the .lhs style of documenting code. I use haddock to document interfaces for modules and it works wonderfully for that (and it would be even better if I could use haddock comments inside records and in between constructor arguments, hint, hint). But I find myself using it in comments within code (especially within local functions) too. Perhaps a haddock that had two modes (one for interfaces, one for implementation) would work. The interface mode would work as it does now. The implementation mode would produce a .html version of the entire module, using haddock comments to mark it up. Simon: how much work would this be? A -- Andy Moran Ph. (503) 526 3472 Galois Connections Inc. Fax. (503) 350 0833 3875 SW Hall Blvd. http://www.galois.com Beaverton, OR 97005 moran@galois.com From steffen.mazanek@unibw-muenchen.de Wed Apr 23 23:45:07 2003 From: steffen.mazanek@unibw-muenchen.de (Steffen Mazanek) Date: 24 Apr 2003 00:45:07 +0200 Subject: Extracting values from several data constructors Message-ID: <1051137906.80596.17.camel@pseiko2.studfb.unibw-muenchen.de> Hello. I am sure this question is not new. Even so, please give me the solution or point me to an old thread. How can I implement something like: data Test = T1 Int | T2 Int test::Test->Int test (_ x) = x Or is this impossible? In case of yes, why? This would save a lot of case differentiations in my application. Or is there an appropriate compiler option? Good night, Steffen From hdaume@ISI.EDU Thu Apr 24 00:20:20 2003 From: hdaume@ISI.EDU (Hal Daume III) Date: Wed, 23 Apr 2003 16:20:20 -0700 (PDT) Subject: Extracting values from several data constructors In-Reply-To: <1051137906.80596.17.camel@pseiko2.studfb.unibw-muenchen.de> Message-ID: In general, this is not possible. Perhaps if you were to supply a type signature, I could understand what you wanted the compiler to do, but without, it's just too hard. What you can do is use record labels. Here, you just name the two Ints the same thing and get what you want: > data Test = T1 { test :: Int } | T2 { test :: Int } this is more general, in that you can say: > data Shape = Circle { center_x :: Double, center_y :: Double, radius > :: Double } > | Ellipse { center_x :: Double, center_y :: Double, radius_x :: Double, radius_y :: Double } and get all the functions for free -- Hal Daume III | hdaume@isi.edu "Arrest this man, he talks in maths." | www.isi.edu/~hdaume On 24 Apr 2003, Steffen Mazanek wrote: > Hello. > I am sure this question is not new. Even so, please > give me the solution or point me to an old thread. > > How can I implement something like: > > data Test = T1 Int | T2 Int > test::Test->Int > test (_ x) = x > > Or is this impossible? In case of yes, why? > This would save a lot of case differentiations in > my application. Or is there an appropriate compiler option? > > Good night, > Steffen > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From C.Reinke@ukc.ac.uk Thu Apr 24 01:14:56 2003 From: C.Reinke@ukc.ac.uk (C.Reinke) Date: Thu, 24 Apr 2003 01:14:56 +0100 Subject: Call for Contributions - HC&A Report (May 2003 edition) Message-ID: Dear Haskellers, following the early reminder in the preface of the last edition, you've probably been waiting already, contribution in hand, eager to send it in for the May edition of our report (hey, editors can have their dreams, too!-), so here it is: *your* invitation to contribute to the fourth edition of the Haskell Communities & Activities Report http://www.haskell.org/communities/ These bi-annual HC&A Reports should give a birds-eye view of Haskell development over the last 6 months, and perhaps an outlook over concrete plans for the next 6 months. The current plan is to get contributions in by the end of April, and to get the collective report out early next month (some of you will find this an excellent opportunity to collect your thoughts about what to submit to this year's Haskell Workshop, btw;-). The general idea is to update all existing summaries (these reports are really about recent/current activities), to drop any topics that haven't had any activity for two consecutive 6-month periods, and to add any new developments or topics for which no-one contributed summaries to the previous edition, while trying to keep the whole from blowing up (last time, we ended up with about 30 pages). New suggestions for current hot topics, activities, projects, .. are welcome - especially with names and addresses of potential contacts, but here is a non-exclusive list of likely topics: General Haskell developments; Haskell implementations; Haskell extensions; Standardization and documentation; Haskell tutorials, how-tos and wikis; Organisation of Haskell tool and library development; Haskell-related projects and publications; Feedback from specialist mailing lists to the Haskell community as a whole; Haskell libraries or tools; Applications of Haskell; Haskell announcements; .. all (recent) things Haskell Announcements: if you've announced anything new on the Haskell list over the last six months, you'll want to make sure that is reflected in this edition. Project pings: if you're maintaining a Haskell tool/library/.., you'll want to let everyone know that it is still alive and actively maintained, even if there may have been no new additions. Tutorials: if you've fought with some previously undocumented corner of Haskell, and have been kind enough to write down how you did manage to build that networking program, or if you've written a tutorial about some useful programming techniques/patterns, this is your opportunity to spread the word (btw, short, topic-specific, and hands-on tutorials that only show how to achieve a certain practical task would do a lot to make things easier for new Haskellers - Erlang and Perl folks seem to be good at this kind of thing, but why not have a similar effort for Haskell?) Applications: if you've been working quietly, using Haskell for some interesting project or application (commercial or otherwise), you might want to let others know about it, and about your experiences using the existing tools and libraries; are you using Haskell on your job? Feedback: if you're on one of the many specialist Haskell mailing lists, you'll want to report on whatever progress has been made there (GUI API discussions, library organisation, etc.) If you're unsure whether a contact for your area of work has come forward yet, have a look at the report's potential topics page, or get in touch with me. I've contacted last time's contributors, hoping they will volunteer to provide updates of their reports, and will update the contacts on the topics page fairly regularly. But where you don't yet see contacts listed for your own subject of interest, you are very welcome to volunteer, or to remind your local community/project team/mailing list/research group/etc. that they really ought to get their act together and let the Haskell community as a whole know about what they've been doing!-) A typical summary report about a tool/library/project/application/.. would be between 1 and 3 paragraphs of ASCII text (what's it about? major topics and results since the last report? current hot topics? major goals for the next six months?) plus pointers to material for further reading (typically to a home page, or to mailing list archives, specifications and drafts, implementations, meetings, minutes,..). Browsing through previous editions should give you a good idea. Looking forward to your contributions, Claus -- Haskell Communities and Activities Report (May 2003 edition) All contributions are due in by the end of April 2003! http://www.haskell.org/communities/ From Keith.Wansbrough@cl.cam.ac.uk Thu Apr 24 10:19:01 2003 From: Keith.Wansbrough@cl.cam.ac.uk (Keith Wansbrough) Date: Thu, 24 Apr 2003 10:19:01 +0100 Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: Your message of "Wed, 23 Apr 2003 11:26:09 PDT." <200304231126.09872.moran@galois.com> Message-ID: Andy Moran wrote: > I use haddock to document interfaces for modules and it works wonderfully > for that (and it would be even better if I could use haddock comments > inside records and in between constructor arguments, hint, hint). > > But I find myself using it in comments within code (especially within local > functions) too. Perhaps a haddock that had two modes (one for interfaces, > one for implementation) would work. The interface mode would work as it > does now. The implementation mode would produce a .html version of the > entire module, using haddock comments to mark it up. I would find this very useful too, even without fancy syntax highlighting and crossreferences for the code (although they would of course be nice!). --KW 8-) -- Keith Wansbrough http://www.cl.cam.ac.uk/users/kw217/ University of Cambridge Computer Laboratory. From Ralf.Laemmel@cwi.nl Thu Apr 24 12:10:18 2003 From: Ralf.Laemmel@cwi.nl (Ralf Laemmel) Date: Thu, 24 Apr 2003 13:10:18 +0200 Subject: Extracting values from several data constructors References: <1051137906.80596.17.camel@pseiko2.studfb.unibw-muenchen.de> Message-ID: <3EA7C61A.32A2AC8C@cwi.nl> Would you mind to become a bit more generic? The following works with the gmap combinators. -- Find an immediate subterm of type y given a subterm of type x findOne :: (Term x, Term y) => x -> Maybe y findOne = singleton . foldl unJust [] . gmapQ (Nothing `mkQ` Just) where unJust l (Just x) = x:l unJust l Nothing = l singleton [s] = Just s singleton _ = Nothing (That is, we map over all the immediate subterms to select all entities of type y. Then, we fold over this list of maybes to reduce it to a list of y's. Then, we insist on a singleton list for the sake of an unambiguous solution.) For details: http://www.cs.vu.nl/Strafunski/gmap/ Ralf Steffen Mazanek wrote: > > Hello. > I am sure this question is not new. Even so, please > give me the solution or point me to an old thread. > > How can I implement something like: > > data Test = T1 Int | T2 Int > test::Test->Int > test (_ x) = x > > Or is this impossible? In case of yes, why? > This would save a lot of case differentiations in > my application. Or is there an appropriate compiler option? > > Good night, > Steffen > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell -- Ralf Laemmel VU & CWI, Amsterdam, The Netherlands http://www.cs.vu.nl/~ralf/ http://www.cwi.nl/~ralf/ From simonmar@microsoft.com Thu Apr 24 16:10:38 2003 From: simonmar@microsoft.com (Simon Marlow) Date: Thu, 24 Apr 2003 16:10:38 +0100 Subject: Super Haddock (was Re: Literate Programming) Message-ID: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> =20 > This seems like a good way of transitioning from .lhs to=20 > haddock'd .hs. In=20 > the long run, I think we (meaning Simon :-) should to extend=20 > haddock to=20 > take the place of the .lhs style of documenting code. To generate .hs from .lhs, the right way is to use GHC: $ ghc -E Foo.lhs -o Foo.hs The great thing about this is that it goes through the same preprocessing stages that your source goes through in order to compile it. So for example if you use CPP on your source too, just say 'ghc -E -cpp' to get the preprocessed output. > I use haddock to document interfaces for modules and it works=20 > wonderfully=20 > for that (and it would be even better if I could use haddock comments=20 > inside records and in between constructor arguments, hint, hint). >=20 > But I find myself using it in comments within code=20 > (especially within local=20 > functions) too. Perhaps a haddock that had two modes (one=20 > for interfaces,=20 > one for implementation) would work. The interface mode would=20 > work as it=20 > does now. The implementation mode would produce a .html=20 > version of the=20 > entire module, using haddock comments to mark it up. >=20 > Simon: how much work would this be? That's an interesting idea. It's not at all what Haddock was intended for, but that's not to say it couldn't be done! There are some issues to do with how you want the output to look: should it retain the indentation of the original source, or ident according to some fixed style? If you want the indentation from the original source then Haddock's front end will need some changes to support retaining that information. Throwing away the original indentation and generating output indented according to a fixed style would be rather easier. Cheers, Simon From moran@galois.com Thu Apr 24 16:49:57 2003 From: moran@galois.com (Andy Moran) Date: Thu, 24 Apr 2003 08:49:57 -0700 Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> References: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> Message-ID: <200304240849.57856.moran@galois.com> On Thursday 24 April 2003 08:10 am, Simon Marlow wrote: > > Simon: how much work would this be? > > That's an interesting idea. It's not at all what Haddock was intended > for, but that's not to say it couldn't be done! Glad to hear it. > There are some issues to do with how you want the output to look: should > it retain the indentation of the original source, or ident according to > some fixed style? If you want the indentation from the original source > then Haddock's front end will need some changes to support retaining > that information. Throwing away the original indentation and generating > output indented according to a fixed style would be rather easier. I agree. One could imagine providing a mildly configurable style (for example, do notation has a few widely used competing styles: layout only, braces and semis, or even totally Utrecht). Cheers, Andy -- Andy Moran Ph. (503) 526 3472 Galois Connections Inc. Fax. (503) 350 0833 3875 SW Hall Blvd. http://www.galois.com Beaverton, OR 97005 moran@galois.com From sk@mathematik.uni-ulm.de Wed Apr 23 21:12:45 2003 From: sk@mathematik.uni-ulm.de (Stefan Karrmann) Date: Wed, 23 Apr 2003 22:12:45 +0200 Subject: FW: Library infrastructure In-Reply-To: <20030422132533.0bb4216d.seth@cql.com> References: <20030422132533.0bb4216d.seth@cql.com> Message-ID: <20030423201245.GB3189@johann.karrmann.de> Seth Kurtzberg (Tue, Apr 22, 2003 at 01:25:33PM -0700): > The issues for such a system are I believe more complex than is immediately apparent, and some of the early responses indicate that the complexity of the issue may not be well understood. > > I would recommend a more incremental approach with more limited initial goals. Specifically, with X meaning to be determined: > > 1. A Haskell library is distributed in X format > > 2. After downloading, a Haskell library is built using procedure X. All libraries are built using the same sequence. Preferably the sequence is the same for the three compilers, and the build process is smart enough to determine which compiler is available, and adjust accordingly. There should be a build time option to override the automatic compiler choice. > > 3. A Haskell library is installed into directory (tree?) X. Again, preferably compiler independent, if practical. > > 4. A Haskell library includes, at a minimum, documentation X in format Y. This is the least interesting (at least to many developers :) ), but the _most_ important, requirement. Since Haskell allows literate programming it should be the base for X AND Y. I would prefer the LaTeX variant but plain text should be supported, too. Another issue is a global naming system, cf. java, slash-package , etc. To avoid repetitions in time the year of the first publication should prefix the name, e.g.: 2003/host.org/foo/bar-1.0.0 host.org/2003/foo/bar-42.17.3 A symlink may point to the default version, e.g.: host.org/2003/foo/bar -> host.org/2003/foo/bar-42.17.3 Obviously, these are not Haskell identifiers, so in modules the character / may be replaced by ', - by M (minus), and . by D (dot). Then the user can choose a Haskell-library root, e.g. ~/haskell or /usr/lib/haskell, and put all libraries below it. The source code of each library may be in the sub directory ./src. The compiled library can be in ./lib and the documentation in ./doc. While the data which is needed to compile it like flags, a list of options, etc. may be in ./package. > On Tue, 22 Apr 2003 15:00:39 +0100 > "Simon Peyton-Jones" wrote: > > > Gentle Haskellers > > > > Haskell has now got a decent, hierarchical module system, supported by > > GHC, Hugs and NHC, and the library structure is now quite well > > populated. For example, here are the "base" libraries shipped with GHC > > (similar libraries come with Hugs and Nhc): > > http://www.haskell.org/ghc/docs/latest/html/base/index.html > > > > Languages flourish when libraries are plentiful, reliable, and well > > documented. In an open-source community like the Haskell community, > > plentiful libraries depend on contributions from the community. > > > > The difficulty is that it is currently not obvious what Joe > > Programmer > > should do to contribute a library to the community. > > > > I think this difficulty is a major obstacle to Haskell's > > progress, > > perhaps even the largest single obstacle today. > > > > One route to getting a library widely distributed is to get it into the > > "libraries" source tree used by GHC, Hugs, and NHC. That has the merit > > that the library will be distributed with each of these compilers. But > > it's too much of a "cathedral" approach. There is no way to distribute > > libraries between releases, and it makes the distributions ever larger > > and more complex for the GHC/Hugs/Nhc teams to build. > > > > To complement this, there ought to be an easy "bazaar" way for Joe > > Programmer to implement a library, build distributions, put them up on > > his web site for others to download, and add a link to some central > > library index so that people can find it. Sadly this is not an entirely > > simple task, because (a) the library should work on all Haskell > > implementations, and (b) should be packaged for binary installation on a > > variety of platforms (Windows, Linux, OpenBSD, Mac etc). Indeed, since > > GHC, Hugs and Nhc have different packaging mechanisms, there's a kind of > > (a)*(b) product involved. The bottom line is that today the obstacles > > are high enough to discourage all but the most motivated. > > > > What is needed is some kind of software infrastructure to automate the > > common tasks, and to give clear instructions about the non-automatable > > parts. This infrastructure should not be part of the (complicated) GHC > > (or Hugs, or Nhc) build systems; indeed, while it will certainly contain > > implementation-specific parts, its structure should be implementation > > independent. Simon Marlow emitted a message a while ago about this, > > but discussion petered out: > > > > http://www.haskell.org/pipermail/glasgow-haskell-users/2002-November/thr > > ead.html#4322 > > > > The lack of this library-building infrastructure is a serious problem. > > Solving it, or even partially solving it, would be a huge step forward. > > So this message is really to try to kick-start the process again. Is > > anyone willing to invest effort in making this happen? > > > > It's probably a task that is too big for one person. I think what we > > need is > > > > A library-infrastructure Czar, who will > > a) do the core design and implementation > > b) coordinate the whole thing to make sure progress happens > > > > A bunch of library-infrastructure Supporters, who are willing > > a) to contribute thoughtfully to the design > > b) to implement pieces of it, for example pieces specific to one > > implementation > > (e.g. GHC) or one target architecture (e.g. PowerPC) > > > > > > Perhaps the first thing to do is to assemble list of people who would be > > willing to contribute as supporters (in the above sense), hoping that a > > Czar may then emerge by popular acclaim. Would you like to reply, > > perhaps to the 'libraries@haskell.org' list, so indicate interest. > > > > I really think this is important. If we do not collectively > > evolve a way > > to develop libraries in "bazaar" mode, I think Haskell will at > > best develop > > more slowly, and at worst wither away. > > > > Simon > > > > PS1: This is all distinct from the question of library *content* --- > > that is, what the module name, discussion about the signature of the > > exported types and functions are --- which does seem be handled OK by > > the 'libraries' list. This message concerns library-building > > *infrastructure*. > > > > PS2: Another entirely-orthogonal question is where library source code > > *lives*. One possibility is to use the same CVS repository that > > GHC/Hugs/Nhc use for libraries, albeit in a separate subtree. Perhaps > > fptools/user-libs/joe-bloggs/*. Another possibility is SourceForge. > > Finding backed-up CVS space for source code is not a problem. Sincerly, -- Stefan From Steffen.Mazanek@UniBw-Muenchen.de Fri Apr 25 00:15:04 2003 From: Steffen.Mazanek@UniBw-Muenchen.de (Steffen Mazanek) Date: 25 Apr 2003 01:15:04 +0200 Subject: Extracting values from several data constructors In-Reply-To: References: Message-ID: <86k7djcwsn.fsf@pseiko2.studfb.unibw-muenchen.de> > > What you can do is use record labels. Here, you just name the two Ints > the same thing and get what you want: > > > data Test = T1 { test :: Int } | T2 { test :: Int } Thank you all, that is exactly what I need! From Steffen.Mazanek@UniBw-Muenchen.de Fri Apr 25 00:20:52 2003 From: Steffen.Mazanek@UniBw-Muenchen.de (Steffen Mazanek) Date: 25 Apr 2003 01:20:52 +0200 Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> References: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> Message-ID: <86adefcwiz.fsf@pseiko2.studfb.unibw-muenchen.de> Hello. > To generate .hs from .lhs, the right way is to use GHC: > > $ ghc -E Foo.lhs -o Foo.hs Argh, ok, this is really convincing. The next time I will read ghc --help at first :-) I like your ideas about such a "Haskell2Html" or "Super Haddock". Ciao, Steffen From Andre W B Furtado" I was not able to make Haddock run... Invoking it for a simple hello world example > module Main where > > main :: IO() > main = putStrLn "Hello World" gives me the following errors: Warning: module not found: Prelude Warning: Main: the following names could not be resolved: IO Prelude.() Fail: does not exist Action: openFile Reason: No such file or directory File: /usr/local/lib/haddock-0.4/haddock.css Using the option --no-implicit-prelude solves the first problem, but I wonder if this is the correct way to get around it. Using a specified stylesheet instead of the default one that comes with Haddock (--css=filename) solves the last problem, but introduces a new one: Fail: does not exist Action: openFile Reason: No such file or directory File: /usr/local/lib/haddock-0.4/haskell_icon.gif Putting /usr/local/lib/haddock-0.4 in the PATH does not solve the problem... Another attempt to invoke Haddock for other example such as module Test where test :: Int test = 3 gave me the problem: "Warning: Test: the following names could not be resolved: Int" Any ideas of what's going wrong? (My config: WindowsXP + GHC-5.04.2 + Cygwin) Thanks, -- Andre From ketil@ii.uib.no Fri Apr 25 09:09:21 2003 From: ketil@ii.uib.no (Ketil Z. Malde) Date: 25 Apr 2003 10:09:21 +0200 Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> References: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> Message-ID: "Simon Marlow" writes: > Somebody else=B9 wrote: >> This seems like a good way of transitioning from .lhs to=20 >> haddock'd .hs. In the long run, I think we (meaning Simon :-) >> should to extend haddock to take the place of the .lhs style of >> documenting code.=20 > That's an interesting idea. It's not at all what Haddock was intended > for, but that's not to say it couldn't be done! I'm not sure I would like this. I guess I'm one of (the apparently very few?) who are using LaTeX lhs style (using \begin/\end{code}). Would a Haddock replacement give me the same kind of functionality in producing a nice printable copy? I definitely have grown attached to having math, footnotes, page headings, sections, and so on. -kzm =B9) As Exchange doesn't leave useful thread information, I'm not quite sure who. Simon and others, if you must use Exchange, could you take care to leave an attribution, prefereably including the message-id? --=20 If I haven't seen further, it is by standing in the footprints of giants From simonmar@microsoft.com Fri Apr 25 10:36:28 2003 From: simonmar@microsoft.com (Simon Marlow) Date: Fri, 25 Apr 2003 10:36:28 +0100 Subject: problems invoking haddock Message-ID: <9584A4A864BD8548932F2F88EB30D1C60CBC3BAE@tvp-msg-01.europe.corp.microsoft.com> =20 > I was not able to make Haddock run... Invoking it for a=20 > simple hello world example >=20 > > module Main where > > > > main :: IO() > > main =3D putStrLn "Hello World" >=20 > gives me the following errors: >=20 > Warning: module not found: Prelude > Warning: Main: the following names could not be resolved: > IO Prelude.() >=20 > Fail: does not exist > Action: openFile > Reason: No such file or directory > File: /usr/local/lib/haddock-0.4/haddock.css Sounds like Haddock isn't installed properly. What procedure did you use to build/install it? Cheers, Simon From WAIT 2003 Thu Apr 24 21:15:01 2003 From: WAIT 2003 (WAIT 2003) Date: Thu, 24 Apr 2003 23:15:01 +0300 (GMT) Subject: WAIT 2003: Deadline approaching Message-ID: <200304242015.h3OKF1F07766@famaf.unc.edu.ar> ---------------------------------------------------------------------- CALL FOR PAPERS 32 JAIIO - WAIT 2003 Argentinian Workshop on Theoretical Computer Science Buenos Aires - Argentina September 1-5, 2003 Deadline for reception of papers: May 4 ---------------------------------------------------------------------- The Argentinian Workshop on Theoretical Computer Science (WAIT) has become an important Latin American forum for the exchange of ideas and the presentation of research in theoretical computer science and its applications. The workshop aims are to build a bridge between academic and applied research and to stimulate the exchange of ideas and experience between theory and practise in computer science. The meeting includes contributed and invited talks, and tutorials. Further, we are very pleased to announce that there will be a special issue of ENTCS (http://www.elsevier.nl/locate/entcs) dedicated to WAIT 2003 publishing a selection of outstanding contributions. WAIT 2003 (http://wait2003.famaf.unc.edu.ar), the 7-th workshop in the series, will be held in Buenos Aires during September 1-5 (2003) as part of the 32-nd Argentinian Conference on Informatics and Operations Research (32 JAIIO, http://www.jaiio2003.uade.edu.ar). Buenos Aires (http://www.buenosaires.gov.ar/areas/turismo/en/) is a cosmopolitan and modern urban centre easily accessible by plane from most mayor cities in the world. The city is characterised by the multiplicity of its artistic expressions, ranging from the great assortment of sculptures and monuments to streets and corners that surprise with their allegorical reliefs and murals. The climate of Buenos Aires ---oceanic and warm--- is mild all year round, allowing visitors to discover the city on foot in any season. The city offers all categories of accommodation, and food ---which is something of a cult--- is of high quality. TOPICS Submissions are welcome in all fields of Theoretical Computer Science. Specific topics of WAIT 2003 include (but are not limited to): * Logical and algebraic foundations of computer science (logics for computation, category theory, relation algebras, type theory); * Formal methods (formal specification of sequential and concurrent programs, analysis, verification and transformation of programs, model checking); * Algorithms and data structures (sequential, parallel, distributed and on-line computing, probabilistic algorithms); * Automata theory and computational complexity; * Symbolic and algebraic computation; * Quantum Computing; * Bioinformatics. Submissions are expected to contain original research and will be refereed by international experts. Research papers must contain previously unpublished results. They will be judged on the base of originality and importance of their contributions and clarity of presentation. Papers should not exceed 12 pages, including figures and references. PROGRAM COMMITTEE: Martin Abadi (University of California at Santa Cruz) Gilles Barthe (INRIA Sophia-Antipolis) Gabriel Baum (Universidad de La Plata) Veronica Becher (Universidad de Buenos Aires) Vincent Danos (CNRS, Paris VII) Peter Dybjer (University of Gothenburg) Roberto Di Cosmo (PPS, Paris VII) Esteban Feuerstein (Universidad de Buenos Aires) Marcelo Fiore (Cambridge University) (co-chair) Daniel Fridlender (Universidad de Cordoba) (co-chair) Joos Heintz (Universidad de Buenos Aires) Gonzalo Navarro (Universidad de Chile) Peter O'Hearn (QMW, University of London) Alfredo Viola (Universidad de la Republica) IMPORTANT DATES: Deadline for reception of papers.................................May 4 Notification of acceptance.....................................June 27 Deadline for reception of the final version....................July 18 INSTRUCTIONS FOR AUTHORS: To facilitate the dissemination of papers and results, authors are invited to submit their papers in English. However, papers in Spanish or Portuguese are also welcome. Accepted contributions will be published in the Proceedings of the 32 JAIIO. Further, a selection of outstanding contributions will be invited to be published (in English) in a special issue of ENTCS dedicated to WAIT 2003. Papers should respond to ENTCS format (obtainable from http://math.tulane.edu/~entcs/) or similar, and must be submitted electronically in PostScript format (ghostview-readable) or PDF to the following e-mail address: wait2003@famaf.unc.edu.ar. Authors should communicate in a separate e-mail (in ASCII format) the title of the paper together with a short abstract, name and affiliation of all co-authors and their e-mail addresses, phone and FAX numbers. The message should also contain a list of keywords describing the area of the paper. ---------------------------------------------------------------------- From jadrian@mat.uc.pt Fri Apr 25 10:59:05 2003 From: jadrian@mat.uc.pt (Jorge Adriano) Date: Fri, 25 Apr 2003 10:59:05 +0100 Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: References: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> Message-ID: <200304251059.05510.jadrian@mat.uc.pt> On Friday 25 April 2003 09:09, Ketil Z. Malde wrote: > >> This seems like a good way of transitioning from .lhs to > >> haddock'd .hs. In the long run, I think we (meaning Simon :-) > >> should to extend haddock to take the place of the .lhs style of > >> documenting code. > > > > That's an interesting idea. It's not at all what Haddock was intended > > for, but that's not to say it couldn't be done! > > I'm not sure I would like this. I guess I'm one of (the apparently > very few?) who are using LaTeX lhs style (using \begin/\end{code}). > Would a Haddock replacement give me the same kind of functionality in > producing a nice printable copy? I definitely have grown attached to > having math, footnotes, page headings, sections, and so on. That makes two of us. I've been doing almost all my haskell work using lhs files + LaTeX, and I'd really miss it if was removed someday. Haddock documentation seems very nice but it serves a diferent purpose. J.A. From wferi@afavant.elte.hu Fri Apr 25 11:20:33 2003 From: wferi@afavant.elte.hu (Ferenc Wagner) Date: Fri, 25 Apr 2003 12:20:33 +0200 Subject: Super Haddock In-Reply-To: <200304251059.05510.jadrian@mat.uc.pt> (Jorge Adriano's message of "Fri, 25 Apr 2003 10:59:05 +0100") References: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> <200304251059.05510.jadrian@mat.uc.pt> Message-ID: <3oof2uc1zi.fsf@tba.elte.hu> Jorge Adriano writes: > On Friday 25 April 2003 09:09, Ketil Z. Malde wrote: > >> I'm not sure I would like this. I guess I'm one of (the >> apparently very few?) who are using LaTeX lhs style >> (using \begin/\end{code}). Would a Haddock replacement >> give me the same kind of functionality in producing a >> nice printable copy? I definitely have grown attached to >> having math, footnotes, page headings, sections, and so >> on. > > That makes two of us. > I've been doing almost all my haskell work using lhs files > + LaTeX, and I'd really miss it if was removed > someday. Haddock documentation seems very nice but it > serves a diferent purpose. Chalk up one more. Is it possible to use lhs + LaTeX + Haddock (as it is) together meaningfully? If not, will it be? Feri. From joe@informatik.uni-leipzig.de Fri Apr 25 11:22:37 2003 From: joe@informatik.uni-leipzig.de (Johannes Waldmann) Date: Fri, 25 Apr 2003 12:22:37 +0200 (MET DST) Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: <200304251059.05510.jadrian@mat.uc.pt> Message-ID: > On Friday 25 April 2003 09:09, Ketil Z. Malde wrote: > > I'm not sure I would like this. I guess I'm one of (the apparently > > very few?) who are using LaTeX lhs style (using \begin/\end{code}). I don't use .lhs normally but I would love to see some "active lhs", that is, text containing Haskell expressions that actually get evaluated when (or before) typsetting. (Mathematica has this, and I'm sure some other systems do it also.) Preferably accompanied by a class (like Show) producing formatted output - perhaps LaTeX, perhaps HTML. (Example application: I'm writing a graph theory text, and I want to embed pictures that are produced by a Haskell program) I once built a similar beast (for active literate programming in a domain specific language - not Haskell) (but the implementation was done in Haskell, of course) to typeset my PhD thesis. -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/207 -- From joe@informatik.uni-leipzig.de Fri Apr 25 11:32:10 2003 From: joe@informatik.uni-leipzig.de (Johannes Waldmann) Date: Fri, 25 Apr 2003 12:32:10 +0200 (MET DST) Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: Message-ID: > (Example application: I'm writing a graph theory text, > and I want to embed pictures that are produced by a Haskell program) .. and of course I want to use Haskell's type checker to check the math formulas in the text. i. e. I want to type them "as Haskell", not "as LaTeX". -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/207 -- From steffen.mazanek@unibw-muenchen.de Fri Apr 25 12:23:31 2003 From: steffen.mazanek@unibw-muenchen.de (Steffen Mazanek) Date: 25 Apr 2003 13:23:31 +0200 Subject: Super Haddock In-Reply-To: <3oof2uc1zi.fsf@tba.elte.hu> References: <9584A4A864BD8548932F2F88EB30D1C60CB6022D@tvp-msg-01.europe.corp.microsoft.com> <200304251059.05510.jadrian@mat.uc.pt> <3oof2uc1zi.fsf@tba.elte.hu> Message-ID: <1051269811.12396.10.camel@pseiko2.studfb.unibw-muenchen.de> > Is it possible to use lhs + LaTeX + Haddock (as it is) > together meaningfully? If not, will it be? I still like my original idea *g*. It fits this purpose! In my point of view LaTeX commentaries are a good place to hide information for various tools like Haddock. Ok, there is the shortcoming that you have to preprocess the .lhs-files. This may be a little bit confusing at first. Can someone provide a little example of this "active Haskell". Sounds interesting. Ciao, Steffen From oliver@first.in-berlin.de Fri Apr 25 12:36:23 2003 From: oliver@first.in-berlin.de (Oliver Bandel) Date: Fri, 25 Apr 2003 13:36:23 +0200 Subject: [ OT ]: unsubscribe without password? Message-ID: <20030425113623.GA423@first.in-berlin.de> Hello, the listserv-help does not help me to unsubscribe. How can I unsubscribe, when I've forgotten my password (it's on an old hard-disk, which is not available now...)? Ciao, Oliver From moran@galois.com Fri Apr 25 15:48:27 2003 From: moran@galois.com (Andy Moran) Date: Fri, 25 Apr 2003 07:48:27 -0700 Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: References: Message-ID: <200304250748.27332.moran@galois.com> [ Simon moved the thread to cafe, but I note there is still some activity i= n=20 the main list, hence the crosspost. ] On Friday 25 April 2003 02:34 am, Simon Marlow wrote: > Ketil Z. Malde writes: > > "Simon Marlow" writes: > > > Somebody else=B9 wrote: > > >> This seems like a good way of transitioning from .lhs to > > >> haddock'd .hs. In the long run, I think we (meaning Simon :-) > > >> should to extend haddock to take the place of the .lhs style of > > >> documenting code. > > > > > > That's an interesting idea. It's not at all what Haddock > > > > was intended > > > > > for, but that's not to say it couldn't be done! > > > > I'm not sure I would like this. I guess I'm one of (the apparently > > very few?) who are using LaTeX lhs style (using \begin/\end{code}). > > Would a Haddock replacement give me the same kind of functionality in > > producing a nice printable copy? I definitely have grown attached to > > having math, footnotes, page headings, sections, and so on. > > Haddock isn't (intended to be) a literate programming system, so I don't > imagine it will replace full LaTeX literate source any time soon. The > suggestion is just that it could produce nicely-formatted source code > complete with lightly marked-up comments - which I think is a fine idea, > and not too difficult to implement using the existing framework. I just want to back Simon up here. My original post was intended to=20 motivate a lightweight alternative to LaTeX lhs style, _not_ a replacement. I'm delighted that there are people that use literate Haskell. I don't:=20 it's too unwieldy for my purposes. When documenting code for a small team of developers, when that code is=20 fluid, and must be maintained, having professional, very attractive,=20 browsable source code documentation is a wonderful thing. When you can=20 produce that documentation with such minimal mark-up, it's going to get=20 used.=20 Cheers, Andy =2D-=20 Andy Moran Ph. (503) 526 3472 Galois Connections Inc. Fax. (503) 350 0833 3875 SW Hall Blvd. http://www.galois.com Beaverton, OR 97005 moran@galois.com From steffen.mazanek@unibw-muenchen.de Fri Apr 25 18:38:58 2003 From: steffen.mazanek@unibw-muenchen.de (Steffen Mazanek) Date: 25 Apr 2003 19:38:58 +0200 Subject: Subtyping Message-ID: <1051292338.17287.12.camel@pseiko2.studfb.unibw-muenchen.de> Hello. Yet another question: Consider a type structure like in "Typing Haskell in Haskell" where types are curried, e.g. data Type = TAp Type Type | TCon Id Kind | TVar Id Kind This means, "(->) Int" is a valid type. In a subtype calculus you can say, that "a->b" is a subtype of "c->d" if "b" is a subtype of "d" and "c" is a subtype of "a", because "->" is contravariant in its first and covariant in its second argument. So far so good, how can be dealt with subtyping and "partial" types? E.g. is it acceptable to say that "(->) a" is a subtype of "(->) b" if "b" is a subtype of "a"? Any ideas? Or can someone point me to an online-resource which addresses this topic? Thanks in advance, Steffen -- Haskell: that's where I just curry until fail, unwords any error, drop all undefined, maybe break, otherwise in sequence span isControl and take max $, id: (d:[]) From Oliver Braun Sat Apr 26 10:42:33 2003 From: Oliver Braun (Oliver Braun) Date: Sat, 26 Apr 2003 11:42:33 +0200 Subject: [ANNOUNCE] Haskell on FreeBSD web site Message-ID: <20030426094233.GB38999@unsane.de> --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I have just uploaded a first approach for an "Haskell on FreeBSD" web site: http://haskell.org/freebsd/ Please feel free to give me feedback! Regards, Olli --=20 Oliver Braun :: :: --b5gNqxB1S1yM7hjW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+qlSJwLFrfe8lsboRAn3KAJ4kz0X+yqzebnk7a47eLRGzZJlYFwCguZZf QwWvNzEdneHIpoTQYjHp3Cc= =G/p0 -----END PGP SIGNATURE----- --b5gNqxB1S1yM7hjW-- From Andre W B Furtado" Message-ID: <000001c30c37$3a1ba250$0601a8c0@TESTE> > Sounds like Haddock isn't installed properly. > What procedure did you use to build/install it? I used the "./configure + make + make install" recipe as told by the README file. Everything went ok except for some warnings like: HsParser.hs:4408: Warning: Pattern match(es) are overlapped In a case alternative EOF: _ -> ... Binary.hs:509: Warning: Variable `word8ToWord' is deprecated: use fromIntegral instead Is Haddock compatible with Cygwin? Cheers, -- Andre From anfrench@lshp.gsfc.nasa.gov Fri Apr 25 17:16:48 2003 From: anfrench@lshp.gsfc.nasa.gov (Andrew French) Date: Fri, 25 Apr 2003 12:16:48 -0400 Subject: binary input of 2d and 3d arrays Message-ID: <002201c30b46$128e2e70$e334b780@spenard> Can someone point me to information sources on how to input/output multidimensional binary arrays? I am quite new to Haskell, have read some of Hudak and Thompson, but cant seem to find out how to do this basic task. There must surely be examples posted, but I havent been able to find any. -Andrew French From magnus@cse.ogi.edu Fri Apr 25 19:13:57 2003 From: magnus@cse.ogi.edu (Magnus Carlsson) Date: Fri, 25 Apr 2003 11:13:57 -0700 Subject: Super Haddock (was Re: Literate Programming) In-Reply-To: References: <200304251059.05510.jadrian@mat.uc.pt> Message-ID: <16041.31461.911588.712405@silica.cse.ogi.edu> Johannes Waldmann writes: > > On Friday 25 April 2003 09:09, Ketil Z. Malde wrote: >=20 > > > I'm not sure I would like this. I guess I'm one of (the apparen= tly > > > very few?) who are using LaTeX lhs style (using \begin/\end{code= }). >=20 > I don't use .lhs normally but I would love to see some "active lhs",= > that is, text containing Haskell expressions that actually > get evaluated when (or before) typsetting. > (Mathematica has this, and I'm sure some other systems do it also.) >=20 > Preferably accompanied by a class (like Show)=20 > producing formatted output - perhaps LaTeX, perhaps HTML. > (Example application: I'm writing a graph theory text, > and I want to embed pictures that are produced by a Haskell program)= >=20 > I once built a similar beast (for active literate programming > in a domain specific language - not Haskell)=20 > (but the implementation was done in Haskell, of course) > to typeset my PhD thesis. Thomas Hallgren and I wrote a little system called HacWrite similar to what you describe, for producing our thesis. (Yes, it was procrastination! :-) Basically, it was Haskell, enhanced with a new literal for markup text, within =ABfunny quotation marks like this=BB. Within the text, o= ne could again escape to Haskell by using curly brackets. We had backends generating LaTeX and HTML. For example, the HacWrite source section =ABCongruence rules=BB $do =ABFollowing the style of {cite"berry:chemical"}, we define a bunch of congruence rules which can be used freely to find reaction rules to apply.=BB eqtable eqop [ (s+t , t+s ,=ABCommutativity of {parop}=BB) , (p(s+t)+u , s+p(t+u) ,=ABAssociativity of {parop}=BB) , (p(s< Dear Haskell Guys, None of the www.numeric-quest.com pages are available. Has anyone mirrored that stuff elsewhere? Thanks, Mike Fagan From nordland@sm.luth.se Sun Apr 27 09:54:21 2003 From: nordland@sm.luth.se (Johan Nordlander) Date: Sun, 27 Apr 2003 10:54:21 +0200 Subject: Subtyping In-Reply-To: <1051292338.17287.12.camel@pseiko2.studfb.unibw-muenchen.de> Message-ID: > Hello. > > Yet another question: > Consider a type structure like in "Typing Haskell in Haskell" where > types are curried, e.g. > > data Type = TAp Type Type | TCon Id Kind | TVar Id Kind > > This means, "(->) Int" is a valid type. In a subtype calculus > you can say, that "a->b" is a subtype of "c->d" if "b" is a subtype > of "d" and "c" is a subtype of "a", because "->" is contravariant > in its first and covariant in its second argument. > So far so good, how can be dealt with subtyping and "partial" types? > E.g. is it acceptable to say that "(->) a" is a subtype of "(->) b" > if "b" is a subtype of "a"? > Any ideas? Or can someone point me to an online-resource which > addresses this topic? > > Thanks in advance, > Steffen It all depends on the variance, or polarity, of the partial type expression, which must somehow be derivable from the applied type operator (-> in your case). I suggest checking out the work by Martin Steffen on higher-order subtyping; the paper "Polarized Higher-Order Subtyping" should be of particular interest. Martin's papers can be found at http://www.informatik.uni-kiel.de/~ms/Steffen/papers.html -- Johan From mlang@delysid.org Sun Apr 27 14:13:23 2003 From: mlang@delysid.org (Mario Lang) Date: Sun, 27 Apr 2003 15:13:23 +0200 Subject: Super Haddock In-Reply-To: (Johannes Waldmann's message of "Fri, 25 Apr 2003 12:22:37 +0200 (MET DST)") References: Message-ID: <87he8k13t8.fsf@lexx.delysid.org> Johannes Waldmann writes: >> On Friday 25 April 2003 09:09, Ketil Z. Malde wrote: > >> > I'm not sure I would like this. I guess I'm one of (the apparently >> > very few?) who are using LaTeX lhs style (using \begin/\end{code}). > > I don't use .lhs normally but I would love to see some "active lhs", > that is, text containing Haskell expressions that actually > get evaluated when (or before) typsetting. I'm not sure if this is what you are looking for, but I wrote my first Haskell program that way. I wrote a little style file named runtest.sty, which provides two environments: heval: You can put expressions inside heval, and you get the expression and the result inserted into your document. This uses GHCi. withstdin: Using this environment, you can execute a program giving it some STDIN, and also see the result. Note that runtest.sty depends on the web2c shell_escape, which is disabled by default. Enable it in your texmf.cfg or by setting the environment variable shell_escape If you're interested, see http://delysid.org/Stunden.tar.gz -- CYa, Mario From m.p.donadio@ieee.org Sun Apr 27 15:05:40 2003 From: m.p.donadio@ieee.org (Matthew Donadio) Date: Sun, 27 Apr 2003 10:05:40 -0400 Subject: No more numeric-quest? References: <200304260434.h3Q4YTG18737@hessian.cs.rice.edu> Message-ID: <3EABE3B4.2B5EEAED@ieee.org> Mike Fagan wrote: > None of the www.numeric-quest.com pages are available. > > Has anyone mirrored that stuff elsewhere? I have most of the source code somewhere. What were you looking for? You can also get to archives of it throught www.archive.org -- Matthew Donadio (m.p.donadio@ieee.org) From Christopher.Okasaki@usma.edu Mon Apr 28 13:34:37 2003 From: Christopher.Okasaki@usma.edu (Okasaki, C. DR EECS) Date: Mon, 28 Apr 2003 08:34:37 -0400 Subject: Polymorphic stanamically balanced binary trees Message-ID: <6A683C506D71A4478D4EE9B0EC22815001A6B00B@exmailml07> oleg describes an implementation of AVL trees that have two main features: 1. The trees are heterogenous (elements within the same tree can have different types). 2. The balance condition is partially enforced by the type checker, and partially by run-time checks. For feature 1, you can take your favorite solution for heterogenous lists (existentials, type dynamic, ...) and extend it to trees. This problem is orthogonal to the balance problem, and I'll ignore it in the rest of this post. For feature 2, there are lots of interesting approaches to push this kind of check into the type checker. For example, Hongwei Xi has several variations that do this using dependent types. It can also be done entirely with nested types. I think I first saw this done for AVL trees by Ross Paterson in 1998. First, here's a type that for trees of height h, given types for trees of height h-1 (t1) and for trees of height h-2 (t2). data Node a t1 t2 = Left t1 a t2 | Even t1 a t1 | Right t2 a t1 Next, here's a type for trees of arbitrary height, given types for trees of height h-1 and h-2. data Tree a t1 t2 = Zero t2 | Succ (Tree a (Node a t1 t2) t1) To start things off, we set t2 to the type of trees of height 0 and t1 to the type of trees of height 1. type AVLTree a = Tree a a () For example, a tree like 1 / 2 would be encoded as Succ | Succ | Zero | Left(1) / \ Even(2) () / \ () () Using polymorphic recursion, you can then implement typical tree functions like insert and delete. The type checker will catch any attempt to build an unbalanced tree. Note that there are no run-time checks in this approach. That last statement is a little bit of a lie. There is no run-time typechecking going on, but there are run-time artifacts of this algorithm, namely the Zero and Succ nodes which encode the height of the tree. Zero and Succ are data constructors, not type constructors as they are in oleg's version, so you have to walk through them at run-time. -- Chris From steffen.mazanek@unibw-muenchen.de Mon Apr 28 19:24:12 2003 From: steffen.mazanek@unibw-muenchen.de (Steffen Mazanek) Date: 28 Apr 2003 20:24:12 +0200 Subject: Online judge and Haskell? Message-ID: <1051554251.186.42.camel@pseiko2.studfb.unibw-muenchen.de> Hello, it's me again and I have a new mad idea. There are a lot of programming contests out there and unfortunately most (all?) of them do not allow Haskell code till now! I think, this is hard to accept. Why not ask the people which run acm.uva.es/problemset to provide their problem sets, input and output files and the basic judging software and install it at haskell.org? Alternatively this may be a nice project for a student. I think an adaption of this software to permit Haskell code can not be that difficult! Do you think there is a need for such a project? Maybe it could help Haskell to become a part of official programming contests and hence to gain more popularity. I'm sorry to say, that due to another project my free time is very limited so I can not get it going by only myself. Ciao, Steffen -- Haskell: that's where I just curry until fail, unwords any error, drop all undefined, maybe break, otherwise in sequence span isControl and take max $, id: (d:[]) From C.Reinke@ukc.ac.uk Mon Apr 28 19:32:38 2003 From: C.Reinke@ukc.ac.uk (C.Reinke) Date: Mon, 28 Apr 2003 19:32:38 +0100 Subject: REMINDER - Contributions to HC&A Report (May 2003 edition) Message-ID: Dear Haskeller, as you can see from the Report's topics page at http://www.haskell.org/communities/topics.html , both confirmations from well-known contributors and offers from new contributors are still a bit sparse at this stage (not to mention actual contributions:), although we're making progress. First, many thanks to those who simply write their reports and are done with it! But, if the call for contributions should have caught you in your extended Easter holidays, could you please let me know as soon as possible how long that will delay your contributions?-) I wouldn't want to extend the general target deadline by much, as people should really get going on their Haskell Workshop papers soon (hint!-), but we may be able to accomodate individual delays. Just keep in mind that this is really an informal exercise: it probably takes less time to sit down and write an update of your report than it takes to worry about delays and making time.. Otherwise, could everybody send in their individual reports ** by the end of THIS week ** ? Please?-) Thanks, Claus -- Haskell Communities and Activities Report (May 2003 edition) Contributions are due in by the end of THIS week! http://www.haskell.org/communities/ ======================= original call for contributions follows Dear Haskellers, following the early reminder in the preface of the last edition, you've probably been waiting already, contribution in hand, eager to send it in for the May edition of our report (hey, editors can have their dreams, too!-), so here it is: *your* invitation to contribute to the fourth edition of the Haskell Communities & Activities Report http://www.haskell.org/communities/ These bi-annual HC&A Reports should give a birds-eye view of Haskell development over the last 6 months, and perhaps an outlook over concrete plans for the next 6 months. The current plan is to get contributions in by the end of April, and to get the collective report out early next month (some of you will find this an excellent opportunity to collect your thoughts about what to submit to this year's Haskell Workshop, btw;-). The general idea is to update all existing summaries (these reports are really about recent/current activities), to drop any topics that haven't had any activity for two consecutive 6-month periods, and to add any new developments or topics for which no-one contributed summaries to the previous edition, while trying to keep the whole from blowing up (last time, we ended up with about 30 pages). New suggestions for current hot topics, activities, projects, .. are welcome - especially with names and addresses of potential contacts, but here is a non-exclusive list of likely topics: General Haskell developments; Haskell implementations; Haskell extensions; Standardization and documentation; Haskell tutorials, how-tos and wikis; Organisation of Haskell tool and library development; Haskell-related projects and publications; Feedback from specialist mailing lists to the Haskell community as a whole; Haskell libraries or tools; Applications of Haskell; Haskell announcements; .. all (recent) things Haskell Announcements: if you've announced anything new on the Haskell list over the last six months, you'll want to make sure that is reflected in this edition. Project pings: if you're maintaining a Haskell tool/library/.., you'll want to let everyone know that it is still alive and actively maintained, even if there may have been no new additions. Tutorials: if you've fought with some previously undocumented corner of Haskell, and have been kind enough to write down how you did manage to build that networking program, or if you've written a tutorial about some useful programming techniques/patterns, this is your opportunity to spread the word (btw, short, topic-specific, and hands-on tutorials that only show how to achieve a certain practical task would do a lot to make things easier for new Haskellers - Erlang and Perl folks seem to be good at this kind of thing, but why not have a similar effort for Haskell?) Applications: if you've been working quietly, using Haskell for some interesting project or application (commercial or otherwise), you might want to let others know about it, and about your experiences using the existing tools and libraries; are you using Haskell on your job? Feedback: if you're on one of the many specialist Haskell mailing lists, you'll want to report on whatever progress has been made there (GUI API discussions, library organisation, etc.) If you're unsure whether a contact for your area of work has come forward yet, have a look at the report's potential topics page, or get in touch with me. I've contacted last time's contributors, hoping they will volunteer to provide updates of their reports, and will update the contacts on the topics page fairly regularly. But where you don't yet see contacts listed for your own subject of interest, you are very welcome to volunteer, or to remind your local community/project team/mailing list/research group/etc. that they really ought to get their act together and let the Haskell community as a whole know about what they've been doing!-) A typical summary report about a tool/library/project/application/.. would be between 1 and 3 paragraphs of ASCII text (what's it about? major topics and results since the last report? current hot topics? major goals for the next six months?) plus pointers to material for further reading (typically to a home page, or to mailing list archives, specifications and drafts, implementations, meetings, minutes,..). Browsing through previous editions should give you a good idea. Looking forward to your contributions, Claus -- Haskell Communities and Activities Report (May 2003 edition) All contributions are due in by the end of April 2003! http://www.haskell.org/communities/ _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell From t.zielonka@students.mimuw.edu.pl Mon Apr 28 20:41:23 2003 From: t.zielonka@students.mimuw.edu.pl (Tomasz Zielonka) Date: Mon, 28 Apr 2003 21:41:23 +0200 Subject: Online judge and Haskell? In-Reply-To: <1051554251.186.42.camel@pseiko2.studfb.unibw-muenchen.de> References: <1051554251.186.42.camel@pseiko2.studfb.unibw-muenchen.de> Message-ID: <20030428194123.GA5163@students.mimuw.edu.pl> On Mon, Apr 28, 2003 at 08:24:12PM +0200, Steffen Mazanek wrote: > Hello, Hello! > it's me again and I have a new mad idea. > There are a lot of programming contests out there > and unfortunately most (all?) of them do not allow > Haskell code till now! > I think, this is hard to accept. I agree wholeheartedly. > Why not ask the people which run > > acm.uva.es/problemset > > to provide their problem sets, input and output files > and the basic judging software and install it at > haskell.org? I think the best would be to convince them to allow Haskell solutions in http://acm.uva.es/problemset. I don't think that they will reveal input and output files - I surely would not. Having Haskell amongst languages supported by this site would have many advantages: a) you could compare Haskell programs to programs in other languages (but only in terms of efficiency, not programming techniques). b) you could use your existing account on this site (I have one) c) other contestants could get interested in learning Haskell > I think an adaption of this software to permit Haskell code can not be > that difficult! I think there would be some work in ensuring security. They don't run a complete virtual machine (like in VMware or Bochs) to guard against malicious programs. They simply don't allow to use some functions. One of possible judge responses is: * Restricted Function (RF): Your source program tried to use a not allowed function (such as fork(), fopen(), ...) One way of enforcing polite behaviour of Haskell programs could be to accept only modules with function solve :: String -> String which would be run with interact, and to disallow all functions which can break referential transparency, like unsafePerformIO. Or am I missing something? I have already tried to convince them to include some FP. Here is the response I got: > From marce@fernandonajera.com Fri Aug 9 22:39:11 2002 > From: "Carlos Marcelino Casas Cuadrado" > To: "Tomasz Zielonka" > Subject: Re: How about supporting some functional language? > Date: Fri, 9 Aug 2002 22:24:31 +0200 > > Dear Tomasz Zielonka, > First of all thank you for your help, but we are not thinking about installing > another languaje on the judge. We still have some problems with Pascal, and we > haven't finished installing Java (it has a lot of security problems). We prefer > make Pascal and Java work before installing another one. Maybe on the future > we'll consider installing OCaml or some other (a lot of people ask us about a > lot of them). > Thanks again. > Carlos. > PS: Anyway, the ACM contest only allows C(C++), Pascal and Java (well, they used to). > > ----- Original Message ----- > From: "Tomasz Zielonka" > To: > Sent: Wednesday, August 07, 2002 12:21 PM > Subject: How about supporting some functional language? > > > Hello! > > > > What is your opinion on adding some functional programming language to > > the list of languages supported by the judge? > > > > When I solve programming problems, I often start with a prototype in a > > FPL like Haskell, Clean, SML or OCaml. Sometimes this prototype, being > > prototype after all, is too slow or consumes to much memory. But often > > it is as efficient as a program I write later in C or C++. I would be > > very happy if I could just send this program and move on to other > > problems. > > > > I have good experience with using FPL in programming contest. There was > > an online programming contest in Poland, called Pogromcy Algorytmow > > (Algorithms Busters or Algorithms' Busters). In this year's edition one > > could use Pascal, C, C++ and OCaml to write the solutions. I used OCaml > > in 9 out of 13 problems and I don't regret that. > > > > I imagine that you wouldn't install all of the languages I mentioned, > > but probably one of them. > > If you are willing to consider my proposition, I can offer my help in > > choosing the language, its implementation and tayloring it for use in > > online programming contest. > > > > Best regards, > > Tom Who knows, maybe they would be willing to support Haskell now? Especially, if it would be just that easy to ensure security. > Ciao, > Steffen Best regards, Tom -- .signature: Too many levels of symbolic links From rjmh@cs.chalmers.se Tue Apr 29 08:26:32 2003 From: rjmh@cs.chalmers.se (John Hughes) Date: Tue, 29 Apr 2003 09:26:32 +0200 (MET DST) Subject: seeking lore of the QuickCheck masters In-Reply-To: <20030415114025.0f004774.Malcolm.Wallace@cs.york.ac.uk> References: <20030411143452.7311E4051@labrador.eecs.harvard.edu> <20030415114025.0f004774.Malcolm.Wallace@cs.york.ac.uk> Message-ID: On Tue, 15 Apr 2003, Malcolm Wallace wrote: > nr@eecs.harvard.edu (Norman Ramsey) writes: > > > I am playing around with an implementation of a little language, > > and I would like to use QuickCheck to test my code. My problem is > > that I want to test only well-typed terms. I don't know how to craft > > my `arbitrary' functions so that the probability of generating a well-typed > > term is more than vanishingly small. Can anybody pass on interesting > > tips and tricks that might help? > > You want a generator that can produce an arbitrary code fragment, > *given* what type you want it to have. So first, generate an arbitrary > type, then generate an arbitrary expression for it. > > Assuming that your little language is sort-of functional, then to > generate a code fragment for a given type, say Int, you might have > the following choices: > > * Generate a literal value :: Int > * Generate a conditional. > e.g. if then else > * Generate a case. > e.g. case of > -> > -> > * and so on for other language constructs. > * Generate an application of a unary function > :: ArbitraryType a => a -> Int > or perhaps :: ArbitraryTypeInvolving Int a => a -> Int > to a value of the constrained type. > * Generate an application of a binary function > :: (ArbitraryType a) => a -> (a -> Int) > or :: (ArbitraryType a, ArbitraryType b) => a -> (b -> Int) > or :: (ArbitraryTypeInvolving Int a) => a -> (a -> Int) > or :: (ArbitraryTypeInvolving Int a, ArbitraryType b) => a -> (b -> Int) > or :: (ArbitraryTypeInvolving Int b, ArbitraryType a) => a -> (b -> Int) > to a value of the constrained type. > * and so on for more complex types. > > It is quite a lot trickier than this little sketch, I'm sure, but I > hope this helps to spark some more ideas. > > Regards, > Malcolm Yes, this is how I would do it. Then, of course, it's important to control the size of the generated terms. I would write a sized generator dividing the size between sub-expressions, and restricting expressions to be lambdas, constants or variables when the size reaches zero. John From pjs@cs.mu.oz.au Tue Apr 29 00:05:08 2003 From: pjs@cs.mu.oz.au (pjs@cs.mu.oz.au) Date: Tue, 29 Apr 2003 09:05:08 +1000 Subject: FIRST CALL for PAPERS -- FLOPS2004 Message-ID: <16046.1051571108.1@muldi.cs.mu.oz.au> ------- Blind-Carbon-Copy X-Mailer: exmh version 2.5 10/15/1999 with version: MH 6.8.4 #1[UCI] To: pjs@cs.mu.oz.au Subject: FIRST CALL for PAPERS -- FLOPS2004 From: pjs@cs.mu.oz.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 29 Apr 2003 09:05:08 +1000 Message-ID: <16046.1051571108@muldi.cs.mu.oz.au> Sender: pjs@muldi.cs.mu.oz.au Apologies if you recieve this mail more than once. - -------------------------------------------------- *********************************************************************** * * * CALL FOR PAPERS * * * * Seventh International Symposium on Functional and Logic Programming * * (FLOPS 2004) * * * * Nara-Ken New Public Hall, Nara, Japan * * April 7-9, 2004 * * * * (http://logic.is.tsukuba.ac.jp/FLOPS2004/) * * * *********************************************************************** Background ========== The symposium is a forum for research on all issues concerning functional programming and logic programming. In particular, it wants to stimulate the cross-fertilization as well as integration of the two paradigms. The symposium takes place about every 1.5 years in Japan. Previous FLOPS meetings were held in Fuji Susono (1995), Shonan Village (1996), Kyoto(1998), Tsukuba (1999), Tokyo (2001) and Aizu (2002). Topics ====== The Seventh International Symposium on Functional and Logic Programming (FLOPS 2004) solicits original papers in all areas of functional and logic programming, including (but not limited to): * Declarative Pearls: new and excellent declarative programs with illustrative applications * Language issues: language design and constructs, programming methodology, integration of paradigms, interfacing with other languages, type systems, constraints, concurrency and distributed computing * Foundations: logic and semantics, rewrite systems and narrowing, type theory, proof systems * Implementation issues: compilation techniques, memory management, program analysis and transformation, partial evaluation, parallelism * Applications: case studies, industrial applications, graphical user interfaces, internet applications, database connection, formal methods and model checking Invited Speakers ================ The following three distinguished researchers have accepted to give invited talks at FLOPS 2004. * Masami Hagiya University of Tokyo * Carsten Schuermann Yale University * Peter Selinger University of Ottawa Submissions =========== Submissions must be unpublished and not submitted for publication elsewhere. Work that already appeared in unpublished or informally published workshops proceedings may be submitted. Submissions should fall into one of the following categories: * Regular research papers: they should describe new results and will be judged on originality, correctness and significance. * System descriptions: they should contain a link to a working system and will be judged on originality, usefulness and design. All submissions must be written in English and can be up to 15 proceedings pages long. Authors are strongly encouraged to use LaTeX2e and the Springer llncs class file, available at http://www.springer.de/comp/lncs/authors.html Regular research papers should be supported by proofs and/or experimental results. In case of lack of space, this supporting information should be made accessible otherwise (e.g. a link to a web page, or an appendix). Submission is Web-based. In order to submit a paper, authors should fill in the submission form available at http://logic.is.tsukuba.ac.jp/FLOPS2004/submission.html where more detailed instructions are given. If submission through the Web is not possible, five hard copies may be sent to Yukiyoshi Kameyama Institute of Information Sciences and Electronics University of Tsukuba Tennodai 1-1-1, Tsukuba, 305-8573, JAPAN Publication and presentation of accepted contributions ====================================================== The Proceedings of FLOPS 2004 will be published by Springer Verlag in the Lecture Notes in Computer Science (LNCS) series. LNCS is published, in parallel to the printed books, in full-text electronic version and final versions of the papers will need to be provided electronically including the source files. Proceedings will be available at the conference. One author of each accepted contribution is expected to attend the Symposium in order to present it. Important Dates =============== Submission Deadline: October 1, 2003 Notification: December 15, 2003 Final Version: January 15, 2004 Symposium: April 7-9, 2004 Program Co-Chairs ================= Yukiyoshi Kameyama University of Tsukuba, Japan Peter J. Stuckey University of Melbourne, Australia E-Mail: flops@logic.is.tsukuba.ac.jp Program Committee ================= Francois Fages INRIA Rocquencourt Herman Geuvers Nijmegen University Michael Hanus University of Kiel Martin Hofmann University of Muenchen Haruo Hosoya Kyoto University Yukiyoshi Kameyama University of Tsukuba Naoki Kobayashi Tokyo Institute of Technology John Lloyd Australian National University Aart Middeldorp University of Tsukuba Atsushi Ohori JAIST German Puebla Technical University of Madrid Morten Rhiger IT-University of Copenhagen Amr Sabry Indiana University Peter J. Stuckey University of Melbourne Martin Sulzmann National University of Singapore Kazunori Ueda Waseda University Philip Wadler Avaya Labs Local Arrangements Chair ======================== Jacques Garrigue Kyoto University Sponsors ======== FLOPS2004 is supported by Japan Society of Software Science and Technology (JSSST), Association for Logic Programming (ALP), and Asian Association for Foundation of Software (AAFS) [planed]. ------- End of Blind-Carbon-Copy From alethenorio@home.se Tue Apr 29 14:30:35 2003 From: alethenorio@home.se (Alexandre Weffort Thenorio) Date: Tue, 29 Apr 2003 15:30:35 +0200 Subject: Is it possible to build in a file in a haskell program?? References: <20030411143452.7311E4051@labrador.eecs.harvard.edu> <20030415114025.0f004774.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <000901c30e53$851869f0$0800a8c0@thenorio> Hello again guys. I have made a small program that basically all it does is read a text file and write another text file with the info from the first one. Now let's say I have a bin file and I want the program to still write the text file and also create this bin file. Is it possible to build in this bin file inside the program so everything is inside the executable file (exe) and then when the user runs the program it does it job (write the text file) and also creates this bin file exactly like it was on the same directory the program is being run. Basically I just want this so that the user doesn't have to download anything else than the exe file to be able to run the program fully (the text files and bin files are to be used with another program)??? Best Regards NooK From alethenorio@home.se Tue Apr 29 14:34:36 2003 From: alethenorio@home.se (Alexandre Weffort Thenorio) Date: Tue, 29 Apr 2003 15:34:36 +0200 Subject: Different outputs on a program??? Is it possible? References: <20030411143452.7311E4051@labrador.eecs.harvard.edu> <20030415114025.0f004774.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <000f01c30e54$13fff890$0800a8c0@thenorio> I've made a program that just writes a text file. So the user runs the program and it does its job. What I want to do is that when the user runs the program with a flag (Lets say -h) it just shows a text file on the screen with the program explanation (Or better say help file) but otherwise if no flag given the program does it job. The problem is that writing the file on haskell is IO[] (I think) and outputting a text is IO[String] and then haskell doesn't allow me to have a function where it checks if there is flag, creating a text file if not or outputting a String if so because they are different types of output. Can anybody help me here?? Best Regards Alex From ddarius@hotpop.com Tue Apr 29 15:04:36 2003 From: ddarius@hotpop.com (Derek Elkins) Date: Tue, 29 Apr 2003 10:04:36 -0400 Subject: Different outputs on a program??? Is it possible? In-Reply-To: <000f01c30e54$13fff890$0800a8c0@thenorio> References: <20030411143452.7311E4051@labrador.eecs.harvard.edu> <20030415114025.0f004774.Malcolm.Wallace@cs.york.ac.uk> <000f01c30e54$13fff890$0800a8c0@thenorio> Message-ID: <20030429100436.00003ed1.ddarius@hotpop.com> On Tue, 29 Apr 2003 15:34:36 +0200 "Alexandre Weffort Thenorio" wrote: > I've made a program that just writes a text file. So the user runs the > program and it does its job. What I want to do is that when the user > runs the program with a flag (Lets say -h) it just shows a text file > on the screen with the program explanation (Or better say help file) > but otherwise if no flag given the program does it job. The problem is > that writing the file on haskell is IO[] (I think) and outputting a > text is IO[String] and then haskell doesn't allow me to have a > function where it checks if there is flag, creating a text file if not > or outputting a String if so because they are different types of > output. > > Can anybody help me here?? [] isn't a type. Both outputting text and writing to file both have type IO (). (Heck, they are the same function.) Have you tried this? The most straightforward code works. If you have what errors did you get, what's your code? From wferi@afavant.elte.hu Tue Apr 29 15:49:41 2003 From: wferi@afavant.elte.hu (Ferenc Wagner) Date: Tue, 29 Apr 2003 16:49:41 +0200 Subject: Is it possible to build in a file in a haskell program?? In-Reply-To: <000901c30e53$851869f0$0800a8c0@thenorio> ("Alexandre Weffort Thenorio"'s message of "Tue, 29 Apr 2003 15:30:35 +0200") References: <20030411143452.7311E4051@labrador.eecs.harvard.edu> <20030415114025.0f004774.Malcolm.Wallace@cs.york.ac.uk> <000901c30e53$851869f0$0800a8c0@thenorio> Message-ID: <3oy91t5pfe.fsf@tba.elte.hu> "Alexandre Weffort Thenorio" writes: > Is it possible to build in this bin file inside the > program so everything is inside the executable file (exe) You can find a C/linker magic solution at http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&selm=20020520053155.5B2FD39FC%40overcee.wemm.org See also http://www.gsp.com/cgi-bin/man.cgi?section=1&topic=file2c You probably need FFI to make use of these. Feri. From alethenorio@home.se Tue Apr 29 15:57:41 2003 From: alethenorio@home.se (Alexandre Weffort Thenorio) Date: Tue, 29 Apr 2003 16:57:41 +0200 Subject: Is it possible to build in a file in a haskell program?? References: <20030411143452.7311E4051@labrador.eecs.harvard.edu> <20030415114025.0f004774.Malcolm.Wallace@cs.york.ac.uk> <000901c30e53$851869f0$0800a8c0@thenorio> <3oy91t5pfe.fsf@tba.elte.hu> Message-ID: <002001c30e5f$af5e4a20$0800a8c0@thenorio> Hmm I am not very good at C so is it just not possible to do it with plain haskell, that is, isn't there any haskell function like File2C that does that?? Best Regards NooK ----- Original Message ----- From: "Ferenc Wagner" To: Sent: Tuesday, April 29, 2003 4:49 PM Subject: Re: Is it possible to build in a file in a haskell program?? > "Alexandre Weffort Thenorio" writes: > > > Is it possible to build in this bin file inside the > > program so everything is inside the executable file (exe) > > You can find a C/linker magic solution at > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&selm=20020520053 155.5B2FD39FC%40overcee.wemm.org > See also http://www.gsp.com/cgi-bin/man.cgi?section=1&topic=file2c > > You probably need FFI to make use of these. > Feri. > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From wferi@afavant.elte.hu Tue Apr 29 16:06:55 2003 From: wferi@afavant.elte.hu (Ferenc Wagner) Date: Tue, 29 Apr 2003 17:06:55 +0200 Subject: Is it possible to build in a file in a haskell program?? In-Reply-To: <002001c30e5f$af5e4a20$0800a8c0@thenorio> ("Alexandre Weffort Thenorio"'s message of "Tue, 29 Apr 2003 16:57:41 +0200") References: <20030411143452.7311E4051@labrador.eecs.harvard.edu> <20030415114025.0f004774.Malcolm.Wallace@cs.york.ac.uk> <000901c30e53$851869f0$0800a8c0@thenorio> <3oy91t5pfe.fsf@tba.elte.hu> <002001c30e5f$af5e4a20$0800a8c0@thenorio> Message-ID: <3ovfwx5omo.fsf@tba.elte.hu> "Alexandre Weffort Thenorio" writes: > Hmm I am not very good at C so is it just not possible to > do it with plain haskell, that is, isn't there any haskell > function like File2C that does that?? There are several binary modules for Haskell, but they are nonstandard, and I do not know if any of them will do what you want. Search the archives to get an overview! Feri. From Steven.Krauwer@let.uu.nl Tue Apr 29 12:55:18 2003 From: Steven.Krauwer@let.uu.nl (Steven Krauwer) Date: Tue, 29 Apr 2003 13:55:18 +0200 Subject: ESS2003: Language and Speech Technology for Language Learning Message-ID: <20030429135518.A13960@syntax.let.uu.nl> SECOND ANNOUNCEMENT and CALL for PARTICIPATION The 11th ELSNET Summer School on Language and Speech Communication Topic: Language and Speech Technology in Language Learning Lille (France), Monday July 7 - Friday July 18, 2003 Organized by the University of Lille 3 We are happy to announce that registration for the 11th ELSNET Summer School is now open. For this school we have chosen a topic of great relevance to researchers and developers in Europe and in other multilingual environments: the use of language and speech technology in language learning, both of spoken and of written language. The goal of this workshop is to get young researchers on a track that will eventually contribute to an important application area. The underlying vision (or dream) is The automatic animated language tutor. + Audience and aims: We see the school as mainly research and development oriented, and hence the primary audience are researchers, developers and integrators who will make our vision happen (rather than teachers who would use it). Both technological and pedagogical aspects will be taken into consideration The aims are: * to make the students familiar with the main principles and problems of language learning/teaching * to make them familiar with current best practice in computer assisted language learning * to make them familiar with the main challenges in computer assisted language learning Participants are expected to have a general computational background and some familiarity with language or speech research and/or processing. After completion of the summer school participants should be able to function in teams aimed at designing or implementing tools, environments or courses for Computer Assisted Language Learning (abbreviated CALL). + Course programme: The provisonal programme is available at http://www.elsnet.org/ess2003/schedule.html The 2-weeks programme comprises the following courses: * Introduction to CALL (Teacher: Jozef Colpaert, [Univ of Antwerp]) * Introduction to natural language processing for CALL (Teacher: Wolfgang Menzel [Univ of Hamburg]) * Introduction to speech processing for CALL (Teacher: Philippe Delcloque [MSEC Manchester]) * Using NLP tools in CALL (hands-on) (Teacher: Wolfgang Menzel [Univ of Hamburg]) * Using Speech tools in CALL (hands-on) (Teacher: Michael McTear [Univ of Ulster]) * CALL design and interfaces (Teacher: Philippe Delcloque [MSEC Manchester]) * Grammatical and morphological error diagnosis (Teacher: Lars Borin [Univ of Gothenburg]) * Systems for pronunciation training (Teacher: Anne-Marie Oster [KTH Stockholm]) * Building a grammatical CALL system (hands-on) (Teacher: Lars Borin [Univ of Gothenburg]) * Building a speech CALL system (hands-on) (Teacher: Michael McTear [Univ of Ulster]) All students attend the same full programme, except for the hands-on sessions, where students can sign up for either NLP or Speech oriented streams. In special student sessions students can present their own work. The presentations will be published on the ELSNET website. Please note that the number of places for this summer school is limited and that early registration is recommended. The working language of the Summer School will be English. + Fees: Category Registration fee (euro) Students 125 Academic staff 250 Commercial organisations 500 ELSNET members are entitled to a 20% discount + Food and accommodation: The cost of accommodation (on campus) will be 20 euro per night Meals will be free. + Registration, grants and other information: For detailed information about registration procedures and deadlines, fees, accommodation, grant possibilities, venue, course and social programme, etc visit the ESS2003 website at http://www.univ-lille3.fr/ESS2003 or send an email to the local organizers at elsnetadmin@univ-lille3.fr A limited number of grants (covering the cost of accommodation) may be available. Details and application forms will be published on the website. For information about the programme visit the ESS2003 website or http://www.elsnet.org/ess2003 or contact the chair of the programme committee, Steven Krauwer (steven.krauwer@elsnet.org) __________________________________________________________________________ Steven Krauwer, ELSNET coordinator, UiL-OTS, Trans 10, 3512 JK Utrecht, NL phone: +31 30 253 6050, fax: +31 30 253 6000, email: s.krauwer@elsnet.org http://www.elsnet.org From Keith.Wansbrough@cl.cam.ac.uk Tue Apr 29 17:17:48 2003 From: Keith.Wansbrough@cl.cam.ac.uk (Keith Wansbrough) Date: Tue, 29 Apr 2003 17:17:48 +0100 Subject: Is it possible to build in a file in a haskell program?? In-Reply-To: Your message of "Tue, 29 Apr 2003 15:30:35 +0200." <000901c30e53$851869f0$0800a8c0@thenorio> Message-ID: > Hello again guys. I have made a small program that basically all it does is > read a text file and write another text file with the info from the first > one. Now let's say I have a bin file and I want the program to still write > the text file and also create this bin file. Is it possible to build in this > bin file inside the program so everything is inside the executable file > (exe) and then when the user runs the program it does it job (write the text > file) and also creates this bin file exactly like it was on the same > directory the program is being run. Yes, of course. What you want to do is first write a Haskell (or Perl) program that reads in a file and translates it into a little Haskell program, like this: module MyBinFile ( mybinfile ) where mybinfile :: String mybinfile = "Hello, world\x0A\x1A\x00\x01\x02\ \\x03\x04\x05.....\ \......\x00\x00" (the string continuation syntax is defined in the Haskell report, as are the standard string escapes for characters outside \x20..\x7E) Then your main program looks like this: module Main where import MyBinFile ( mybinfile ) import IO main = do h <- ... open the file you want ... hPutStr h mybinfile hClose h So you run your Haskell/Perl script on the original file to generate the Haskell file MyBinFile.hs, then you compile MyBinFile.hs and Main.hs, and distribute the resulting binary. Warning: compilation may be a bit slow with such a large string. Alternatively, you could get even trickier, by using the linker to stick your original bin file onto the end of the executable. Then you could just open the executable file itself in Haskell, find the bin file, and read it out. You coudl either interpret the ELF/EXE binary format, or just look for a magic string (careful you don't find the pattern in your search code rather than the marker you want to find!). Let us know how you get on. HTH. --KW 8-) -- Keith Wansbrough http://www.cl.cam.ac.uk/users/kw217/ University of Cambridge Computer Laboratory. From alethenorio@home.se Tue Apr 29 17:58:55 2003 From: alethenorio@home.se (Alexandre Weffort Thenorio) Date: Tue, 29 Apr 2003 18:58:55 +0200 Subject: Is it possible to build in a file in a haskell program?? References: Message-ID: <003d01c30e70$9f14c390$0800a8c0@thenorio> Thanks but I am not sure what exactly you mean. I've done this: Created a file called MyBinFile.hs and added such code: module MyBinFile ( mybinfile ) where mybinfile :: String mybinfile = "Hello, world\x0A" Created file Main.hs and added such code module Main where import MyBinFile ( mybinfile ) import IO main = do h <- readFile file.bin hPutStr h mybinfile hClose h Tried compiling main.hs file but it says "Failed to load interface for MyBinFile". Sorry but I am not what you can call a experienced programmer but if I understood right I can read the bin file with haskell getting some kind of binary string. The I can just add this binary string into my program and tell it to write a file (In binary mode Using IoExts module) using this String. Otherwise could you be a bit more specific?? Best Regards Alex ----- Original Message ----- From: "Keith Wansbrough" To: "Alexandre Weffort Thenorio" Cc: Sent: Tuesday, April 29, 2003 6:17 PM Subject: Re: Is it possible to build in a file in a haskell program?? > > Hello again guys. I have made a small program that basically all it does is > > read a text file and write another text file with the info from the first > > one. Now let's say I have a bin file and I want the program to still write > > the text file and also create this bin file. Is it possible to build in this > > bin file inside the program so everything is inside the executable file > > (exe) and then when the user runs the program it does it job (write the text > > file) and also creates this bin file exactly like it was on the same > > directory the program is being run. > > Yes, of course. > > What you want to do is first write a Haskell (or Perl) program that reads in a file and translates it into a little Haskell program, like this: > > module MyBinFile ( mybinfile ) where > mybinfile :: String > mybinfile = "Hello, world\x0A\x1A\x00\x01\x02\ > \\x03\x04\x05.....\ > \......\x00\x00" > > (the string continuation syntax is defined in the Haskell report, as are the standard string escapes for characters outside \x20..\x7E) > > Then your main program looks like this: > > module Main where > import MyBinFile ( mybinfile ) > import IO > > main = do h <- ... open the file you want ... > hPutStr h mybinfile > hClose h > > So you run your Haskell/Perl script on the original file to generate the Haskell file MyBinFile.hs, then you compile MyBinFile.hs and Main.hs, and distribute the resulting binary. > > Warning: compilation may be a bit slow with such a large string. > > Alternatively, you could get even trickier, by using the linker to stick your original bin file onto the end of the executable. Then you could just open the executable file itself in Haskell, find the bin file, and read it out. You coudl either interpret the ELF/EXE binary format, or just look for a magic string (careful you don't find the pattern in your search code rather than the marker you want to find!). > > Let us know how you get on. > > HTH. > > --KW 8-) > > -- > Keith Wansbrough > http://www.cl.cam.ac.uk/users/kw217/ > University of Cambridge Computer Laboratory. > > From alethenorio@home.se Tue Apr 29 21:59:58 2003 From: alethenorio@home.se (Alexandre Weffort Thenorio) Date: Tue, 29 Apr 2003 22:59:58 +0200 Subject: Is it possible to build in a file in a haskell program?? References: Message-ID: <001401c30e92$4d92db70$0800a8c0@thenorio> Sorry. As a begginner (Kinda) with haskell I completelly forgot how to work with Modules but anyway I completelly understood what you meant now. My problem actually is writing the program thats write the little haskell program (Or a String) out of the bin file. Can you give me a clue? Of course most of the code is easy but the tricky part comes to the string representing the file, I mean won't haskell just write exactly like the bin file is written (Thus in weird stuff can't just be copied and pasted) Or maybe if I read the file in Binary mode and write it in Text mode (Using IOExts Library)??? Best Regards Alex ----- Original Message ----- From: "Keith Wansbrough" To: "Alexandre Weffort Thenorio" Sent: Tuesday, April 29, 2003 8:11 PM Subject: Re: Is it possible to build in a file in a haskell program?? > > Thanks but I am not sure what exactly you mean. I've done this: > [..] > > Tried compiling main.hs file but it says "Failed to load interface for > > MyBinFile". > > This means you haven't compiled MyBinFile. > > Do you know about Haskell modules? You should read the relevant section of the Haskell Report (www.haskell.org/onlinereport/), and also the documentation of your compiler. > > --KW 8-) > -- > Keith Wansbrough > http://www.cl.cam.ac.uk/users/kw217/ > University of Cambridge Computer Laboratory. > > From alethenorio@home.se Tue Apr 29 22:35:09 2003 From: alethenorio@home.se (Alexandre Weffort Thenorio) Date: Tue, 29 Apr 2003 23:35:09 +0200 Subject: Is it possible to build in a file in a haskell program?? References: Message-ID: <002d01c30e97$386157e0$0800a8c0@thenorio> Yeah just as I expected it. It wrote the whole program OK but when it comes to: mybinfile = It just wrote all the weird stuff that you see if you try opening a bin file in notepad. The weird part is that it didn't write the whole thing, just part of it. Is it supposed to be like that?? I did use readfile function to read the bin file, but just in case how to make a handle into a string, for example: basic = "module MyBinFile ( mybinfile ) where\nmybinfile :: String\nmybinfile = \"" do handle <- openFile "mybinfile.hs" WriteMode --File to be written to hand <- readfile "file.bin" hPutStrLn handle (basic ++ hand ++ "\"") That's what I did basically and I only used readFile to read the bin file because hPutStrLn requires a String and openFile gives me a Handle so is it possible to make a handle to a String?? Also what am I doing wrogn because apparently I am not getting stuff like /x01/x02 but weird stuf like: DÅÍo in the created file. Best Regards Alex ----- Original Message ----- From: "Keith Wansbrough" To: "Alexandre Weffort Thenorio" Sent: Tuesday, April 29, 2003 8:11 PM Subject: Re: Is it possible to build in a file in a haskell program?? > > Thanks but I am not sure what exactly you mean. I've done this: > [..] > > Tried compiling main.hs file but it says "Failed to load interface for > > MyBinFile". > > This means you haven't compiled MyBinFile. > > Do you know about Haskell modules? You should read the relevant section of the Haskell Report (www.haskell.org/onlinereport/), and also the documentation of your compiler. > > --KW 8-) > -- > Keith Wansbrough > http://www.cl.cam.ac.uk/users/kw217/ > University of Cambridge Computer Laboratory. > > From alethenorio@home.se Tue Apr 29 22:58:18 2003 From: alethenorio@home.se (Alexandre Weffort Thenorio) Date: Tue, 29 Apr 2003 23:58:18 +0200 Subject: Is it possible to build in a file in a haskell program?? References: Message-ID: <003f01c30e9a$75397c80$0800a8c0@thenorio> OK. Here is what happen. I wrote the small haskell program that write another haskell program containing a string representation of the bin file. If use openFile function the string representation is not complete (Doesn't write the whole bin file, bug maybe) but if I use openFileEx (IOExts Library, Lang Package) it writes the whole thing BUT both ways it still gives me a file with a binary string representation (Weird sings) like: module MyBinFile ( mybinfile ) where mybinfile :: String mybinfile = "Ì þs$>Ì Ì  þVÌ 01o ¦·?sfÌ{%z-æÇdæÇe_ Æe\\\\ÃàQ'%Ñàz&òÆdÑày&çÖà{ÇdÖà|Çez-ÆdçÆeç? 00 0...." thus of course giving me a error in character literal in third line when trying to run the old main (That is gonna rewrite the bin file). Any ideas?? Best Regards Alex From glynn.clements@virgin.net Wed Apr 30 05:16:50 2003 From: glynn.clements@virgin.net (Glynn Clements) Date: Wed, 30 Apr 2003 05:16:50 +0100 Subject: Is it possible to build in a file in a haskell program?? In-Reply-To: <003f01c30e9a$75397c80$0800a8c0@thenorio> References: <003f01c30e9a$75397c80$0800a8c0@thenorio> Message-ID: <16047.20018.342986.569557@cerise.nosuchdomain.co.uk> Alexandre Weffort Thenorio wrote: > OK. Here is what happen. I wrote the small haskell program that write= > another haskell program containing a string representation of the bin= file. >=20 > If use openFile function the string representation is not complete (D= oesn't > write the whole bin file, bug maybe) but if I use openFileEx (IOExts > Library, Lang Package) it writes the whole thing >=20 > BUT both ways it still gives me a file with a binary string represent= ation > (Weird sings) like: >=20 > module MyBinFile ( mybinfile ) where > mybinfile :: String > mybinfile =3D "=06=01=1B=CC =FEs=06=01$>=CC =06=01=03=CC =06 =FE=06= =01V=CC =0C=130=191o=10 =A6=08=B7=01?=03sf=CC{%z-=E6=04=C7=01d=E6=05=C7= =01e_ > =07=C6=01e\\\\=C3=E0Q'%=D1=E0z&=F2=C6=01d=D1=E0y&=E7=D6=E0{=C7=01d=D6= =E0|=C7=01ez-=C6=01d=E7=04=C6=01e=E7=05?=01 0=030 > =050...." >=20 > thus of course giving me a error in character literal in third line w= hen > trying to run the old main (That is gonna rewrite the bin file). Any = ideas?? Use "show", e.g. =09hPutStrLn outFile $ "mybinfile =3D " ++ show theString --=20 Glynn Clements From haskellmail@yahoo.com.sg Wed Apr 30 08:29:04 2003 From: haskellmail@yahoo.com.sg (Kenny Lu Zhuo Ming) Date: Wed, 30 Apr 2003 15:29:04 +0800 Subject: unsafe parsing Message-ID: <001601c30eea$3f203f80$22528489@comp.nus.edu.sg> This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C30F2D.3BEC6940 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I am currently write a program to type a dynamic string consist of 'A' = or 'B' for short, it works in this manner:=20 for 'A', it returns A :: A for 'B', it returns B :: B for "A", it returns Cons A Nil :: Cons A Nil for "AB", it returns Cons A (Cons B Nil) :: Cons A (Cons B Nil) ... The problem is I have to specifically annotate the output type, which is = unaffordable, because I might have arbitrary-long string, and I have infinitely many possible singleton types. It seems it is impossible to do it in a type-safe way. Anyone of you = have any idea to walk around that? Regards, Kenny module Test where data Content =3D C1 Char | C2 String deriving Eq class MyType a where parse :: Content -> (Maybe a) data A =3D A deriving (Show,Eq) instance MyType A where parse (C1 'A') =3D Just A parse _ =3D Nothing data B =3D B deriving (Show,Eq) instance MyType B where parse (C1 'B') =3D Just B parse _ =3D Nothing data Cons x xs =3D Cons x xs deriving Show instance (MyType x,MyType xs) =3D> MyType (Cons x xs) where parse (C2 (x:xs)) =3D let maybehd =3D parse (C1 x) in case maybehd of=20 Just hd -> let maybetl =3D parse (C2 xs) in case maybetl of=20 Just tl -> Just ((Cons hd) tl) Nothing -> Nothing Nothing -> Nothing parse _ =3D Nothing data Nil =3D Nil deriving (Show,Eq) instance MyType Nil where=20 parse (C2 []) =3D Just Nil parse _ =3D Nothing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Hugs session for: /usr/share/hugs/lib/Prelude.hs Test.hs Type :? for help Test> parse (C2 "A") :: Maybe (Cons A Nil) Just (Cons A Nil) ------=_NextPart_000_000F_01C30F2D.3BEC6940 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi all,
 
I am currently write a program to type = a dynamic=20 string consist of 'A' or 'B'
 
for short, it works in this = manner:=20
for 'A', it returns A :: A
for 'B', it returns B :: B
for "A", it returns Cons A Nil :: Cons = A=20 Nil
for "AB", it returns Cons A (Cons B = Nil) :: Cons A=20 (Cons B Nil)
...
 
The problem is I have to specifically = annotate the=20 output type, which is unaffordable, because I might have arbitrary-long=20 string,
and I have infinitely many = possible singleton=20 types.
It seems it is impossible to do it in a = type-safe=20 way. Anyone of you have any idea to walk around that?
 
 
 
Regards,
Kenny
 
 
 
module Test where
 
data Content =3D C1=20 Char
      | C2 String deriving = Eq
 
 
 
class MyType a = where
    parse ::=20 Content -> (Maybe a)
 
data A =3D A deriving = (Show,Eq)
 
instance MyType A = where
    parse=20 (C1 'A') =3D Just A
    parse _ =3D = Nothing
 
data B =3D B deriving = (Show,Eq)
 
instance MyType B = where
    parse=20 (C1 'B') =3D Just B
    parse _ =3D = Nothing
 

data Cons x xs =3D Cons x xs deriving Show
 
instance (MyType x,MyType xs) =3D> MyType (Cons x xs)=20 where
    parse (C2 (x:xs)) =3D  let maybehd =3D = parse (C1 x)=20 in
        case maybehd of=20
        Just hd=20 ->
     let maybetl =3D parse (C2 xs)=20 in
         case maybetl of=20
         Just tl=20 ->
      Just ((Cons hd)=20 tl)
         Nothing ->=20 Nothing
        Nothing ->=20 Nothing
    parse _ =3D Nothing
 

data Nil =3D Nil deriving (Show,Eq)
 
instance MyType Nil where
    parse (C2 = [])  =3D Just=20 Nil
    parse _ =3D Nothing
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Hugs session = for:
/usr/share/hugs/lib/Prelude.hs
Test.hs
Type :?=20 for help
Test> parse (C2 "A") :: Maybe (Cons A Nil)
Just (Cons = A=20 Nil)
 
 
 
------=_NextPart_000_000F_01C30F2D.3BEC6940-- From alethenorio@home.se Wed Apr 30 14:29:05 2003 From: alethenorio@home.se (Alexandre Weffort Thenorio) Date: Wed, 30 Apr 2003 15:29:05 +0200 Subject: Is it possible to build in a file in a haskell program?? References: <003f01c30e9a$75397c80$0800a8c0@thenorio> <16047.20018.342986.569557@cerise.nosuchdomain.co.uk> Message-ID: <006001c30f1c$795e25e0$0800a8c0@thenorio> Thanks a lot guys. "Show" seems to have solved the problem. The only weird thing is that created file is not exactly the same size (100 bytes bigger) but hopefully that should not be a problem. Just would like to point that openFile function from IO library did not write the right string representation (Just small part of it) while openFileEx in IOExts library did write the whole thing. Maybe it is a bug? As a last question I am curious about a thing you guys typed a lot latelly, What does the $ sign (Dollar) does?? Thanks again Alex ----- Original Message ----- From: "Glynn Clements" To: "Alexandre Weffort Thenorio" Cc: "Keith Wansbrough" ; Sent: Wednesday, April 30, 2003 6:16 AM Subject: Re: Is it possible to build in a file in a haskell program?? Alexandre Weffort Thenorio wrote: > OK. Here is what happen. I wrote the small haskell program that write > another haskell program containing a string representation of the bin file. > > If use openFile function the string representation is not complete (Doesn't > write the whole bin file, bug maybe) but if I use openFileEx (IOExts > Library, Lang Package) it writes the whole thing > > BUT both ways it still gives me a file with a binary string representation > (Weird sings) like: > > module MyBinFile ( mybinfile ) where > mybinfile :: String > mybinfile = "Ì þs$>Ì Ì  þVÌ 01o ¦·?sfÌ{%z-æÇdæÇe_ > Æe\\\\ÃàQ'%Ñàz&òÆdÑày&çÖà{ÇdÖà|Çez-ÆdçÆeç? 00 > 0...." > > thus of course giving me a error in character literal in third line when > trying to run the old main (That is gonna rewrite the bin file). Any ideas?? Use "show", e.g. hPutStrLn outFile $ "mybinfile = " ++ show theString -- Glynn Clements From ddarius@hotpop.com Wed Apr 30 14:41:18 2003 From: ddarius@hotpop.com (Derek Elkins) Date: Wed, 30 Apr 2003 09:41:18 -0400 Subject: Is it possible to build in a file in a haskell program?? In-Reply-To: <006001c30f1c$795e25e0$0800a8c0@thenorio> References: <003f01c30e9a$75397c80$0800a8c0@thenorio> <16047.20018.342986.569557@cerise.nosuchdomain.co.uk> <006001c30f1c$795e25e0$0800a8c0@thenorio> Message-ID: <20030430094118.0000397d.ddarius@hotpop.com> On Wed, 30 Apr 2003 15:29:05 +0200 "Alexandre Weffort Thenorio" wrote: > Thanks a lot guys. "Show" seems to have solved the problem. The only > weird thing is that created file is not exactly the same size (100 > bytes bigger) but hopefully that should not be a problem. Just would > like to point that openFile function from IO library did not write the > right string representation (Just small part of it) while openFileEx > in IOExts library did write the whole thing. Maybe it is a bug? As a > last question I am curious about a thing you guys typed a lot latelly, > What does the $ sign(Dollar) does?? > > Thanks again > > Alex If the file is opened in text mode it will stop at the first EOF character in the output. I imagine that that was the problem with openFile. $ is just a low precedence right associative function application. It's mainly used to avoid parentheses. It's definition is f $ x = f x. You can change something like f (g (h x)) into f $ g $ x. From ddarius@hotpop.com Wed Apr 30 14:47:06 2003 From: ddarius@hotpop.com (Derek Elkins) Date: Wed, 30 Apr 2003 09:47:06 -0400 Subject: unsafe parsing In-Reply-To: <001601c30eea$3f203f80$22528489@comp.nus.edu.sg> References: <001601c30eea$3f203f80$22528489@comp.nus.edu.sg> Message-ID: <20030430094706.00003c9a.ddarius@hotpop.com> On Wed, 30 Apr 2003 15:29:04 +0800 "Kenny Lu Zhuo Ming" wrote: > Hi all, > > I am currently write a program to type a dynamic string consist of 'A' > or 'B' > > for short, it works in this manner: > for 'A', it returns A :: A > for 'B', it returns B :: B > for "A", it returns Cons A Nil :: Cons A Nil > for "AB", it returns Cons A (Cons B Nil) :: Cons A (Cons B Nil) > ... > > The problem is I have to specifically annotate the output type, which > is unaffordable, because I might have arbitrary-long string, and I > have infinitely many possible singleton types. It seems it is > impossible to do it in a type-safe way. Anyone of you have any idea to > walk around that? > > > > Regards, > Kenny Is there any reason [Either A B] couldn't be used? Otherwise, you may want to look at the thread "polymorphic stanamically typed balanced trees" on this list (or haskell-cafe), and/or SimulatingDependentTypes on the Haskell Wiki (it's linked from haskell.org). SimulatingDependentTypes also has a link to the aforementioned thread. From alethenorio@home.se Wed Apr 30 14:56:04 2003 From: alethenorio@home.se (Alexandre Weffort Thenorio) Date: Wed, 30 Apr 2003 15:56:04 +0200 Subject: Is it possible to build in a file in a haskell program?? References: <003f01c30e9a$75397c80$0800a8c0@thenorio> <16047.20018.342986.569557@cerise.nosuchdomain.co.uk> <006001c30f1c$795e25e0$0800a8c0@thenorio> <20030430094118.0000397d.ddarius@hotpop.com> Message-ID: <008201c30f20$3e3a8ae0$0800a8c0@thenorio> Yes you are right (I tested with openFile in TextMode) but as far as I can see openFile cannot be changed to any other mode than TextMode thus openFile does not work with binary files (.bin) whereas openFileEx can be set to BinaryMode instead of TextMode which gives me the right output. Thanks for pointing it out. Why isn't IO and IOExts put together in one library. For example functions like openFile can be rewritten to work the same way as openFileEx thus eliminating one function and making it easier for the user not to have to compile the program with lang package. Best Regards NooK ----- Original Message ----- From: "Derek Elkins" To: Sent: Wednesday, April 30, 2003 3:41 PM Subject: Re: Is it possible to build in a file in a haskell program?? > On Wed, 30 Apr 2003 15:29:05 +0200 > "Alexandre Weffort Thenorio" wrote: > > > Thanks a lot guys. "Show" seems to have solved the problem. The only > > weird thing is that created file is not exactly the same size (100 > > bytes bigger) but hopefully that should not be a problem. Just would > > like to point that openFile function from IO library did not write the > > right string representation (Just small part of it) while openFileEx > > in IOExts library did write the whole thing. Maybe it is a bug? As a > > last question I am curious about a thing you guys typed a lot latelly, > > What does the $ sign(Dollar) does?? > > > > Thanks again > > > > Alex > > If the file is opened in text mode it will stop at the first EOF > character in the output. I imagine that that was the problem with > openFile. > > $ is just a low precedence right associative function application. It's > mainly used to avoid parentheses. It's definition is f $ x = f x. You > can change something like f (g (h x)) into f $ g $ x. > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From ddarius@hotpop.com Wed Apr 30 15:27:32 2003 From: ddarius@hotpop.com (Derek Elkins) Date: Wed, 30 Apr 2003 10:27:32 -0400 Subject: Is it possible to build in a file in a haskell program?? In-Reply-To: <008201c30f20$3e3a8ae0$0800a8c0@thenorio> References: <003f01c30e9a$75397c80$0800a8c0@thenorio> <16047.20018.342986.569557@cerise.nosuchdomain.co.uk> <006001c30f1c$795e25e0$0800a8c0@thenorio> <20030430094118.0000397d.ddarius@hotpop.com> <008201c30f20$3e3a8ae0$0800a8c0@thenorio> Message-ID: <20030430102732.000020c6.ddarius@hotpop.com> On Wed, 30 Apr 2003 15:56:04 +0200 "Alexandre Weffort Thenorio" wrote: > Yes you are right (I tested with openFile in TextMode) but as far as I > can see openFile cannot be changed to any other mode than TextMode > thus openFile does not work with binary files (.bin) whereas > openFileEx can be set to BinaryMode instead of TextMode which gives me > the right output. Thanks for pointing it out. Why isn't IO and IOExts > put together in one library. For example functions like openFile can > be rewritten to work the same way as openFileEx thus eliminating one > function and making it easier for the user not to have to compile the > program with lang package. > > Best Regards > > NooK IO is Standard Haskell 98, IOExts are extensions (i.e.non-standard). From gk@ninebynine.org Wed Apr 30 19:20:06 2003 From: gk@ninebynine.org (Graham Klyne) Date: Wed, 30 Apr 2003 19:20:06 +0100 Subject: Multiparameter classes in HUGS and GHC Message-ID: <5.1.0.14.2.20030430182613.00ba1dc8@127.0.0.1> I've trying to understand better how to use multiparameter classes, and in particular the things that can be declared as instances. I've consulted the following: [1] http://www.haskell.org/onlinereport/decls.html#sect4.3.2 [2] http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#MULTI-PARAM-TYPE-CLASSES (particularly 7.3.5.1 item 3) [3] http://research.microsoft.com/Users/simonpj/Papers/type-class-design-space/ [4] http://cvs.haskell.org/Hugs/pages/hugsman/exts.html (section 7.1) From my reading, it seems that while strict Haskell 98 does not permit type expressions or synonyms to be declared as class instances, both GHC and HUGS claim to relax this restriction (presumably following the analysis in [3]). My problem is that I can't get HUGS to accept a type expression or synonym to be declared as an instance of a (multiparameter) class; I'm getting the error "Illegal type in class constraint". After some wrestling with the system, I have managed to figure how to declare instances that use type constructors. I feel I may be missing something blindingly obvious. My spike code is below: the uncommented sections compile OK, but the commented-out sections do not. #g -- [[ class (Eq k, Show k) => Pair a k v where newPair :: (k,v) -> a k v getPair :: a k v -> (k,v) newtype MyPair1 k v = P1 (Int,String) instance Pair MyPair1 Int String where newPair (x,y) = P1 (x,y) getPair (P1 (x,y)) = (x,y) data MyPair2 k v = P2 Int String instance Pair MyPair2 Int String where newPair (x,y) = P2 x y getPair (P2 x y) = (x,y) data (Eq a, Show a) => MyPair3 a b = P3 a b instance Pair MyPair3 Int String where newPair (x,y) = P3 x y getPair (P3 x y) = (x,y) {- -- The following DO NOT work because instances -- "must take the form of a type constructor T applied -- to simple type variables" (though this may be relaxed -- in the multiparameter case: see [1]). -- -- Apparently, GHC *does* allow this, though HUGS -- apparently does not, though it does claim to [2]. -- -- [1] http://research.microsoft.com/Users/simonpj/Papers/type-class-design-space/ -- -- [2] http://cvs.haskell.org/Hugs/pages/hugsman/exts.html (section 7.1) -} type MyPair4 k v = (k,v) {- instance Pair (Int,String) Int String where newPair = id getPair = id instance Pair (MyPair4 Int String) Int String where newPair = id getPair = id instance Pair (MyPair4 k v) Int String where newPair = id getPair = id -} ]] I'm using the November 2002 release of HUGS with Hugs extensions enabled: [[ Current settings: +fewuiRWX -stgGl.qQkoOIHTN -h250000 -p"%s> " -r$$ -c40 Search path : -P{Hugs}\lib:{Hugs}\lib\exts:{Hugs}\lib\win32:{Hugs}\lib\hugs; {Hugs}\libraries\HUnit-1.0 Project Path : Source suffixes : -S.hs;.lhs Editor setting : -E"C:\\Program Files\\TextPad 4\\TextPad.exe" Preprocessor : -F Compatibility : Hugs Extensions (-98) ]] ------------------- Graham Klyne PGP: 0FAA 69FF C083 000B A2E9 A131 01B9 1C7A DBCA CB5E From heringto@cs.unc.edu Wed Apr 30 19:45:52 2003 From: heringto@cs.unc.edu (Dean Herington) Date: Wed, 30 Apr 2003 14:45:52 -0400 Subject: Multiparameter classes in HUGS and GHC References: <5.1.0.14.2.20030430182613.00ba1dc8@127.0.0.1> Message-ID: <3EB019E0.CBE76E3D@cs.unc.edu> Graham Klyne wrote: > class (Eq k, Show k) => Pair a k v where > newPair :: (k,v) -> a k v > getPair :: a k v -> (k,v) > > type MyPair4 k v = (k,v) > > instance Pair (Int,String) Int String where > newPair = id > getPair = id The kinds are wrong here. `Pair` takes as its first argument a type constructor of kind: * -> * -> *. The following works (with appropriate extensions enabled): instance Pair (,) Int String where newPair = id getPair = id > instance Pair (MyPair4 Int String) Int String where > newPair = id > getPair = id Again the kinds are wrong. However, you can't make a Pair instance out of MyPair4 because the latter is a `type` rather than `newtype` or `data`. Hope this helps. Dean From oleg@pobox.com Wed Apr 30 21:18:51 2003 From: oleg@pobox.com (oleg@pobox.com) Date: Wed, 30 Apr 2003 13:18:51 -0700 (PDT) Subject: Deeply uncurried products, as categorists might like them Message-ID: <200304302018.h3UKIpoB086928@adric.fnmoc.navy.mil> This is a belated answer to a Haskell-categorical question posted two years ago on comp.lang.functional [1]: ] It is common in (say) category theory to write ] ] max3 = max . (max * id) Can we write this in Haskell? Specifically, can we write something more complex: max7 = max3 . ((max2 * max3) * max2) We show that we can, exactly in this notation (modulo alpha conversion). A potentially useful side-effect is a deep uncurrying of arbitrarily complex pairs, such as ((1,2),(3,(4,5))) The simplest max3 can be expressed in the desired form: *> prod x y = \(argx,argy) -> ((x argx),(y argy)) *> max2 x y = if x < y then y else x *> *> max3:: Ord a => a->a->a->a *> max3 = (curry (curry ((uncurry max2) . ((uncurry max2) `prod` id)))) Alas, the solution uses too much curry to be palatable. Generalizations to longer functions are mind-racking. Thus the problem is how to get the compiler (GHC) put and take the right amount of curry automatically. It seems that a polyvariadic composition combinator [2] can help. The combinator is specified as follows: given f:: a1->a2->.... ->cp, where cp is not functional and g:: cp->d then f `mcomp` g:: a1->a2->.... ->d of obvious meaning. In the simplest case of f::a->b (b not functional), "f `mcomp` g = g . f" . For a reason I can't recall `mcomp` has the reverse order of arguments compared to the regular composition. Given such a combinator, defined in the appendix, we can introduce a categorical product as *> prod f g = f `mcomp` (\fresult -> g `mcomp` (\gresult -> (fresult,gresult))) or, after some eta-reductions, *> prod f g = mcomp f ((mcomp g) . (,)) Given two functions, f:: a1->a2->...->an->c |c,d non-exponential types g:: b1->b2->...->bn->d their product f `prod` g:: a1->a2->...->an->b1->b2->...->bn->(c,d) The number of as and bs is arbitrary. We can subject the expression for prod to even more eta-reductions, yielding the following compact, combinational definition: > prod:: (MCompose a b (c -> d) e, MCompose f g (b,g) d) => > (h -> a) -> (c -> f) -> h -> e > prod = (. ((. (,)) . mcomp)) . mcomp The constraints in the prod's type are intricately related. The final expression for prod bears some similarity with Unlambda code. Perhaps because both Unlambda and the category theory eschew "elements" in favor of combinations of arrows. Probably there are other similarities. Now we are ready to define our maxima. To make our approach truly polymorphic, we have to restrict it first by the following declaration. It's not much a restriction because the type under the wrapper can be anything at all. Unfortunately, the intuitionist logic of class instances makes it impossible to say directly "forall x. (NOT Constraint x)". Thus we have to resort to the contortions: > newtype W a = W a deriving Show We also need a projected identity and the basic max: > tid:: (Ord a) => (W a)->(W a) > tid = id > max2 (W x) (W y) = if x < y then W y else W x We also need to "invert" the prod operation -- to deeply uncurry arbitrarily complex pairs. > -- An uncurrying application: flattening the product > class FApp f a c | a c -> f where > fapp:: f -> a -> c > > instance FApp (Char->c) Char c where > fapp = ($) > > instance FApp ((W a)-> c) (W a) c where > fapp = ($) > > instance (FApp fx a r, FApp r b c) => FApp fx (a,b) c where > fapp f = uncurry (fapp . (fapp f)) > -- test > fappt = fapp (\a b c d e -> [a,b,c,d,e]) (('a','b'),('c',('d','e'))) Combinators fapp and mcomp will occur together. Therefore, we define > fcomp a = (. fapp) (mcomp a) That expression can be further reduced to "fcomp = (. fapp) . mcomp" However, doing so blows the Unlambda fuse in GHC. Now we can indeed write our maxima: > max3:: Ord a => W a->W a->W a->W a > max3 = (max2 `prod` tid) `fcomp` max2 which looks almost the same as the categorical expression for max3. We can easily generalize: > max4:: Ord a => W a->W a->W a->W a -> W a > max4 = (max2 `prod` max2) `fcomp` max2 which would, in the categorical notation, be written as max2 . (max2 * max2) Our notation is almost a literal translation. There are other expressions for max4, for the other commuting branches: > -- max41 = max2 . (max3 * id) > max41:: Ord a => W a->W a->W a->W a -> W a > max41 = (max3 `prod` tid) `fcomp` max2 > -- max42 = max2 . (id * max3) > max42:: Ord a => W a->W a->W a->W a -> W a > max42 = (tid `prod` max3) `fcomp` max2 > -- max51 = max2 . ((max2 * id) . (max2 * max2)) > max51:: Ord a => W a->W a->W a->W a -> W a -> W a > max51 = ((max2 `prod` max2) `fcomp` (max2 `prod` tid)) `fcomp` max2 And finally, > max7:: Ord a => W a->W a->W a->W a->W a->W a->W a->W a > max7 = ((max2 `prod` max3) `prod` max2) `fcomp` max3 > > max7t = max7 (W 'a') (W 'b') (W 'c') (W 'd') (W 'e') (W 'f') (W 'g') Perhaps the wrapper W also has some categorical significance. [1] "Re: On products and max3" A thread on a newsgroup comp.lang.functional, Thu, 12 Apr 2001 02:14:27 +0000 [2] http://pobox.com/~oleg/ftp/Haskell/polyvar-comp.lhs The code was originally posted as "Re: composition" on a newsgroup comp.lang.functional on Wed, 30 Oct 2002 19:09:32 -0800 Appendix: polyvariadic composition, to make this whole code work. Excerpted from [2]. Compilation flags: -fglasgow-exts > class MCompose f2 cp gresult result | f2 cp gresult -> result, f2->cp > where > mcomp:: (f1->f2) -> (cp->gresult) -> (f1 -> result) > > -- Class instances. Please keep in mind that cp must be a non-functional type > -- and f2 and cp must be the same. These instances enumerate the base cases. > > instance MCompose (Maybe b) (Maybe b) c c where > --mcomp f::(a->(Maybe b)) g::((Maybe b)->c) :: a->c > mcomp f g = g . f > > instance MCompose [b] [b] c c where > --mcomp f::(a->[b]) g::([b]->c) :: a->c > mcomp f g = g . f > > instance MCompose Int Int c c where > --mcomp f::(a->Int) g::(Int->c) :: a->c > mcomp f g = g . f > > instance MCompose Char Char c c where > --mcomp f::(a->Char) g::(Char->c) :: a->c > mcomp f g = g . f > > instance MCompose (W a) (W a) c c where > --mcomp f::(x->(W a)) g::((W a)->c) :: x->c > mcomp f g = g . f > > instance MCompose (a,b) (a,b) c c where > mcomp f g = g . f > > -- Induction case > instance (MCompose f2 cp gresult result) => > MCompose (f1->f2) cp gresult (f1->result) where > mcomp f g = \a -> mcomp (f a) g > From oleg@pobox.com Wed Apr 30 23:48:11 2003 From: oleg@pobox.com (oleg@pobox.com) Date: Wed, 30 Apr 2003 15:48:11 -0700 (PDT) Subject: GHC doesn't like its own type? Message-ID: <200304302248.h3UMmBaA087146@adric.fnmoc.navy.mil> The previously message "Deeply uncurried products, as categorists might like them" can be used to demonstrate certain behavior of GHC that seems a bit odd. If we save the text of that message in a file, /tmp/a.lhs, we can load it into GHC: $ ghci -fglasgow-exts /tmp/a.lhs GHC Interactive, version 5.04.1 Ok, modules loaded: Main. *Main> The whole code loads and typechecks. The code contains the following definition, without an explicit type signature: > fcomp a = (. fapp) (mcomp a) We can ask GHCi to tell us the type of fcomp: *Main> :type fcomp forall result f1 a f2 c cp. (FApp a cp c, MCompose f2 cp c result) => (f1 -> f2) -> a -> f1 -> result and make that type, verbatim, to be the signature of fcomp: > fcomp:: forall result f1 a f2 c cp. (FApp a cp c, MCompose f2 cp c result) => (f1 -> f2) -> a -> f1 -> result > fcomp a = (. fapp) (mcomp a) If we reload the file, we get an error: /tmp/a.lhs:124: Could not deduce (FApp a cp c1) from the context (FApp a cp c, MCompose f2 cp c result) Probable fix: Add (FApp a cp c1) to the type signature(s) for `fcomp' arising from use of `fapp' at /tmp/a.lhs:124 In the second argument of `(.)', namely `fapp' In the definition of `fcomp': (. fapp) (mcomp a) /tmp/a.lhs:124: Could not deduce (MCompose f2 cp c1 result) from the context (FApp a cp c, MCompose f2 cp c result) Probable fix: Add (MCompose f2 cp c1 result) to the type signature(s) for `fcomp' arising from use of `mcomp' at /tmp/a.lhs:124 In the first argument of `(. fapp)', namely `(mcomp a)' In the definition of `fcomp': (. fapp) (mcomp a) I used to think that the inferred type is the most general type, and that the compiler would accept as explicit the type that it itself inferred. I was wrong? The second odd circumstance is best illustrated by the following transcript. Assume that /tmp/a.lhs is the text of the previous message as it was posted: $ ghci -fglasgow-exts /tmp/a.lhs GHC Interactive, version 5.04.1, for Haskell 98. Loading package base ... linking ... done. Loading package haskell98 ... linking ... done. Compiling Main ( /tmp/a.lhs, interpreted ) /tmp/a.lhs:76: Warning: No 'main' defined in module Main Ok, modules loaded: Main. *Main> let x = \f -> fapp f (('a','b'),('c',('d','e'))) Bus error (core dumped) Incidentally, if I enter > x = \f -> fapp f (('a','b'),('c',('d','e'))) into /tmp/a.lhs and load the file into GHCi, I get ghc-5.04.1: panic! (the `impossible' happened, GHC version 5.04.1): rdrNameModule zddFApp From levent.erkok@intel.com Wed Apr 30 23:57:51 2003 From: levent.erkok@intel.com (Erkok, Levent) Date: Wed, 30 Apr 2003 15:57:51 -0700 Subject: GHC doesn't like its own type? Message-ID: <88FA49DAE6B6D611AD740002A5072D3C0496BF92@orsmsx111.jf.intel.com> Sometimes ghc/hugs will reject a program when you provide a type signature that it can deduce itself. This has been observed before: See Simon PJ's message: http://www.mail-archive.com/haskell@haskell.org/msg06764.html Of course, the "bus error" and the "panic" are truly GHC bugs, you might be better off reporting them at: http://sourceforge.net/tracker/?group_id=8032&atid=108032 -Levent. > -----Original Message----- > From: oleg@pobox.com [mailto:oleg@pobox.com] > Sent: Wednesday, April 30, 2003 3:48 PM > To: haskell@haskell.org > Subject: GHC doesn't like its own type? > > > The previously message "Deeply uncurried products, as categorists > might like them" can be used to demonstrate certain behavior of GHC > that seems a bit odd. If we save the text of that message in a file, > /tmp/a.lhs, we can load it into GHC: > > $ ghci -fglasgow-exts /tmp/a.lhs > GHC Interactive, version 5.04.1 > Ok, modules loaded: Main. > *Main> > > The whole code loads and typechecks. The code contains the following > definition, without an explicit type signature: > > > fcomp a = (. fapp) (mcomp a) > > We can ask GHCi to tell us the type of fcomp: > > *Main> :type fcomp > forall result f1 a f2 c cp. > (FApp a cp c, MCompose f2 cp c result) => > (f1 -> f2) -> a -> f1 -> result > > and make that type, verbatim, to be the signature of fcomp: > > > fcomp:: forall result f1 a f2 c cp. (FApp a cp c, MCompose f2 cp c > result) => (f1 -> f2) -> a -> f1 -> result > > fcomp a = (. fapp) (mcomp a) > > If we reload the file, we get an error: > > /tmp/a.lhs:124: > Could not deduce (FApp a cp c1) > from the context (FApp a cp c, MCompose f2 cp c result) > Probable fix: > Add (FApp a cp c1) to the type signature(s) for `fcomp' > arising from use of `fapp' at /tmp/a.lhs:124 > In the second argument of `(.)', namely `fapp' > In the definition of `fcomp': (. fapp) (mcomp a) > > /tmp/a.lhs:124: > Could not deduce (MCompose f2 cp c1 result) > from the context (FApp a cp c, MCompose f2 cp c result) > Probable fix: > Add (MCompose f2 cp c1 result) to the type signature(s) for > `fcomp' > arising from use of `mcomp' at /tmp/a.lhs:124 > In the first argument of `(. fapp)', namely `(mcomp a)' > In the definition of `fcomp': (. fapp) (mcomp a) > > I used to think that the inferred type is the most general type, and > that the compiler would accept as explicit the type that it itself > inferred. I was wrong? > > The second odd circumstance is best illustrated by the following > transcript. Assume that /tmp/a.lhs is the text of the previous message > as it was posted: > > $ ghci -fglasgow-exts /tmp/a.lhs > GHC Interactive, version 5.04.1, for Haskell 98. > Loading package base ... linking ... done. > Loading package haskell98 ... linking ... done. > Compiling Main ( /tmp/a.lhs, interpreted ) > > /tmp/a.lhs:76: Warning: No 'main' defined in module Main > Ok, modules loaded: Main. > *Main> let x = \f -> fapp f (('a','b'),('c',('d','e'))) > Bus error (core dumped) > > Incidentally, if I enter > > x = \f -> fapp f (('a','b'),('c',('d','e'))) > into /tmp/a.lhs and load the file into GHCi, I get > > ghc-5.04.1: panic! (the `impossible' happened, GHC version 5.04.1): > rdrNameModule zddFApp > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell From gk@ninebynine.org Wed Apr 30 21:26:06 2003 From: gk@ninebynine.org (Graham Klyne) Date: Wed, 30 Apr 2003 21:26:06 +0100 Subject: Multiparameter classes in HUGS and GHC In-Reply-To: <3EB019E0.CBE76E3D@cs.unc.edu> References: <5.1.0.14.2.20030430182613.00ba1dc8@127.0.0.1> Message-ID: <5.1.0.14.2.20030430210825.032057a8@127.0.0.1> At 14:45 30/04/2003 -0400, Dean Herington wrote: >Again the kinds are wrong. However, you can't make a Pair instance out of >MyPair4 because the latter is >a `type` rather than `newtype` or `data`. > >Hope this helps. Yes, very much, thank you. If I now have this right, it's the distinction between a parametric polymorphic type and an algebraic type constructor that I had failed to properly appreciate. Now I'm alerted to it, I don't know why I didn't realize sooner that something there was wrong. I discover that I can also use: [[ type MyPair5 = (,) instance Pair MyPair5 Int String where newPair = id getPair = id ]] though I'm not sure how MyPair5 is interpreted as a type synonym ;-) There's a small matter that still puzzles me a little. In: [[ data (Eq a, Show a) => MyPair3 a b = P3 a b instance Pair MyPair3 Int String where newPair (x,y) = P3 x y getPair (P3 x y) = (x,y) ]] (which seems OK), "Pair3" is a type _expression_ of kind (* -> * -> *), the corresponding _constructor_ for which is P3. Yet, according to [1], "(,)" is a type _constructor_. I guess there may be some terminological crossover here as type constructors often use the same name as the corresponding type expression? [1] http://haskell.org/onlinereport/decls.html#sect4.1.2 #g ------------------- Graham Klyne PGP: 0FAA 69FF C083 000B A2E9 A131 01B9 1C7A DBCA CB5E