From g9ks157k at acme.softbase.org Tue Sep 4 12:20:26 2007 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Tue Sep 4 12:10:46 2007 Subject: [Haskell] functional dependencies not satisfactory? Message-ID: <200709041820.26707.g9ks157k@acme.softbase.org> Hello, I came across the following problem: I define a class with a functional dependency like so: class C a b | a -> b Then I want to define a datatype using the fact that the second argument of C is dependent on the first: data C a b => T a = MkT a b But unfortunately, this doesn?t work, at least not in GHC. I can try this: data T a = forall b. C a b => MkT a b But if I do pattern matching on a value of T a, GHC doesn?t recognize that the type of MkT?s second argument is determined by the type of the first. For example, the following function definition is not accepted: useB :: C a b => T a -> (b -> ()) -> () useB (MkT a b) f = f b In my opinion, the problem is that GHC doesn?t see that because of the functional dependency the type exists b. C a b => b is at least as general as the type forall b. C a b => b. Is there a solution to this problem? Best wishes, Wolfgang From greg at eecs.harvard.edu Tue Sep 4 14:02:03 2007 From: greg at eecs.harvard.edu (Greg Morrisett) Date: Tue Sep 4 13:51:36 2007 Subject: [Haskell] ISMM'07: call for participation Message-ID: <46DD9D9B.4000301@eecs.harvard.edu> ISMM'07 CALL FOR PARTICIPATION and Accepted Papers 2007 ACM International Symposium on Memory Management co-located with OOPSLA 2007 Sponsored by ACM SIGPLAN 21-22 October 2007, Montreal http://www.eecs.harvard.edu/~greg/ismm07/ To register for the symposium, see the OOPSLA registration page at http://www.oopsla.org/oopsla2007. Note that the deadline for early registration and reduced rates is Thursday, 13 September. ISMM is a forum for research in management of dynamically allocated memory. Areas of interest include but are not limited to: explicit storage allocation and deallocation; garbage collection algorithms and implementations; compiler analyses to aid memory management; interactions with languages, operating systems, and hardware, especially the memory system; and empirical studies of allocation and referencing behavior in programs that make significant use of dynamic memory. This year's symposium is being held in conjunction with OOPSLA in Montreal on October 21st and 22nd. Invited speakers include Peter O'Hearn (Queen Mary, University of London) and David Kirk (Chief Scientist NVIDIA). In addition to presentation of the papers listed below, there will be an exciting "wild and crazy" ideas session where participants will have a chance to discuss half-baked and interesting ideas. All are welcome! Invited talks and papers to be presented at the symposium: Keynote: Separation Logic and Concurrent Resource Management Peter O'Hearn Safe Manual Memory Management David Gay, Robert Ennals, & Eric Brewer Detecting and Eliminating Memory Leaks Using Cyclic Memory Allocation Huu Hai Nguyen & Martin Rinard Page Access Tracking to Improve Memory Management Reza Azimi, Livio Soares, Michael Stumm, Angela Demke Brown, & Tom Walsh Effective Prefetch for Mark-Sweep Garbage Collection Robin Garner, Stephen Blackburn, & Daniel Frampton Accordion Arrays: Selective Compression of Unicode Arrays in Java Craig Zilles Decrypting the Java Gene Pool: Predicting Object Lifetimes with Micro- Patterns Sebastien Marion, Richard Jones, & Chris Ryder Allocation-Phase Aware Scheduling Policies to Improve Garbage Collection Performance Feng Xian, Witawas Srisa-an, & Hong Jiang Intelligent Selection of Application-Specific Garbage Collectors Jeremy Singer, Gavin Brown, Ian Watson, & John Cavazos Keynote: NVIDIA CUDA Software and GPU Parallel Computing Architecture David Kirk Heap Space Analysis for Java Bytecode Elvira Albert, Samir Genaim, & Miguel Gomez-Zamalloa Uniqueness Inference for Compile-Time Object Deallocation Sigmund Cherem & Radu Rugina A Correct and Useful Incremental Copying Garbage Collector Martin Kero, Johan Nordlander, & Per Lindgren Overlooking Roots: A Framework for Making Nondeferred Reference- Counting Garbage Collection Fast Pramod Joisha Stopless: A Real-Time Garbage Collector for Modern Platforms Filip Pizlo, Daniel Frampton, Erez Petrank, & Bjarne Steensgaard Mark-Sweep or Copying? A "Best of Both Worlds" Algorithm and a Hardware-Supported Real-Time Implementation Sylvain Stanchina & Matthias Meyer From stefanor at cox.net Tue Sep 4 16:00:01 2007 From: stefanor at cox.net (Stefan O'Rear) Date: Tue Sep 4 15:50:31 2007 Subject: [Haskell] functional dependencies not satisfactory? In-Reply-To: <200709041820.26707.g9ks157k@acme.softbase.org> References: <200709041820.26707.g9ks157k@acme.softbase.org> Message-ID: <20070904200001.GA3544@localhost.localdomain> On Tue, Sep 04, 2007 at 06:20:26PM +0200, Wolfgang Jeltsch wrote: > Hello, > > I came across the following problem: > > I define a class with a functional dependency like so: > > class C a b | a -> b > > Then I want to define a datatype using the fact that the second argument of C > is dependent on the first: > > data C a b => T a = MkT a b > > But unfortunately, this doesn?t work, at least not in GHC. > > I can try this: > > data T a = forall b. C a b => MkT a b > > But if I do pattern matching on a value of T a, GHC doesn?t recognize that the > type of MkT?s second argument is determined by the type of the first. For > example, the following function definition is not accepted: > > useB :: C a b => T a -> (b -> ()) -> () > useB (MkT a b) f = f b > > In my opinion, the problem is that GHC doesn?t see that because of the > functional dependency the type exists b. C a b => b is at least as general as > the type forall b. C a b => b. Is there a solution to this problem? And so yet another person discovers why functional dependancies are Bad(tm) - the semantics generated by their typing derivations do not correspond to the na?ve model. In particular, functional dependencies serve *only* to avoid ambiguity; they cannot be used to satisfy equality constraints. Type synonym families, the proposed alternative to functional dependencies, can handle this well: {-# LANGUAGE TypeFamilies #-} class C a where type B a :: * data C a => T a = MkT a (B a) useB :: C a => T a -> (B a -> ()) -> () useB (MkT a b) f = f b It should be emphasized that this program worked the very first time I typed it in. No back-and-forth arguing with the checker! Stefan -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://www.haskell.org/pipermail/haskell/attachments/20070904/a85a7b2e/attachment.bin From g9ks157k at acme.softbase.org Tue Sep 4 17:11:00 2007 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Tue Sep 4 17:01:23 2007 Subject: [Haskell] functional dependencies not satisfactory? In-Reply-To: <20070904200001.GA3544@localhost.localdomain> References: <200709041820.26707.g9ks157k@acme.softbase.org> <20070904200001.GA3544@localhost.localdomain> Message-ID: <200709042311.00290.g9ks157k@acme.softbase.org> Am Dienstag, 4. September 2007 22:00 schrieben Sie: > [?] > It should be emphasized that this program worked the very first time I > typed it in. Which version of GHC are you using? I?m a bit confused since the latest successful nightly build for i386-unknown-linux seems to be from August 20. Are type families already implemented in this version? Was there any change in type family support since then? Best wishes, Wolfgang From stefanor at cox.net Tue Sep 4 17:24:05 2007 From: stefanor at cox.net (Stefan O'Rear) Date: Tue Sep 4 17:14:36 2007 Subject: [Haskell] functional dependencies not satisfactory? In-Reply-To: <200709042311.00290.g9ks157k@acme.softbase.org> References: <200709041820.26707.g9ks157k@acme.softbase.org> <20070904200001.GA3544@localhost.localdomain> <200709042311.00290.g9ks157k@acme.softbase.org> Message-ID: <20070904212405.GA3168@localhost.localdomain> On Tue, Sep 04, 2007 at 11:11:00PM +0200, Wolfgang Jeltsch wrote: > Am Dienstag, 4. September 2007 22:00 schrieben Sie: > > [?] > > > It should be emphasized that this program worked the very first time I > > typed it in. > > Which version of GHC are you using? I?m a bit confused since the latest > successful nightly build for i386-unknown-linux seems to be from August 20. > Are type families already implemented in this version? Was there any change > in type family support since then? Type synonym families were only merged on the 28th IIRC. stefan@stefans:~$ ghci -V The Glorious Glasgow Haskell Compilation System, version 6.7.20070829 Stefan -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://www.haskell.org/pipermail/haskell/attachments/20070904/2b6ea429/attachment.bin From chak at cse.unsw.edu.au Tue Sep 4 22:03:19 2007 From: chak at cse.unsw.edu.au (Manuel M T Chakravarty) Date: Tue Sep 4 21:54:02 2007 Subject: [Haskell] functional dependencies not satisfactory? In-Reply-To: <200709041820.26707.g9ks157k@acme.softbase.org> References: <200709041820.26707.g9ks157k@acme.softbase.org> Message-ID: <46DE0E67.9010804@cse.unsw.edu.au> Wolfgang Jeltsch wrote, > I came across the following problem: > > I define a class with a functional dependency like so: > > class C a b | a -> b > > Then I want to define a datatype using the fact that the second argument of C > is dependent on the first: > > data C a b => T a = MkT a b > > But unfortunately, this doesn?t work, at least not in GHC. > > I can try this: > > data T a = forall b. C a b => MkT a b > > But if I do pattern matching on a value of T a, GHC doesn?t recognize that the > type of MkT?s second argument is determined by the type of the first. For > example, the following function definition is not accepted: > > useB :: C a b => T a -> (b -> ()) -> () > useB (MkT a b) f = f b > > In my opinion, the problem is that GHC doesn?t see that because of the > functional dependency the type exists b. C a b => b is at least as general as > the type forall b. C a b => b. Is there a solution to this problem? You may want to have a look at Section 2.3 of "System F with Type Equality Coercions" , which explains why GHC rejects the program. The mentioned paper also outlines an alternative translation of FDs using System FC that does not suffer from this problem. Unfortunately, it is not quite clear how to extend type checking for FDs in such a way that the required System FC coercion-evidence types are produced by the type checker. This is one of the reasons why I believe that we should use the type families mentioned by Stefan instead of functional dependencies. Type checker support for type synonym families (the flavour needed for your example) has been merged into GHC's development version a week ago. For more details, see http://haskell.org/haskellwiki/GHC/Type_families Manuel From dons at cse.unsw.edu.au Tue Sep 4 23:02:51 2007 From: dons at cse.unsw.edu.au (Donald Bruce Stewart) Date: Tue Sep 4 22:53:27 2007 Subject: [Haskell] ANNOUNCE: xmonad 0.3 Message-ID: <20070905030251.GB16045@cse.unsw.EDU.AU> The xmonad dev team is pleased to announce the 0.3 release of xmonad. xmonad: a tiling window manager http://xmonad.org About: xmonad is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximising screen use. All features of the window manager are accessible from the keyboard: a mouse is strictly optional. xmonad is written and extensible in Haskell. Custom layout algorithms, and other extensions, may be written by the user in config files. Layouts are applied dynamically, and different layouts may be used on each workspace. Xinerama is fully supported, allowing windows to be tiled on several screens. Features: * Very stable, fast, small and simple. * Automatic window tiling and management * First class keyboard support: a mouse is unnecessary * Full support for tiling windows on multi-head displays * Full support for floating windows * XRandR support to rotate, add or remove monitors * Per-workspace layout algorithms * Per-screens custom status bars * Easy, powerful customisation and reconfiguration * Large extension library * Extensive documentation and support for hacking Since xmonad 0.2, the following notable features and bug fixes have appeared: New features: * floating layer support: transients windows are not tiled by default, and windows may be dragged to and from a traditional floating layer (which allows mouse-resizing, and overlapping windows). * improved Xinerama support: workspace switching reuses multiple displays more effectively. * huge new extension library. Over 50 extensions to xmonad have been contributed by users, and are available all in a standard library, with documentation. More information, screenshots, documentation and community resources are available from: http://xmonad.org Xmonad is available from hackage, and via darcs. Happy hacking! The Xmonad Team: Spencer Janssen Don Stewart Jason Creighton Xmonad has also received contributions from at least: Alec Berryman Andrea Rossato Chris Mears Daniel Wagner David Glasser David Lazar David Roundy Hans Philipp Annen Joachim Fasting Joe Thornber Kai Grossjohann Karsten Schoelzel Michael Sloan Miikka Koskinen Neil Mitchell Nelson Elhage Nick Burlett Peter De Wachter Robert Marlow Sam Hughes Shachaf Ben-Kiki Shae Erisson Simon Peyton Jones Stefan O'Rear as well as many others on the IRC channel and mailing list. Thanks to everyone! From ketil at ii.uib.no Wed Sep 5 04:22:05 2007 From: ketil at ii.uib.no (Ketil Malde) Date: Wed Sep 5 04:17:54 2007 Subject: [Haskell] ANNOUNCE: xmonad 0.3 In-Reply-To: <20070905030251.GB16045@cse.unsw.EDU.AU> References: <20070905030251.GB16045@cse.unsw.EDU.AU> Message-ID: <1188980525.587.15.camel@nmd9999> On Wed, 2007-09-05 at 13:02 +1000, Donald Bruce Stewart wrote: > The xmonad dev team is pleased to announce the 0.3 release of xmonad. I just wanted to congratulate the team, and say that xmonad is, along with darcs, my favorite "mainstream" Haskell program. I used to spend days experimenting with different window managers and applets, docks and whatnot; now I get so much more time to do more important stuff - like spamming technical mailing lists with non-technical content. But I digress. Nice work! -k From icfp.publicity at googlemail.com Wed Sep 5 14:56:53 2007 From: icfp.publicity at googlemail.com (Matthew Fluet (ICFP Publicity Chair)) Date: Wed Sep 5 14:47:20 2007 Subject: [Haskell] ICFP07 Reminder: registration deadline Message-ID: <53ff55480709051156k48e2b7b0uda85549ad5a081b7@mail.gmail.com> ===================================================================== Final Call for Participation The 12th ACM SIGPLAN International Conference on Functional Programming (ICFP 2007) http://www.informatik.uni-bonn.de/~ralf/icfp07.html http://proglang.informatik.uni-freiburg.de/ICFP2007 Freiburg, Germany, 1-3 October 2007 ===================================================================== ***** Early Registration Deadline: September 7, 2007 ***** ICFP 2007 provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. The conference covers the entire spectrum of work, from practice to theory, including its peripheries. Schedule including related workshops: * 30 Sep: ACM SIGPLAN Haskell Workshop * 30 Sep: ACM SIGPLAN Workshop on Scheme and Functional Programming * 1-3 Oct: ICFP07 * 4 Oct: ACM SIGPLAN Commercial Users of Functional Programming * 4 Oct: ACM SIGPLAN Workshop on Mechanizing Metatheory * 5 Oct: ACM SIGPLAN Erlang Workshop * 5 Oct: ACM SIGPLAN Workshop on ML * 5 Oct: ACM SIGPLAN Programming Languages meets Program Verification From t.owens at hautlieu.sch.je Wed Sep 5 17:10:12 2007 From: t.owens at hautlieu.sch.je (Tomi Owens) Date: Wed Sep 5 16:59:09 2007 Subject: [Haskell] (no subject) Message-ID: <200709052210453.SM04740@[10.93.17.80]> Skipped content of type multipart/alternative From allbery at ece.cmu.edu Wed Sep 5 17:28:58 2007 From: allbery at ece.cmu.edu (Brandon S. Allbery KF8NH) Date: Wed Sep 5 17:19:28 2007 Subject: [Haskell] (no subject) In-Reply-To: <200709052210453.SM04740@[10.93.17.80]> References: <200709052210453.SM04740@[10.93.17.80]> Message-ID: On Sep 5, 2007, at 21:10 , Tomi Owens wrote: > Prelude> let f (a,b) = a * floor (100000/b) > Prelude> f(2,5) > 40000 > > This function works just as I want it to. > > Now I try creating a list: > > Prelude> [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, b<=a] > [(2,1),(5,2),(8,2),(10,3),(13,3),(18,3),(17,4)] > > and this works > So now I try to apply the function to the list: > > Prelude> map (f) [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, b<=a] > > and I get this result: > > :1:5: > Ambiguous type variable `t' in the constraints: > `Integral t' arising from use of `f' at :1:5 > `RealFrac t' arising from use of `f' at :1:5 > Probable fix: add a type signature that fixes these type variable > (s) > > > I'm sorry, but I don't quite get how to set the type signature and > how it will apply to my function... The problem here is that (assuming the a\sup{2} etc. are actually a^2) the (^) operator expects and returns Integrals, but (/) requires a RealFrac. Thus, the type of your list comprehension is inferred to be [(Integer,Integer)] but needs to be RealFrac a => [(Integer,a)] (or, more simply, [(Integer,Double)]. Prelude> let f (a,b) = a * floor (100000/b) Prelude> :t f f :: (RealFrac t1, Integral t) => (t, t1) -> t Prelude> let v :: [(Integer,Double)]; v = [(a^2 + b^2,fromIntegral a) | a <- [1..4], b <- [1..4], a^2 + b^2 < 20, b <= a] Prelude> :t v v :: [(Integer, Double)] Prelude> map f v [200000,250000,400000,333330,433329,599994,425000] -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH From chaddai.fouche at gmail.com Wed Sep 5 17:30:43 2007 From: chaddai.fouche at gmail.com (=?ISO-8859-1?Q?Chadda=EF_Fouch=E9?=) Date: Wed Sep 5 17:21:09 2007 Subject: [Haskell] (no subject) In-Reply-To: <200709052210453.SM04740@10.93.17.80> References: <200709052210453.SM04740@10.93.17.80> Message-ID: 2007/9/5, Tomi Owens : > So now I try to apply the function to the list: > > Prelude> map (f) [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, b<=a] > > and I get this result: > > :1:5: > Ambiguous type variable `t' in the constraints: > `Integral t' arising from use of `f' at :1:5 > `RealFrac t' arising from use of `f' at :1:5 > Probable fix: add a type signature that fixes these type variable(s) > > > I'm sorry, but I don't quite get how to set the type signature and how it > will apply to my function... > It's because f need a real, not an integer as the second element of its parameter (since it use (/) in (10000/b)), and as it also needs an integer as it's first, the type checker don't know what the type of a should be (it can't be both an integer and a floating value at the same time). The easiest IMO is to keep a as an integer, but use "fromIntegral" to convert it to a real in the second part of the tuple : map f [( a^2+b^2, fromIntegral a) | a <- [1..4] , b<- [1..4], a^2+b^2<20, b<=a] You would get more help and faster from an IRC channel like #haskell@irc.freenode.net though. -- Jeda? From byorgey at gmail.com Wed Sep 5 17:39:31 2007 From: byorgey at gmail.com (Brent Yorgey) Date: Wed Sep 5 17:29:56 2007 Subject: [Haskell] (no subject) In-Reply-To: <200709052210453.SM04740@10.93.17.80> References: <200709052210453.SM04740@10.93.17.80> Message-ID: <22fcbd520709051439i27d137feye1d532167a666c7f@mail.gmail.com> On 9/5/07, Tomi Owens wrote: > > Hi there. I'm a teacher of Maths and am working my way through the Euler > Project problems for fun. I have mostly been using Basic, but have read up > about Haskell and think it looks like a sensible way to solve many of the > problems. > > I see others have already answered your immediate question; however, I thought I'd throw in some general comments. Project Euler is indeed a great way to learn some Haskell, but you will certainly run into problems with the numeric types (as you already have). Haskell is very picky about numeric types (for good reason!), and until you get used to it, it can be a big pain and a source of some confusion. I highly recommend that you read about type classes, and you may also want to read something like http://haskell.org/haskellwiki/Converting_numbers. As someone else already mentioned, asking questions in the #haskell IRC channel on irc.freenode.netis also an excellent way to learn things and get past error messages and things like this which are probably simple, but you just can't figure out. Hope this helps, -Brent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell/attachments/20070905/e7b8b7f9/attachment.htm From chris at cmears.id.au Wed Sep 5 17:39:29 2007 From: chris at cmears.id.au (Chris Mears) Date: Wed Sep 5 17:30:01 2007 Subject: [Haskell] (no subject) In-Reply-To: <200709052210453.SM04740@[10.93.17.80]> (Tomi Owens's message of "Wed\, 05 Sep 2007 21\:10\:12 GMT") References: <200709052210453.SM04740@[10.93.17.80]> Message-ID: <87ir6obxm6.fsf@loki.cmears.id.au> "Tomi Owens" writes: > Hi there. I'm a teacher of Maths and am working my way through the > Euler Project problems for fun. I have mostly been using Basic, but > have read up about Haskell and think it looks like a sensible way to > solve many of the problems. It certainly is. > Prelude> let f (a,b) = a * floor (100000/b) >From the floor and the rest of your message, it looks like you want truncating integer division here. So, instead of floor and (/), use div. let f (a,b) = a * 100000 `div` b With that change the rest of your program should work. The other replies explain why the interpreter couldn't figure out which type to use. From frank at geoinfo.tuwien.ac.at Thu Sep 6 06:22:49 2007 From: frank at geoinfo.tuwien.ac.at (Andrew U. Frank) Date: Thu Sep 6 06:13:14 2007 Subject: [Haskell] Re: overloading of list operations In-Reply-To: (from allbery@ece.cmu.edu on Wed Sep 5 23:28:58 2007) References: <200709052210453.SM04740@[10.93.17.80]> Message-ID: <1189074169l.5447l.6l@atlantaG> On 5 Sep 07 23 28, Brandon S. Allbery KF8NH wrote: > > On Sep 5, 2007, at 21:10 , Tomi Owens wrote: > > > Prelude> let f (a,b) = a * floor (100000/b) > > Prelude> f(2,5) > > 40000 > > > > This function works just as I want it to. > > > > Now I try creating a list: > > > > Prelude> [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, b<=a] > > [(2,1),(5,2),(8,2),(10,3),(13,3),(18,3),(17,4)] > > > > and this works > > So now I try to apply the function to the list: > > > > Prelude> map (f) [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, > b<=a] > > > > and I get this result: > > > > :1:5: > > Ambiguous type variable `t' in the constraints: > > `Integral t' arising from use of `f' at :1:5 > > `RealFrac t' arising from use of `f' at :1:5 > > Probable fix: add a type signature that fixes these type > variable > > > (s) > > > > > > I'm sorry, but I don't quite get how to set the type signature and > > how it will apply to my function... > > The problem here is that (assuming the a\sup{2} etc. are actually > a^2) the (^) operator expects and returns Integrals, but (/) requires > > a RealFrac. Thus, the type of your list comprehension is inferred to > > be [(Integer,Integer)] but needs to be RealFrac a => [(Integer,a)] > (or, more simply, [(Integer,Double)]. > > Prelude> let f (a,b) = a * floor (100000/b) > Prelude> :t f > f :: (RealFrac t1, Integral t) => (t, t1) -> t > Prelude> let v :: [(Integer,Double)]; v = [(a^2 + b^2,fromIntegral > > a) | a <- [1..4], b <- [1..4], a^2 + b^2 < 20, b <= a] > Prelude> :t v > v :: [(Integer, Double)] > Prelude> map f v > [200000,250000,400000,333330,433329,599994,425000] > > -- > brandon s. allbery [solaris,freebsd,perl,pugs,haskell] > allbery@kf8nh.com > system administrator [openafs,heimdal,too many hats] > allbery@ece.cmu.edu > electrical and computer engineering, carnegie mellon university > KF8NH > > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > > From frank at geoinfo.tuwien.ac.at Thu Sep 6 06:22:49 2007 From: frank at geoinfo.tuwien.ac.at (Andrew U. Frank) Date: Thu Sep 6 06:19:10 2007 Subject: [Haskell] Re: overloading of list operations In-Reply-To: (from allbery@ece.cmu.edu on Wed Sep 5 23:28:58 2007) References: <200709052210453.SM04740@[10.93.17.80]> Message-ID: <1189074169l.5447l.6l@atlantaG> On 5 Sep 07 23 28, Brandon S. Allbery KF8NH wrote: > > On Sep 5, 2007, at 21:10 , Tomi Owens wrote: > > > Prelude> let f (a,b) = a * floor (100000/b) > > Prelude> f(2,5) > > 40000 > > > > This function works just as I want it to. > > > > Now I try creating a list: > > > > Prelude> [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, b<=a] > > [(2,1),(5,2),(8,2),(10,3),(13,3),(18,3),(17,4)] > > > > and this works > > So now I try to apply the function to the list: > > > > Prelude> map (f) [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, > b<=a] > > > > and I get this result: > > > > :1:5: > > Ambiguous type variable `t' in the constraints: > > `Integral t' arising from use of `f' at :1:5 > > `RealFrac t' arising from use of `f' at :1:5 > > Probable fix: add a type signature that fixes these type > variable > > > (s) > > > > > > I'm sorry, but I don't quite get how to set the type signature and > > how it will apply to my function... > > The problem here is that (assuming the a\sup{2} etc. are actually > a^2) the (^) operator expects and returns Integrals, but (/) requires > > a RealFrac. Thus, the type of your list comprehension is inferred to > > be [(Integer,Integer)] but needs to be RealFrac a => [(Integer,a)] > (or, more simply, [(Integer,Double)]. > > Prelude> let f (a,b) = a * floor (100000/b) > Prelude> :t f > f :: (RealFrac t1, Integral t) => (t, t1) -> t > Prelude> let v :: [(Integer,Double)]; v = [(a^2 + b^2,fromIntegral > > a) | a <- [1..4], b <- [1..4], a^2 + b^2 < 20, b <= a] > Prelude> :t v > v :: [(Integer, Double)] > Prelude> map f v > [200000,250000,400000,333330,433329,599994,425000] > > -- > brandon s. allbery [solaris,freebsd,perl,pugs,haskell] > allbery@kf8nh.com > system administrator [openafs,heimdal,too many hats] > allbery@ece.cmu.edu > electrical and computer engineering, carnegie mellon university > KF8NH > > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > > From frank at geoinfo.tuwien.ac.at Thu Sep 6 06:28:46 2007 From: frank at geoinfo.tuwien.ac.at (Andrew U. Frank) Date: Thu Sep 6 06:19:23 2007 Subject: [Haskell] Re: overloading of list operations In-Reply-To: <1189074169l.5447l.6l@atlantaG> (from frank@geoinfo.tuwien.ac.at on Thu Sep 6 12:22:49 2007) References: <200709052210453.SM04740@[10.93.17.80]> <1189074169l.5447l.6l@atlantaG> Message-ID: <1189074526l.5447l.7l@atlantaG> sorry for the empty post before - what i wanted to says is, but the send button was to quickly reached: --------------------- i think this is a perfect example that the statement made earlier, namely that list overloading confuses beginners, but overloading numbers does not, is wrong. i would therefore recommend (1) that all operators in Haskell' are made into classes to allow their overloading - in accordance with the polymorphic character of haskell (today). and (2) that the number system with the default conversions is critically evaluated. in my programming, the overloading of numbers and the defaults come in may way more often than not (i'd rather not have it automatically done! like many other things in haskell which are not automatic). overloading of numbers - as currently done - makes it difficult to use GHCi as a convenient and easy to use desktop calculator - more flexible and powerful than most others and in competition with mathematica and mathcad etc. (there is a large user pool!) andrew On 6 Sep 07 12 22, Andrew U. Frank wrote: > On 5 Sep 07 23 28, Brandon S. Allbery KF8NH wrote: > > > > On Sep 5, 2007, at 21:10 , Tomi Owens wrote: > > > > > Prelude> let f (a,b) = a * floor (100000/b) > > > Prelude> f(2,5) > > > 40000 > > > > > > This function works just as I want it to. > > > > > > Now I try creating a list: > > > > > > Prelude> [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, b<=a] > > > [(2,1),(5,2),(8,2),(10,3),(13,3),(18,3),(17,4)] > > > > > > and this works > > > So now I try to apply the function to the list: > > > > > > Prelude> map (f) [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, > > b<=a] > > > > > > and I get this result: > > > > > > :1:5: > > > Ambiguous type variable `t' in the constraints: > > > `Integral t' arising from use of `f' at :1:5 > > > `RealFrac t' arising from use of `f' at :1:5 > > > Probable fix: add a type signature that fixes these type > > variable > > > > > (s) > > > > > > > > > I'm sorry, but I don't quite get how to set the type signature > and > > > > how it will apply to my function... > > > > The problem here is that (assuming the a\sup{2} etc. are actually > > a^2) the (^) operator expects and returns Integrals, but (/) > requires > > > > a RealFrac. Thus, the type of your list comprehension is inferred > to > > > > be [(Integer,Integer)] but needs to be RealFrac a => [(Integer,a)] > > (or, more simply, [(Integer,Double)]. > > > > Prelude> let f (a,b) = a * floor (100000/b) > > Prelude> :t f > > f :: (RealFrac t1, Integral t) => (t, t1) -> t > > Prelude> let v :: [(Integer,Double)]; v = [(a^2 + > b^2,fromIntegral > > > > a) | a <- [1..4], b <- [1..4], a^2 + b^2 < 20, b <= a] > > Prelude> :t v > > v :: [(Integer, Double)] > > Prelude> map f v > > [200000,250000,400000,333330,433329,599994,425000] > > > > -- > > brandon s. allbery [solaris,freebsd,perl,pugs,haskell] > > allbery@kf8nh.com > > system administrator [openafs,heimdal,too many hats] > > allbery@ece.cmu.edu > > electrical and computer engineering, carnegie mellon university > > KF8NH > > > > > > _______________________________________________ > > Haskell mailing list > > Haskell@haskell.org > > http://www.haskell.org/mailman/listinfo/haskell > > > > > > > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From k.mcbeath at orgtel.com Thu Sep 6 11:24:50 2007 From: k.mcbeath at orgtel.com (McBeath, Kyle) Date: Thu Sep 6 11:15:15 2007 Subject: [Haskell] Re: Entry route into Finance for quantitative functional programming developers Message-ID: Dear All, The global quantitative analytics group of a London based 1st tier investment bank is urgently searching for a strong quantitative developer, with proven experience of functional programming languages. The group is responsible for the research, development and implementation of quantitative models across all Rates asset classes. Initially, the main function of the job will be to contribute to the extension of their payout framework. The framework has been developed within the Equity Derivatives area and is based on Haskell. In the long term you will be responsible for the cross asset payout technology. This is great permanent opportunity to join a first tier investment bank and a very successful desk. You will be able to apply cutting edge functional programming language knowledge in a real world situation, with both great exposure to the business and multiple asset classes. A strong candidate will have a great quantitative education and have a experience of functional programming (Haskell, ML, CaML) as well as C++ experience. Any knowledge of financial products is a plus. If interested in the role or would like to discuss functional programming opportunities within finance, please send an up to date CV and give me a call. Regards, Kyle Kyle McBeath | Quantitative Development Consultant Orgtel Finance 5th Floor | 140 Leadenhall Street London | EC3V 4QT T: 0207 3372323 http://www.orgtel.com This email is confidential and intended solely for the addressee. If you are not the intended addressee, please notify Orgtel immediately. If received in error, you must not disclose, copy or otherwise distribute the contents of this email. If you do not want to receive further emails from us about our services, or wish to query how your personal data is held by us, please contact us via email at dataprotection@orgtel.co.uk You can view our privacy statement at: http://www.orgtel.com/privacy_statement.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell/attachments/20070906/300e6cad/attachment.htm From pirelo at googlemail.com Fri Sep 7 11:06:23 2007 From: pirelo at googlemail.com (Pablo Nogueira) Date: Fri Sep 7 10:56:44 2007 Subject: [Haskell] Plea for separate kind annotations Message-ID: Just quickly, in light of some wiki tracs on Haskell prime i've read recently. I wonder if any one else is also of the opinion that kind annotations should be available and that they should be separated from type definitions in the same way as type annotations are separated from value definitions. Example: data T :: * -> * data T a = T a There are two levels of lambda calculus (values and types), with types structuring values and kinds structuring types. So why not let programmers deal with them in similar ways? From g9ks157k at acme.softbase.org Fri Sep 7 11:20:54 2007 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Fri Sep 7 11:11:50 2007 Subject: [Haskell] Plea for separate kind annotations In-Reply-To: References: Message-ID: <200709071720.54635.g9ks157k@acme.softbase.org> Am Freitag, 7. September 2007 17:06 schrieb Pablo Nogueira: > Just quickly, in light of some wiki tracs on Haskell prime i've read > recently. > > I wonder if any one else is also of the opinion that kind annotations > should be available and that they should be separated from type > definitions in the same way as type annotations are separated from > value definitions. > > Example: > > data T :: * -> * > > data T a = T a > > There are two levels of lambda calculus (values and types), with types > structuring values and kinds structuring types. So why not let > programmers deal with them in similar ways? Sounds reasonable. Best wishes, Wolfgang From k.mcbeath at orgtel.com Fri Sep 7 13:53:59 2007 From: k.mcbeath at orgtel.com (McBeath, Kyle) Date: Fri Sep 7 13:44:21 2007 Subject: [Haskell] Re: Haskell development in Banking Message-ID: A top tier Investment bank is looking for a Haskell developer to join their quantitative analytics group. This is a permanent position in London, joining a cross asset team. You will be able to use Haskell commercially everyday, be generously compensated and be on the forefront of technology in banking. This is a great opportunity for PhD students or above with proven experience of Haskell programming. If you are interested in the position or would like further details then please send an up to date CV in word document to k.mcbeath@orgtel.com during the week or kylemcbeath@hotmail.co.uk on the weekend. Alternatively you can call me on 0207 337 2323. Kind regards, Kyle McBeath http://www.orgtel.com This email is confidential and intended solely for the addressee. If you are not the intended addressee, please notify Orgtel immediately. If received in error, you must not disclose, copy or otherwise distribute the contents of this email. If you do not want to receive further emails from us about our services, or wish to query how your personal data is held by us, please contact us via email at dataprotection@orgtel.co.uk You can view our privacy statement at: http://www.orgtel.com/privacy_statement.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell/attachments/20070907/b204a140/attachment.htm From claus.reinke at talk21.com Sun Sep 9 20:59:26 2007 From: claus.reinke at talk21.com (Claus Reinke) Date: Sun Sep 9 20:49:43 2007 Subject: [Haskell] ANNOUNCE: Haskell mode plugins for Vim Message-ID: <024401c7f345$d6f67ec0$ce1c8351@cr3lt> recent off-list discussions have reminded me that it has been quite a while since i last announced my haskell mode plugins for vim here: http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/ i know that many of you keep up to date with these - thanks everyone (but especially the gentoo haskell group:-) for the positive feedback, useful bug reports and contributions! but if you haven't had a look since the last announcement in April, you will want to update (assuming you're using vim;-), as the plugins have seen a lot of change since then. the plugins functionality is based partially on ghc(i), haddock documentation/indexes, and vim scripting, and they are now known (or can be configured) to work with a variety of unixes, windows, and browsers. the gui vim version is still recommended for popup menues and type balloons, but the plugins now also work in console vim (useful for remote editing), with console mode browsers. handling of qualified names has also improved. the plugins are now available as a single vimball archive (at the time of writing, the latest is dated 20070828), for easy installation (just open the vimball in vim and follow instructions, or see :help vimball-extract), and come with a vim help file (which the vimball archiver will automatically link into your vim's :help on extraction). alternatively, you can select individual files for download separately, and gentoo users can use the gentoo haskell overlay. here is the quick reference section from the helpfile: *haskellmode-quickref* 1.2 Quick Reference ~ |:make| load into GHCi, show errors (|quickfix| |:copen|) |_ct| create |tags| file |_si| show info for id under cursor |_t| show type for id under cursor |_T| insert type declaration for id under cursor |balloon| show type for id under mouse pointer |_?| browse Haddock entry for id under cursor |:IDoc| {identifier} browse Haddock entry for unqualified {identifier} |:MDoc| {module} browse Haddock entry for {module} |_.| qualify unqualified id under cursor |_i| add 'import ()' for id under cursor |_im| add 'import ' for id under cursor |_ie| make imports explit for import statement under cursor |_opt| add OPTIONS_GHC pragma |i_CTRL-X_CTRL-O| insert-mode completion based on imported ids (|haskellmode-XO|) |i_CTRL-X_CTRL-U| insert-mode completion based on documented ids (|haskellmode-XU|) |i_CTRL-N| insert-mode completion based on imported sources |:GHCi|{command/expr} run GHCi command/expr in current module |:DocSettings| show current Haddock-files-related plugin settings |:DocIndex| populate Haddock index |:ExportDocIndex| cache current Haddock index to a file |:HpasteIndex| Read index of most recent entries from hpaste.org |:HpastePostNew| Submit current buffer as a new hpaste for details, requirements, and settings, see :help haskellmode after installation, or read the helpfile online: http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/vimfiles/doc/haskellmode.txt the guided tour with screenshots is still at http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/vim.html i only started logging changes and known issues in August: http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/vimfiles/haskellmode-files.txt happy vimming!-) claus From wss at Cs.Nott.AC.UK Mon Sep 10 07:46:05 2007 From: wss at Cs.Nott.AC.UK (Wouter Swierstra) Date: Mon Sep 10 07:36:31 2007 Subject: [Haskell] ANN: The Monad.Reader - Issue 8 Message-ID: <73746AD9-CB21-477C-B3AA-B0B4FEC3CA64@cs.nott.ac.uk> I am pleased to announce that the latest issue of The Monad.Reader is now available: http://www.haskell.org/haskellwiki/The_Monad.Reader Issue 8 consists of the following two articles: * Brent Yorgey Generating Multiset Partitions * Conrad Parker Type-Level Instant Insanity The Monad.Reader is a quarterly magazine about functional programming. It is less-formal than journal, but somehow more enduring than a wiki page or blog post. If you'd like to submit something to the next issue of The Monad.Reader, please get in touch. I haven't fixed the deadline for the next issue just yet; I hope to send out an official call for copy in the coming weeks. I'd also like to point out that you can now order TMR apparel from: http://www.cafepress.com/TheMonadReader. Enjoy! Wouter This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From p.k.f.holzenspies at utwente.nl Mon Sep 10 16:39:50 2007 From: p.k.f.holzenspies at utwente.nl (Philip =?utf-8?B?Sy5GLiBIw7ZsemVuc3BpZXM=?=) Date: Mon Sep 10 16:30:04 2007 Subject: [Haskell] Numeric programming on toy problems in Haskell Message-ID: <20070910203950.GB375@ewi1043.ewi.utwente.nl> Dear Tomi, all, I agree with everyone on this list that there is a good reason for being picky about numeric types. However, when you're simply trying to understand a small problem or puzzle, the rather intricate numeric part of the type system can be prohibitively complex. I'm no Haskell guru, but I don't consider myself a novice anymore. Still, I tend to waste time on numeric stuff when trying to understand a simple and small problem. To avoid this, I wrote a Number module that provides a type Number that is of all of the standard numeric type classes. Especially for toy problems - I keep repeating this, because my Number module is NOT FIT for production code - it is the lazy man's solution to all the fuss about numbers. I'm lazy, me like. You can have a look at the Number module here: http://www.cs.utwente.nl/~holzensp/Number.hs Now, whenever I've hacked together a small program, it nearly always works. When it doesn't, it generally complains about some numeric value somewhere. I just stick a "toNumber" in front, et voil?! :D Regards, Philip PS. I know, people will want to kill me for putting all numbers back together in a sluggish single type, but in my defense: aren't we all a tiny bit lazy every once in a while? From isaacdupree at charter.net Mon Sep 10 18:35:07 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Mon Sep 10 18:26:54 2007 Subject: [Haskell] Numeric programming on toy problems in Haskell In-Reply-To: <20070910203950.GB375@ewi1043.ewi.utwente.nl> References: <20070910203950.GB375@ewi1043.ewi.utwente.nl> Message-ID: <46E5C69B.3020108@charter.net> Philip K.F. H?lzenspies wrote: > You can have a look at the Number module here: > > http://www.cs.utwente.nl/~holzensp/Number.hs > > Now, whenever I've hacked together a small program, it nearly always > works. When it doesn't, it generally complains about some numeric > value somewhere. I just stick a "toNumber" in front, et voil?! :D It uses Rational as representation, temporarily switching to Double when it needs to carry out inexact/irrational computations such as (pi) and (sin). Integral looks reasonable (are those really supposed to be div and mod in defining quotRem, not quot and rem? I'm not sure). There's no(?) excuse for using GHC extensions... just use (Prelude.)fromRational instead of GHC.Float.fromRat (if using GHC, it will optimize to the same thing, at least if optimizations are on); and remove {-# OPTIONS -fglasgow-exts #-}. I like the design. (Have you seen Scheme's (dynamically typed) numeric ladder? It adds a separate, additional concept of being able to tell, from a numeric value, whether it is exact or not - e.g. for this Number implementation, (1 + 1/3) is exact, and (sin pi) isn't, I think.) Isaac From Oege.de.Moor at comlab.ox.ac.uk Tue Sep 11 08:01:07 2007 From: Oege.de.Moor at comlab.ox.ac.uk (Oege.de.Moor@comlab.ox.ac.uk) Date: Tue Sep 11 07:51:18 2007 Subject: [Haskell] PEPM 2008: abstracts due Oct 12 Message-ID: <200709111201.l8BC1767020467@mercury.comlab.ox.ac.uk> PEPM 2008 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation January 7-8, 2008, San Francisco Keynotes by Ras Bodik (Berkeley) and Monica Lam (Stanford) Co-located with POPL http://www.program-transformation.org/PEPM08/WebHome PEPM is a leading venue for the presentation of cutting-edge research in program analysis, program generation and program transformation. Its proceedings are published by ACM Press; full details of the scope, submission process, and program committee can be found at the above URL. The program committee would particularly welcome submissions from researchers in functional programming on any topic relating to analysis, optimisation and synthesis of Haskell programs Abstracts are due on October 12, and the deadline for full paper submission is October 17. Prospective authors are welcome to contact the program chairs, Robert Glueck (glueck@acm.org) and Oege de Moor (oege@comlab.ox.ac.uk) with any queries they might have. From garrigue at math.nagoya-u.ac.jp Wed Sep 12 08:48:30 2007 From: garrigue at math.nagoya-u.ac.jp (Jacques Garrigue) Date: Wed Sep 12 08:38:47 2007 Subject: [Haskell] FLOPS 2008 second Call for Papers Message-ID: <20070912.214830.149805240.garrigue@math.nagoya-u.ac.jp> [We apologize for the multiple postings of this announce] SECOND CALL FOR PAPERS Ninth International Symposium on Functional and Logic Programming (FLOPS 2008) April 14-16, 2008 Ise, Japan Submission deadline: October 10, 2007 Keynotes: Peter Dybjer, Naoki Kobayashi, and Torsten Schaub http://www.math.nagoya-u.ac.jp/~garrigue/FLOPS2008/ FLOPS is a forum for research on all issues concerning declarative programming, including functional programming and logic programming, and aims to promote cross-fertilization and integration between the two paradigms. Previous FLOPS meetings were held in Fuji Susono (1995), Shonan Village (1996), Kyoto (1998), Tsukuba (1999), Tokyo (2001), Aizu (2002), Nara (2004), and Fuji Susono (2006). TOPICS FLOPS 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, real-world applications, graphical user interfaces, Internet applications, XML, databases, formal methods and model checking. The proceedings are expected to be published as an LNCS volume. The proceedings of the previous meeting (FLOPS2006) were published as LNCS 3945. INVITED SPEAKERS Peter Dybjer (Chalmers, Sweden) Naoki Kobayashi (Tohoku, Japan) Torsten Schaub (Potsdam, Germany) PC CO-CHAIRS Jacques Garrigue (Nagoya, Japan) Manuel Hermenegildo (Madrid, Spain and New Mexico, USA) PC MEMBERS Maria Alpuente (Valencia, Spain) Sergio Antoy (Portland, OR, USA) Matthias Blume (TTI, Chicago, USA) Tyng-Ruey Chuang (Academia Sinica, Taiwan) Zhenjiang Hu (Tokyo, Japan) Oleg Kiselyov (FNMOC, Monterey, USA) Herbert Kuchen (Muenster, Germany) Dale Miller (INRIA, Palaiseau, France) Atsushi Ohori (Tohoku, Japan) Enrico Pontelli (New Mexico, USA) Kristoffer Rose (IBM Watson, USA) Kazunori Ueda (Waseda, Japan) Peter Van Roy (Louvain-la-Neuve, Belgium) Benjamin Werner (INRIA, Palaiseau, France) LOCAL CHAIR Shoji Yuen (Nagoya, Japan) SUBMISSION 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. Please visit the conference site. IMPORTANT DATES Submission deadline: October 10, 2007 Author notification: December 21, 2007 Camera-ready copy: January 21, 2008 Conference: April 14-16, 2008 PLACE Ise, Japan Previous FLOPS: FLOPS 2006, Fuji Susono: http://hagi.is.s.u-tokyo.ac.jp/FLOPS2006/ FLOPS 2004, Nara: http://logic.cs.tsukuba.ac.jp/FLOPS2004/ FLOPS 2002, Aizu: http://www.ipl.t.u-tokyo.ac.jp/FLOPS2002/ FLOPS 2001, Tokyo: http://www.ueda.info.waseda.ac.jp/flops2001/ SPONSOR Japan Society for Software Science and Technology (JSSST) SIG-PPL IN COOPERATION with Asian Association for Foundation of Software (AAFS) Association for Logic Programming (ALP) ACM SIGPLAN (pending) INQUIRIES to From p.k.f.holzenspies at utwente.nl Wed Sep 12 09:29:36 2007 From: p.k.f.holzenspies at utwente.nl (Philip =?utf-8?B?Sy5GLiBIw7ZsemVuc3BpZXM=?=) Date: Wed Sep 12 09:19:45 2007 Subject: [Haskell] Re: Numeric programming on toy problems in Haskell Message-ID: <20070912132935.GA7126@ewi1043.ewi.utwente.nl> Dear Isaac, all, > Integral looks reasonable (are those really supposed to be div and > mod in defining quotRem, not quot and rem? I'm not sure). Yes, you're right. I changed to quot and rem. Also, the denominator and numerator functions were a bit needlessly complex. > There's no(?) excuse for using GHC extensions... just use > (Prelude.)fromRational instead of GHC.Float.fromRat (if using GHC, > it will optimize to the same thing, at least if optimizations are > on); and remove {-# OPTIONS -fglasgow-exts #-}. You were right about fromRat. I changed it into fromRational, saving me a GHC specific import. The GHC extensions are used, however, because of laziness; i.e. automatic derivation of Enum, Num, Fractional, Real and RealFrac. Without the GHC extensions, only Eq and Ord can be derived automatically. If I'm wrong about this, please let me know, because I would prefer a compiler independent solution as well. With respect to optimization; I think considering optimizability (?) in the design of such a module is a bit of a paradox. If optimization is a criterion, use the fine-grained typing and don't chuck all your numeric types into a single Number type. > (Have you seen Scheme's (dynamically typed) numeric ladder? It adds > a separate, additional concept of being able to tell, from a numeric > value, whether it is exact or not - e.g. for this Number > implementation, (1 + 1/3) is exact, and (sin pi) isn't, I think.) No, I haven't, I'm afraid. Like I said, this was pretty much a quick'n'dirty solution so that I could get on with my little puzzles (and because I learned FP in Miranda and never quite lost the 'num' affinitiy). There is a lingering idea that I could / should rework the Floating and RealFloat instances to be arbitrarily precise for most functions, by using continued fractions (only works for continued fractions that show regularity). Another option I was considering was to have all those operations be represented symbolically until such a time when they really needed to be approximated (for show, toInteger or toFloat). At that time I could either have my own simplifier and approximator, or I could link to other tools (maple, gnu something?). The idea was stalled, because I only use this for toy problems ;) If someone feels inspired, feel free to take this module and rework. I'm also open for suggestions on how to do this myself in case I ever un-stall this ;) Regards, Philip PS. Version with minor revisions is available, again from: http://www.cs.utwente.nl/~holzensp/Number.hs From isaacdupree at charter.net Wed Sep 12 10:37:02 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Wed Sep 12 10:29:03 2007 Subject: [Haskell] Re: Numeric programming on toy problems in Haskell In-Reply-To: <20070912132935.GA7126@ewi1043.ewi.utwente.nl> References: <20070912132935.GA7126@ewi1043.ewi.utwente.nl> Message-ID: <46E7F98E.7030907@charter.net> Philip K.F. H?lzenspies wrote: > The GHC extensions are used, however, > because of laziness; i.e. automatic derivation of Enum, Num, > Fractional, Real and RealFrac. Without the GHC extensions, only Eq and > Ord can be derived automatically. If I'm wrong about this, please let > me know, because I would prefer a compiler independent solution as > well. Thank you for reminding me. You can preferably use {-# LANGUAGE GeneralizedNewtypeDeriving #-} instead of {-# OPTIONS -fglasgow-exts #-}, to just enable the needed extension, although only GHC implements it currently.... Or, you can explicitly write out each instance in the very straightforward way, which is portable (though a bit annoying and inefficient). Or, I think there are tools that can automatically write such instances for you? > [...] > At that time I could either have my own simplifier and > approximator, or I could link to other tools (maple, gnu something?). > > The idea was stalled, because I only use this for toy problems ;) If > someone feels inspired, feel free to take this module and rework. I'm > also open for suggestions on how to do this myself in case I ever > un-stall this ;) That is *a lot* more complicated. Beware of non-termination. I don't think every equality, every exactness, is observable (not sure whether a Num type like that offers the full power of the real numbers - if it does, then you have a turing-complete problem.) Whereas, the present inexactness means that the numerator and denominator don't tend to get so big that the computations are really slow. (If MPFR could be used in Haskell, one could choose the desired precision rather than using whatever Double gives, I suppose) Making the type be "data" with fields Rational as well as whether it's exact, could be done (though I'm not entirely satisfied with, nor interested in, the "exact" concept, so it's just an idea). Then you would not be able to use generalized newtype deriving, so you wouldn't ^_^ Isaac From simonpj at microsoft.com Wed Sep 12 16:38:41 2007 From: simonpj at microsoft.com (Simon Peyton-Jones) Date: Wed Sep 12 16:38:20 2007 Subject: [Haskell] Re: Numeric programming on toy problems in Haskell In-Reply-To: <46E7F98E.7030907@charter.net> References: <20070912132935.GA7126@ewi1043.ewi.utwente.nl> <46E7F98E.7030907@charter.net> Message-ID: Interesting though this thread is, it belongs on Haskell-caf?, or ghc-users, not the main Haskell announcement list. Can I suggest that replies are directed to one of those places? Simon | -----Original Message----- | From: haskell-bounces@haskell.org [mailto:haskell-bounces@haskell.org] | On Behalf Of Isaac Dupree | Sent: 12 September 2007 15:37 | To: haskell@haskell.org | Subject: [Haskell] Re: Numeric programming on toy problems in Haskell | | Philip K.F. H?lzenspies wrote: | > The GHC extensions are used, however, | > because of laziness; i.e. automatic derivation of Enum, Num, | > Fractional, Real and RealFrac. Without the GHC extensions, only Eq | and | > Ord can be derived automatically. If I'm wrong about this, please let | > me know, because I would prefer a compiler independent solution as | > well. | | Thank you for reminding me. You can preferably use {-# LANGUAGE | GeneralizedNewtypeDeriving #-} instead of {-# OPTIONS -fglasgow-exts | #-}, to just enable the needed extension, although only GHC implements | it currently.... Or, you can explicitly write out each instance in the | very straightforward way, which is portable (though a bit annoying and | inefficient). Or, I think there are tools that can automatically write | such instances for you? | | | > [...] | > At that time I could either have my own simplifier and | > approximator, or I could link to other tools (maple, gnu something?). | > | > The idea was stalled, because I only use this for toy problems ;) If | > someone feels inspired, feel free to take this module and rework. I'm | > also open for suggestions on how to do this myself in case I ever | > un-stall this ;) | | That is *a lot* more complicated. Beware of non-termination. I don't | think every equality, every exactness, is observable (not sure whether | a | Num type like that offers the full power of the real numbers - if it | does, then you have a turing-complete problem.) | | Whereas, the present inexactness means that the numerator and | denominator don't tend to get so big that the computations are really | slow. (If MPFR could be used in Haskell, one could choose the desired | precision rather than using whatever Double gives, I suppose) | | Making the type be "data" with fields Rational as well as whether it's | exact, could be done (though I'm not entirely satisfied with, nor | interested in, the "exact" concept, so it's just an idea). Then you | would not be able to use generalized newtype deriving, so you wouldn't | ^_^ | | Isaac | _______________________________________________ | Haskell mailing list | Haskell@haskell.org | http://www.haskell.org/mailman/listinfo/haskell From ashley at semantic.org Sat Sep 15 16:38:55 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Sat Sep 15 16:40:40 2007 Subject: [Haskell] Blocked STM & GC question Message-ID: If I have a thread that's blocked on an STM retry or TChan read, and none of its TVars are referenced elsewhere, will it get stopped and garbage-collected? I have in mind a pump thread that eternally reads off a TChan and pushes the result to some function. If the TChan is forgotten elsewhere, will the permanently blocked thread still sit around using up some small amount of memory, or will it be reaped by the garbage collector? -- Ashley Yakeley Seattle WA From nr at eecs.harvard.edu Sat Sep 15 16:50:57 2007 From: nr at eecs.harvard.edu (Norman Ramsey) Date: Sat Sep 15 16:50:53 2007 Subject: [Haskell] question about a failure to generalize Message-ID: <20070915205057.B5B086784F7@toller> Dear Haskellers, I've had a Haskell program rejected for reasons I don't understand. Here's the relevant bit of code; the problem is that I expected the type-inference engine to generalize the abbreviation 'fold' to an overloaded function, but it doesn't---to make the code work, I had to expand 'fold' into 'foldRegsUsed' everywhere it appears. I'm baffled because 'fold' isn't mutually recursive with anything, so I would have expected ordinary Hindley-Milner style inference to generalize it to something of the type UserOfLocalRegs a => (b -> LocalReg -> b) -> b -> a -> b But that's not what happens. This code fails to compile because the compiler is willing to use 'fold' at only one type (CmmExpr as it happens): class UserOfLocalRegs a where foldRegsUsed :: (b -> LocalReg -> b) -> b -> a -> b instance UserOfLocalRegs Middle where foldRegsUsed f z m = middle m where middle (MidComment {}) = z middle (MidAssign _lhs expr) = fold f z expr middle (MidStore addr rval) = fold f (fold f z addr) rval middle (MidUnsafeCall tgt _ress args) = fold f (fold f z tgt) args middle (CopyIn _ _formals _) = z middle (CopyOut _ actuals) = fold f z actuals fold = foldRegsUsed What rule of the language have I overlooked? Norman From xj2106 at columbia.edu Sun Sep 16 01:22:03 2007 From: xj2106 at columbia.edu (Xiao-Yong Jin) Date: Sun Sep 16 01:23:35 2007 Subject: [Haskell] Linear Equation Solver Using Arrays Message-ID: <87sl5f6v7o.fsf@presario.homelinux.org> Dear Haskellers, My thanks to people on the irc channel, especially `int-e'. With their help, I managed to write a linear equation solver using STUArrays. -------------- next part -------------- A non-text attachment was scrubbed... Name: MatrixOp.hs.gz Type: application/octet-stream Size: 1379 bytes Desc: MatrixOp, only contains a linear solver, yet Url : http://www.haskell.org/pipermail/haskell/attachments/20070916/fc035081/MatrixOp.hs.obj -------------- next part -------------- It is basically a direct rewrite of a C version, which adopts Crout's LU decomposition method with implicit pivoting, in chapter 2.3 of the book Numerical Recipes. I must admit that the code is in a really bad style, somewhat ugly, because of the limit of my Haskell knowledge. The code is attached in this email for your amusement. I would be really thankful if you can give me any kind of comments, idea, improvement, criticism, because I sincerely want to make the code better. Best regards, Xiao-Yong -- c/* __o/* <\ * (__ */\ < From haskell_db at yahoo.de Sun Sep 16 08:22:17 2007 From: haskell_db at yahoo.de (klaus meier) Date: Sun Sep 16 08:22:15 2007 Subject: [Haskell] HaL2: Meeting Haskell in Leipzig 2, videos and presentations online Message-ID: <5A61B670-D610-438D-B466-0DC835476B49@yahoo.de> Hello haskell friends! The Videos and presentations of the talks given at HaL2 are now online: http://iba-cg.de/haskell.html Meeting HaL2, Leipzig Germany 10th of July Talks: (first in english, remaining in german) 1 Johan Jeuring (Uni Uetrecht) talks about "Generic Programming in Haskell" 2 Wolfgang Jeltsch (TU Cottbus) talks about "Grapefruit, a Haskell- library for the declarative description of graphic user interfaces" 3 Henning Thielemann (Uni Halle) talks about "Calculation of sound in Haskell" 4 Leif Frenzel (Karlsruhe) introduced Cohatoe: "Writing eclipse- plugins in haskell" We hope to see you on the next HaL meeting in the first quarter of 2008. Greetings, Alf Richter From mads_lindstroem at yahoo.dk Sun Sep 16 10:52:00 2007 From: mads_lindstroem at yahoo.dk (Mads =?ISO-8859-1?Q?Lindstr=F8m?=) Date: Sun Sep 16 10:53:54 2007 Subject: [Haskell] Swapping parameters and type classes Message-ID: <1189954320.13339.15.camel@localhost.localdomain> Hi all If I have this type: data Foo a b = ... and this class class Bar (x :: * -> *) where ... I can imagine two ways to make Foo an instance of Bar. Either I must "apply" the 'a' or the 'b' in (Foo a b). Otherwise it will not have the right kind. To "apply" the 'a' I can do: instance Bar (Foo a) where ... But what if I want to "apply" the 'b' ? How do I do that ? Greetings, Mads Lindstr?m From b.hilken at ntlworld.com Sun Sep 16 13:10:37 2007 From: b.hilken at ntlworld.com (Barney Hilken) Date: Sun Sep 16 13:10:33 2007 Subject: [Haskell] Records Message-ID: Now that I have a version of ghc with type classes, I have had a go at implementing records based on the ideas I mentioned on this list a few months ago. The code of my first attempt is available at http:// homepage.ntlworld.com/b.hilken/files/Records.hs I am releasing this to get feedback. I think Haskell needs a records system of this kind of generality, and this code at least allows you to play around. From the comment section of the file: ----------------------- Record construction: EmptyRec is the empty record. N =: x is the record with one field labelled N carrying data x. t +: u is the union of records t and u. Any overlap of labels gives a static error. Record destruction: t .: N is the value of field N in record t. A lack of field N gives a static error. t -: N is record t with field N deleted. A lack of field N gives a static error. Record update: t |: u is the record with fields from u where it has them, t otherwise. If u has any fields not in t, or of different types from t, there is a static error. Note that the result has the same type as t. All these records have types: EmptyRec is the type of the empty record. N :=: a is the type of a record with one field labelled N carrying data of type a. r :+: s is the union of record types r and s. Any overlap of labels gives a static error. r :.: N is the type of field N in a record of type r. A lack of field N gives a static error. r :-: N is record type r with field N deleted. A lack of field N gives a static error. Finally some classes to govern the polymorphism: r `Contains` N means that r is a record type with a field labelled N. r `Disjoint` s means that r and s are record types with no fields in common. r `Subrecord` s means that r and s are record types, and every field of r also occurs in s (with the same type). The types of the basic operators are as follows: (=:) :: n -> a -> n :=: a (+:) :: r `Disjoint` s => r -> s -> r :+: s (.:) :: r `Contains` n => r -> n -> r :.: n (-:) :: r `Contains` n => r -> n -> r :-: n (|:) :: r `Subrecord` s => s -> r -> s ---------------------------------- Note that these records are a lot more expressive than the Hugs system, as you can not only extend records by adding fields, but also take unions of arbitrary (disjoint) records. Record update is designed for functions with lots of named optional arguments. If you define f opts = ... options.:Optj ... where options = (Opt1 =: val1 +: ... +: Optn =: valn) |: opts then the user can write (for example): f (Optk =: u +: Optl =: v) to set just two of the options, leaving the rest as default. This also cannot be done in the Hugs system. The main disadvantage of the current implementation is that you have to tell the compiler in which order to store the fields, by defining one of the following: type instance NameCmp N M = NameLT type instance NameCmp N N = NameEQ type instance NameCmp N M = NameGT for each pair of labels N & M in such a way as to give a linear order on labels. You need n^2 definitions, where n is the number of labels. I would do this in Template Haskell, but it won't yet allow you to declare type instances. Maybe some compiler support? Error messages tend to be cryptic. They mostly complain of missing instances, and can run to several pages. There is really no way to improve this without building it all in to the compiler! All comments gratefully received, including suggestions on syntax, choice of operators, implementation, explanation, etc. Barney. From g9ks157k at acme.softbase.org Sun Sep 16 15:32:08 2007 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Sun Sep 16 15:32:04 2007 Subject: [Haskell] HaL2: Meeting Haskell in Leipzig 2, videos and presentations online In-Reply-To: <5A61B670-D610-438D-B466-0DC835476B49@yahoo.de> References: <5A61B670-D610-438D-B466-0DC835476B49@yahoo.de> Message-ID: <200709162132.08855.g9ks157k@acme.softbase.org> Am Sonntag, 16. September 2007 14:22 schrieb klaus meier: > Hello haskell friends! > > The Videos and presentations of the talks given at HaL2 are now online: > [?] > 2 Wolfgang Jeltsch (TU Cottbus) talks about "Grapefruit, a Haskell- > library for the declarative description of graphic user interfaces" I?d like to add that this video doesn?t cover the complete talk but only the first five minutes. :-( Alf, could you please make sure that this gets corrected? Thanks a lot! > [?] Best wishes, Wolfgang From byorgey at gmail.com Sun Sep 16 16:38:50 2007 From: byorgey at gmail.com (Brent Yorgey) Date: Sun Sep 16 16:38:44 2007 Subject: [Haskell] Swapping parameters and type classes In-Reply-To: <1189954320.13339.15.camel@localhost.localdomain> References: <1189954320.13339.15.camel@localhost.localdomain> Message-ID: <22fcbd520709161338y18e4b254gfe468cd8dc7ee3f4@mail.gmail.com> On 9/16/07, Mads Lindstr?m wrote: > > Hi all > > If I have this type: > > data Foo a b = ... > > and this class > > class Bar (x :: * -> *) where ... > > I can imagine two ways to make Foo an instance of Bar. Either I must > "apply" the 'a' or the 'b' in (Foo a b). Otherwise it will not have the > right kind. To "apply" the 'a' I can do: > > instance Bar (Foo a) where ... > > But what if I want to "apply" the 'b' ? How do I do that ? One easy way would be to create a newtype with the type parameters swapped: newtype Oof b a = Oof (Foo a b) instance Bar (Oof b) where ... Of course, if you want to partially apply the second parameter of a function, you use 'flip'. I thought for a while about whether there's some sort of typeclass hackery which is directly parallel to the use of 'flip', but couldn't come up with anything. Anyone? -Brent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell/attachments/20070916/13b08da6/attachment.htm From v.dijk.bas at gmail.com Sun Sep 16 16:45:39 2007 From: v.dijk.bas at gmail.com (Bas van Dijk) Date: Sun Sep 16 16:45:27 2007 Subject: [Haskell] Swapping parameters and type classes In-Reply-To: <1189954320.13339.15.camel@localhost.localdomain> References: <1189954320.13339.15.camel@localhost.localdomain> Message-ID: On 9/16/07, Mads Lindstr?m wrote: > But what if I want to "apply" the 'b' ? How do I do that ? The following uses type families (functions) and compiles under GHC HEAD: {-# OPTIONS_GHC -XTypeFamilies -XEmptyDataDecls -XTypeSynonymInstances #-} data Foo a b class Bar (x :: * -> *) instance Bar (Foo a) type family BarB a b :: * -> * type instance BarB a b = Foo b instance Bar (BarB a b) regards, Bas van Dijk From v.dijk.bas at gmail.com Sun Sep 16 16:50:31 2007 From: v.dijk.bas at gmail.com (Bas van Dijk) Date: Sun Sep 16 16:50:19 2007 Subject: [Haskell] Swapping parameters and type classes In-Reply-To: References: <1189954320.13339.15.camel@localhost.localdomain> Message-ID: On 9/16/07, Bas van Dijk wrote: > The following uses type families (functions) and compiles under GHC HEAD: > ... Oops this is not correct! Its getting late... oh well Bas From stefanor at cox.net Sun Sep 16 16:59:02 2007 From: stefanor at cox.net (Stefan O'Rear) Date: Sun Sep 16 16:58:52 2007 Subject: [Haskell] Swapping parameters and type classes In-Reply-To: References: <1189954320.13339.15.camel@localhost.localdomain> Message-ID: <20070916205902.GA3642@localhost.localdomain> On Sun, Sep 16, 2007 at 10:45:39PM +0200, Bas van Dijk wrote: > On 9/16/07, Mads Lindstr?m wrote: > > But what if I want to "apply" the 'b' ? How do I do that ? > > The following uses type families (functions) and compiles under GHC HEAD: > > {-# OPTIONS_GHC -XTypeFamilies -XEmptyDataDecls -XTypeSynonymInstances #-} Eek! That should be: {-# LANGUAGE TypeFamilies, EmptyDataDecls, TypeSynonymInstances #-} Modulo the fact that only GHC support type families at the moment, the latter will be portable... (Ian/Simon: I've seen this several times now. Maybe there should be a warning for -X in OPTIONS? Is that even feasable?) Stefan -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://www.haskell.org/pipermail/haskell/attachments/20070916/9a61901a/attachment.bin From tom at pledger.gen.nz Mon Sep 17 00:15:10 2007 From: tom at pledger.gen.nz (Tom Pledger) Date: Mon Sep 17 00:15:00 2007 Subject: [Haskell] question about a failure to generalize Message-ID: <20070917161510.u5bjb4j6yo0oc8oo@webmail.pledger.gen.nz> Norman Ramsey wrote: : | This code fails to compile because the compiler is willing to | use 'fold' at only one type (CmmExpr as it happens) : When it failed to compile, was fold = foldRegsUsed a top-level declaration in the module, rather than local to foldRegsUsed? If so, try working around the monomorphism restriction by changing from a pattern binding to a function binding. fold f = foldRegsUsed f Regards, Tom From stefanor at cox.net Mon Sep 17 00:47:10 2007 From: stefanor at cox.net (Stefan O'Rear) Date: Mon Sep 17 00:47:00 2007 Subject: [Haskell] question about a failure to generalize In-Reply-To: <20070917161510.u5bjb4j6yo0oc8oo@webmail.pledger.gen.nz> References: <20070917161510.u5bjb4j6yo0oc8oo@webmail.pledger.gen.nz> Message-ID: <20070917044710.GA4222@localhost.localdomain> On Mon, Sep 17, 2007 at 04:15:10PM +1200, Tom Pledger wrote: > Norman Ramsey wrote: > : > | This code fails to compile because the compiler is willing to > | use 'fold' at only one type (CmmExpr as it happens) > : > > When it failed to compile, was > > fold = foldRegsUsed > > a top-level declaration in the module, rather than local to foldRegsUsed? > > If so, try working around the monomorphism restriction by changing from a > pattern binding to a function binding. > > fold f = foldRegsUsed f The monomorphism restriction is not affected by top-level-or-not, see sections 4.5.1 and 4.5.5 in the Haskell 98 Language and Libraries Report. Stefan -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://www.haskell.org/pipermail/haskell/attachments/20070916/d957dc89/attachment.bin From tom at pledger.gen.nz Mon Sep 17 01:07:59 2007 From: tom at pledger.gen.nz (Tom Pledger) Date: Mon Sep 17 01:07:49 2007 Subject: [Haskell] question about a failure to generalize In-Reply-To: <20070917044710.GA4222@localhost.localdomain> References: <20070917161510.u5bjb4j6yo0oc8oo@webmail.pledger.gen.nz> <20070917044710.GA4222@localhost.localdomain> Message-ID: <20070917170759.ay0b9t33wg8w4wcs@webmail.pledger.gen.nz> Quoting Stefan O'Rear : > On Mon, Sep 17, 2007 at 04:15:10PM +1200, Tom Pledger wrote: >> Norman Ramsey wrote: >> : >> | This code fails to compile because the compiler is willing to >> | use 'fold' at only one type (CmmExpr as it happens) >> : >> >> When it failed to compile, was >> >> fold = foldRegsUsed >> >> a top-level declaration in the module, rather than local to foldRegsUsed? >> >> If so, try working around the monomorphism restriction by changing from a >> pattern binding to a function binding. >> >> fold f = foldRegsUsed f > > The monomorphism restriction is not affected by top-level-or-not, see > sections 4.5.1 and 4.5.5 in the Haskell 98 Language and Libraries > Report. > > Stefan Aargh! Sorry, I'm having a Bad Details Day. 3 in 1 message: - Overlooking the "to make the code work, I had to expand 'fold' into 'foldRegsUsed' everywhere it appears" part in the original question, - Chopping a letter out of Norman's email address, and - Mixing up the MR with other issues, possibly something from the binding groups section of Typing Haskell In Haskell. The one saving grace is that I tested my suggestion before posting, and it worked. :-) - Tom From demis at dimi.uniud.it Mon Sep 17 06:14:09 2007 From: demis at dimi.uniud.it (Demis) Date: Mon Sep 17 06:14:49 2007 Subject: [Haskell] 1st CFP: 3rd Int'l Workshop on Automated Specification and Verification of Web Systems (WWV'07) Message-ID: <178E14D7-3AE5-469C-B977-F663DA0D375F@dimi.uniud.it> [ We apologize for multiple copies ] *********************************************************************** 1st Call for Papers 3rd International Workshop on Automated Specification and Verification of Web Systems (WWV'07) San Servolo island, Venice (Italy) December 14, 2007 http://wwv07.dimi.uniud.it/ IMPORTANT DATES Abstract Submission October 14, 2007 Full Paper Submission October 21, 2007 Acceptance Notification November 12, 2007 Camera Ready November 23, 2007 Workshop December 14, 2007 SCOPE The increased complexity of Web sites and the explosive growth of Web-based applications has turned their design and construction into a challenging problem. Nowadays, many companies have diverted their Web sites into interactive, completely-automated, Web-based applications (such as Amazon, on-line banking, or travel agencies) with a high complexity that requires appropriate specification and verification techniques and tools. Systematic, formal approaches to the analysis and verification can address the problems of this particular domain with automated and reliable tools that also incorporate semantic aspects. We solicit original papers on formal methods and techniques applied to Web sites, Web services or Web-based applications, such as: * rule-based approaches to Web site analysis, certification, specification, verification, and optimization * formal models for describing and reasoning about Web sites * model-checking, synthesis and debugging of Web sites * abstract interpretation and program transformation applied to the semantic Web * intelligent tutoring and advisory systems for Web specifications authoring * Web quality and Web metrics * Web usability and accessibility * Testing and evaluation of Web systems and applications The WWV series provides a forum for researchers from the communities of Rule-based programming, Automated Software Engineering, and Web-oriented research to facilitate the cross-fertilization and the advancement of hybrid methods that combine the three areas. LOCATION WWV'07 will be held in December in the convention centre of the island of San Servolo, Venice, Italy. SUBMISSION PROCEDURE Submissions must be received by October 21, 2007. In addition, an ASCII version of the title and abstract must have been submitted by October 14, 2007. Submitted papers should be at most 15 pages in the Electronic Notes in Theoretical Computer Science (ENTCS) style, and should include an abstract and the author's information. See the author's instructions of ENTCS style at http://www.entcs.org. PUBLICATION Accepted papers will be published in a preliminary proceedings volume, which will be available during the workshop. Publication of the workshop post-proceedings in the Elsevier series Electronic Notes in Theoretical Computer Science (ENTCS, ISSN: 1571-0661) is envisaged. INVITED SPEAKERS Paolo Traverso ITC-IRST, Italy Joost Visser Software Improvement Group, The Netherlands PROGRAM CO-CHAIRS Santiago Escobar Technical University of Valencia, Spain Massimo Marchiori University of Padova, Italy WORKSHOP CHAIR Demis Ballis University of Udine, Italy PROGRAM COMMITTEE (in progress) Jesus Almendros University of Almeria, Spain Maria Alpuente Technical University of Valencia, Spain Demis Ballis University of Udine, Italy Gilles Barthe INRIA Sophia-Antipolis, France Tevfik Bultan University of California, Santa Barbara, USA Santiago Escobar Technical University of Valencia, Spain Moreno Falaschi University of Siena, Italy Nora Koch Ludwig Maximilians Universit?t M?nchen, Germany Temur Kutsia RISC, Linz, Austria Massimo Marchiori University of Padova, Italy Tiziana Margaria University of Potsdam, Germany Sebastian Schaffert Salzburg Research, Austria From igloo at earth.li Mon Sep 17 06:18:45 2007 From: igloo at earth.li (Ian Lynagh) Date: Mon Sep 17 06:18:39 2007 Subject: [Haskell] Swapping parameters and type classes In-Reply-To: <20070916205902.GA3642@localhost.localdomain> References: <1189954320.13339.15.camel@localhost.localdomain> <20070916205902.GA3642@localhost.localdomain> Message-ID: <20070917101845.GA22250@matrix.chaos.earth.li> On Sun, Sep 16, 2007 at 01:59:02PM -0700, Stefan O'Rear wrote: > > > > {-# OPTIONS_GHC -XTypeFamilies -XEmptyDataDecls -XTypeSynonymInstances #-} > > {-# LANGUAGE TypeFamilies, EmptyDataDecls, TypeSynonymInstances #-} > > (Ian/Simon: I've seen this several times now. Maybe there should be a > warning for -X in OPTIONS? Is that even feasable?) Currently we can't even give a warning when completely deprecated flags are used, but when fixing that I think we should also do as you suggest. Thanks Ian From simonmarhaskell at gmail.com Mon Sep 17 08:11:47 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Mon Sep 17 08:11:41 2007 Subject: [Haskell] Blocked STM & GC question In-Reply-To: References: Message-ID: <46EE6F03.1000407@gmail.com> Ashley Yakeley wrote: > If I have a thread that's blocked on an STM retry or TChan read, and > none of its TVars are referenced elsewhere, will it get stopped and > garbage-collected? > > I have in mind a pump thread that eternally reads off a TChan and pushes > the result to some function. If the TChan is forgotten elsewhere, will > the permanently blocked thread still sit around using up some small > amount of memory, or will it be reaped by the garbage collector? In this case, your thread should receive the BlockedIndefinitely exception: http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#v%3ABlockedIndefinitely If the system is idle for a certain amount of time (default 0.3s, change it with the +RTS -I option) a full GC is triggered, which will detect any threads that are blocked on unreachable objects, and arrange to send them the BlockedIndefinitely exception. Cheers, Simon From nr at eecs.harvard.edu Mon Sep 17 13:19:20 2007 From: nr at eecs.harvard.edu (Norman Ramsey) Date: Mon Sep 17 13:19:05 2007 Subject: [Haskell] question about a failure to generalize In-Reply-To: <20070917161510.u5bjb4j6yo0oc8oo@webmail.pledger.gen.nz> (sfid-H20070917-001529-+033.15-1@spamfilter.osbf.lua) References: <20070917161510.u5bjb4j6yo0oc8oo@webmail.pledger.gen.nz> (sfid-H20070917-001529-+033.15-1@spamfilter.osbf.lua) Message-ID: <20070917171920.43F967883DF@labrador.eecs.harvard.edu> > If so, try working around the monomorphism restriction by changing > from a pattern binding to a function binding. > > fold f = foldRegsUsed f Brilliant. I hadn't known about the monomorphism restriction. Now I know it's a 'necessary evil'. Thanks! Norman From mads_lindstroem at yahoo.dk Mon Sep 17 13:35:47 2007 From: mads_lindstroem at yahoo.dk (Mads =?ISO-8859-1?Q?Lindstr=F8m?=) Date: Mon Sep 17 13:37:45 2007 Subject: [Haskell] Swapping parameters and type classes In-Reply-To: References: <1189954320.13339.15.camel@localhost.localdomain> Message-ID: <1190050547.3995.18.camel@localhost.localdomain> Hi Bas Thank you for the answer. I tried to "fill in some blanks" in the example you gave. And mostly got a lot of context reduction stack overflows :( Here is my example (a little closer to what I actually need): data Foo a b = Foo { first :: a, second :: b } class Bar (x :: * -> *) where foo :: x a -> a instance Bar (Foo a) where foo x = second x type family BarB a b :: * -> * type instance BarB a b = Foo b instance Bar (BarB a b) where foo x = second x -- this unexpectedly works! -- foo x = first x -- This unexpectedly gives context reduction stack overflow What surprises me is that I still need to look at `second`, even though I use BarB. I thought I was swapping the parameters. Whats more changing the line: type instance BarB a b = Foo b to type instance BarB a b = Foo a -- the last letter changed has no effect. Greetings, Mads Lindstr?m P.s. Why can we not just have the option of being explicit about which type parameters are applied? Something like: "instance Bar (apply a. Foo a b)" which would apply a and be identical to "instance Bar (Foo a)" "instance Bar (apply b. Foo a b)" which would apply b and be what I am trying to achieve. It would seem a lot more natural to me. But maybe there are other reasons why type families are a better solution? I do not know if I use the right terminology when saying "apply". Please correct if there is more correct terms. Bas van Dijk: > On 9/16/07, Mads Lindstr?m wrote: > > But what if I want to "apply" the 'b' ? How do I do that ? > > The following uses type families (functions) and compiles under GHC HEAD: > > {-# OPTIONS_GHC -XTypeFamilies -XEmptyDataDecls -XTypeSynonymInstances #-} > > data Foo a b > > class Bar (x :: * -> *) > > instance Bar (Foo a) > > type family BarB a b :: * -> * > type instance BarB a b = Foo b > > instance Bar (BarB a b) > > > regards, > > Bas van Dijk From v.dijk.bas at gmail.com Mon Sep 17 15:17:14 2007 From: v.dijk.bas at gmail.com (Bas van Dijk) Date: Mon Sep 17 15:17:00 2007 Subject: [Haskell] Swapping parameters and type classes In-Reply-To: <1190050547.3995.18.camel@localhost.localdomain> References: <1189954320.13339.15.camel@localhost.localdomain> <1190050547.3995.18.camel@localhost.localdomain> Message-ID: On 9/17/07, Mads Lindstr?m wrote: > Hi Bas > > Thank you for the answer. > > I tried to "fill in some blanks" in the example you gave. And mostly got > a lot of context reduction stack overflows :( > > Here is my example (a little closer to what I actually need): > > data Foo a b = Foo { first :: a, second :: b } > > class Bar (x :: * -> *) where > foo :: x a -> a > > instance Bar (Foo a) where > foo x = second x > > type family BarB a b :: * -> * > type instance BarB a b = Foo b > > instance Bar (BarB a b) where > foo x = second x -- this unexpectedly works! > -- foo x = first x -- This unexpectedly gives context reduction stack overflow > > What surprises me is that I still need to look at `second`, even though > I use BarB. I thought I was swapping the parameters. Whats more changing > the line: > > type instance BarB a b = Foo b > > to > > type instance BarB a b = Foo a -- the last letter changed > > has no effect. > > > Greetings, > > Mads Lindstr?m > > P.s. Why can we not just have the option of being explicit about which type parameters are applied? Something like: > > "instance Bar (apply a. Foo a b)" which would apply a and be identical to "instance Bar (Foo a)" > "instance Bar (apply b. Foo a b)" which would apply b and be what I am trying to achieve. > > It would seem a lot more natural to me. But maybe there are other reasons why type families are a better solution? > > I do not know if I use the right terminology when saying "apply". Please correct if there is more correct terms. > > > Bas van Dijk: > > On 9/16/07, Mads Lindstr?m wrote: > > > But what if I want to "apply" the 'b' ? How do I do that ? > > > > The following uses type families (functions) and compiles under GHC HEAD: > > > > {-# OPTIONS_GHC -XTypeFamilies -XEmptyDataDecls -XTypeSynonymInstances #-} > > > > data Foo a b > > > > class Bar (x :: * -> *) > > > > instance Bar (Foo a) > > > > type family BarB a b :: * -> * > > type instance BarB a b = Foo b > > > > instance Bar (BarB a b) > > > > > > regards, > > > > Bas van Dijk > > Mads, my sollution was not correct. This is why: instance Bar (BarB a b) is equal to: instance Bar (Foo b) which is just equal to: instance Bar (Foo a) The 'b' in 'instance Bar (Foo b)' has nothing to do with the 'b' in 'Foo a b'. In fact the 'b' in 'BarB a b' is equal to the 'a' in 'Foo a b'. Sorry that I bothered you with this but like I said, it was late and I already consumed some wine. Not a good combination when programming ;-) Bas. From jgoerzen at complete.org Mon Sep 17 15:29:46 2007 From: jgoerzen at complete.org (John Goerzen) Date: Mon Sep 17 15:29:37 2007 Subject: [Haskell] ANN: ListLike, a generic interface over list-like structures Message-ID: <20070917192946.GA27554@complete.org> Hi, I'm pleased to announce the first release of ListLike, a generic interface to the various list-like structures in Haskell. This grew out of the annoyance at having to handle Strings and ByteStrings differently in my code, and has expanded on well past there. ListLike implements an API very similar to Data.List, but based on a typeclass. The module ships with instance definitions for lists, ByteStrings, lazy ByteStrings, Arrays, and even Maps. Additional classes are available for types that implement some additional features: String-like behavior, infinite list capability, and I/O. Finally, an extensive set of default functions is provided. Only minimal effort -- as little as four functions -- are needed to make your list-like type an instance of ListLike. ListLike is backed by an extensive suite of QuickCheck tests wrapped in HUnit, which tests virtually every function against every type. As of right now, 1567 test cases are executed, and all pass. Homepage: http://software.complete.org/listlike/ Download from: http://software.complete.org/listlike/downloads API ref: http://software.complete.org/listlike/static/doc/ Hackage page: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ListLike-1.0.0 -- John From westondan at imageworks.com Mon Sep 17 16:25:25 2007 From: westondan at imageworks.com (Dan Weston) Date: Mon Sep 17 16:29:52 2007 Subject: [Haskell] ANN: ListLike, a generic interface over list-like structures In-Reply-To: <20070917192946.GA27554@complete.org> References: <20070917192946.GA27554@complete.org> Message-ID: <46EEE2B5.9050909@imageworks.com> I noticed that there is no Data.Foldable context to your FoldableLL class. How does your ListLike API work with/compare to/derive from the classes in Data.Traversable? http://darcs.haskell.org/ghc-6.6/packages/base/Data/Traversable.hs Dan Weston John Goerzen wrote: > Hi, > > I'm pleased to announce the first release of ListLike, a generic > interface to the various list-like structures in Haskell. > > This grew out of the annoyance at having to handle Strings and > ByteStrings differently in my code, and has expanded on well past there. > > ListLike implements an API very similar to Data.List, but based on a > typeclass. The module ships with instance definitions for lists, > ByteStrings, lazy ByteStrings, Arrays, and even Maps. > > Additional classes are available for types that implement some > additional features: String-like behavior, infinite list capability, and > I/O. > > Finally, an extensive set of default functions is provided. Only > minimal effort -- as little as four functions -- are needed to make your > list-like type an instance of ListLike. > > ListLike is backed by an extensive suite of QuickCheck tests wrapped in HUnit, > which tests virtually every function against every type. As of right > now, 1567 test cases are executed, and all pass. > > Homepage: > http://software.complete.org/listlike/ > > Download from: > http://software.complete.org/listlike/downloads > > API ref: > http://software.complete.org/listlike/static/doc/ > > Hackage page: > http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ListLike-1.0.0 > > -- John > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > > From jgoerzen at complete.org Mon Sep 17 17:19:19 2007 From: jgoerzen at complete.org (John Goerzen) Date: Mon Sep 17 18:08:10 2007 Subject: [Haskell] Re: ANN: ListLike, a generic interface over list-like structures References: <20070917192946.GA27554@complete.org> <46EEE2B5.9050909@imageworks.com> Message-ID: On 2007-09-17, Dan Weston wrote: > I noticed that there is no Data.Foldable context to your FoldableLL > class. How does your ListLike API work with/compare to/derive from the At one point, I had declared that every instance of Data.Foldable to be an instance of FoldableLL. However, I had trouble making Data.Map into a Foldable instance in this way, because the standard library defines it to already be a Foldable instance. If memory serves, when I read the source for Data.Foldable, the "elements" if a Map were the keys only, while the Data.Map instance for ListLike (and FoldableLL) treats the "elements" as (key, value) pairs. Since that incorrect (for this application) instance of Data.Map was already in Data.Foldable, using Data.Foldable for this purpose was impossible. However, for some specific types, the FoldableLL instance may reuse Data.Foldable code if the implementor wants it. FoldableLL is very similar to Foldable, except it is essentially: class FoldableLL full item | full -> item where while Foldable is class FoldableLL full > classes in Data.Traversable? I believe it was the same problem. The functions exported by the ListLike module are a superset of Foldable. I also provide mapM and sequence in ListLike, which I think ought to do most of what Traversable does. I think there was also a "kind" problem with both. ListLike is to be useful for any type where there is a distinct container type and a distinct element type. For instance, you may have: instance ListLike [a] a where instance ListLike (Data.Map k v) (k, v) where I know it is possible to solve that, and in fact if you look at the history of my tree, you'll see where I had the Foldable instance... but with the Map problem, it just didn't seem worth it (or possible). That does show one annoying property of typeclasses: instances too easily appear and are impossible to replace. -- John From v.dijk.bas at gmail.com Mon Sep 17 19:14:57 2007 From: v.dijk.bas at gmail.com (Bas van Dijk) Date: Mon Sep 17 19:14:41 2007 Subject: [Haskell] Re: ANN: ListLike, a generic interface over list-like structures In-Reply-To: References: <20070917192946.GA27554@complete.org> <46EEE2B5.9050909@imageworks.com> Message-ID: On 9/17/07, John Goerzen wrote: > That does show one annoying property of typeclasses: instances too > easily appear and are impossible to replace. The problem would be solved if it was possible to explicitly import and export instance declarations. I asked this before [1] but I actually almost never had the need for it. But then I'm not a library writer... It would be nice to know how serious this problem is. Are there other people that have had a similar problem? Thanks, Bas [1] http://www.haskell.org/pipermail/haskell-prime/2006-November/001843.html From iavor.diatchki at gmail.com Mon Sep 17 21:45:26 2007 From: iavor.diatchki at gmail.com (Iavor Diatchki) Date: Mon Sep 17 21:45:12 2007 Subject: [Haskell] ANN: monadLib 3.3.0 released Message-ID: <5ab17e790709171845p55e66087s59ccd24a037b0026@mail.gmail.com> Hello, I have put up a new version of monadLib, which is available from hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/monadLib-3.3.0 The changes in this version are fairly small: * added an identity transformer, which is useful as a placeholder in some applications, * removed the RunStateM class because it does not seem to add extra functionality, * added a family of deriving functions that can be used to implement many monadLib functions for user-defined monads (e.g., monads defined via a newtype declaration). As usual, comments, bug-reports, and feedback are most welcome! -Iavor From jgoerzen at complete.org Mon Sep 17 22:16:16 2007 From: jgoerzen at complete.org (John Goerzen) Date: Mon Sep 17 22:16:09 2007 Subject: [Haskell] Re: ANN: ListLike, a generic interface over list-like structures In-Reply-To: References: <20070917192946.GA27554@complete.org> Message-ID: <200709172116.16117.jgoerzen@complete.org> On Monday 17 September 2007 6:14:57 pm Bas van Dijk wrote: > On 9/17/07, John Goerzen wrote: > > That does show one annoying property of typeclasses: instances too > > easily appear and are impossible to replace. > > The problem would be solved if it was possible to explicitly import > and export instance declarations. > > I asked this before [1] but I actually almost never had the need for > it. But then I'm not a library writer... > > It would be nice to know how serious this problem is. Are there other > people that have had a similar problem? I have also been annoyed by this with instances of Read and Show. In several situations, I preferred to have my own formatter or parser, and it would have been most convenient to do so as a different instance of Read or Show. However, I would not say that it has ever been a serious problem. Workarounds exist, such as creating new typeclasses or simply using dedicated functions. It would be nice if there were some syntax where you could say something along the lines of instance (Show a, a /= Integer) => MyShow a where myshow = show instance MyShow Integer where myshow = customshow for example. -- John From simonpj at microsoft.com Tue Sep 18 02:32:22 2007 From: simonpj at microsoft.com (Simon Peyton-Jones) Date: Tue Sep 18 02:31:37 2007 Subject: [Haskell] Swapping parameters and type classes In-Reply-To: References: <1189954320.13339.15.camel@localhost.localdomain> <1190050547.3995.18.camel@localhost.localdomain> Message-ID: This thread is certainly interesting, but it would be better on Haskell-caf?@haskell.org. The Haskell@haskell.org list is intended as a low-bandwidth list for announcements and the like. Thanks! Simon | -----Original Message----- | From: haskell-bounces@haskell.org [mailto:haskell-bounces@haskell.org] | On Behalf Of Bas van Dijk | Sent: 17 September 2007 20:17 | To: Mads Lindstr?m | Cc: haskell@haskell.org | Subject: Re: [Haskell] Swapping parameters and type classes | | On 9/17/07, Mads Lindstr?m wrote: | > Hi Bas | > | > Thank you for the answer. | > | > I tried to "fill in some blanks" in the example you gave. And mostly | got | > a lot of context reduction stack overflows :( | > | > Here is my example (a little closer to what I actually need): | > | > data Foo a b = Foo { first :: a, second :: b } | > | > class Bar (x :: * -> *) where | > foo :: x a -> a | > | > instance Bar (Foo a) where | > foo x = second x | > | > type family BarB a b :: * -> * | > type instance BarB a b = Foo b | > | > instance Bar (BarB a b) where | > foo x = second x -- this unexpectedly works! | > -- foo x = first x -- This unexpectedly gives context reduction | stack overflow | > | > What surprises me is that I still need to look at `second`, even | though | > I use BarB. I thought I was swapping the parameters. Whats more | changing | > the line: | > | > type instance BarB a b = Foo b | > | > to | > | > type instance BarB a b = Foo a -- the last letter changed | > | > has no effect. | > | > | > Greetings, | > | > Mads Lindstr?m | > | > P.s. Why can we not just have the option of being explicit about | which type parameters are applied? Something like: | > | > "instance Bar (apply a. Foo a b)" which would apply a and be | identical to "instance Bar (Foo a)" | > "instance Bar (apply b. Foo a b)" which would apply b and be what I | am trying to achieve. | > | > It would seem a lot more natural to me. But maybe there are other | reasons why type families are a better solution? | > | > I do not know if I use the right terminology when saying "apply". | Please correct if there is more correct terms. | > | > | > Bas van Dijk: | > > On 9/16/07, Mads Lindstr?m wrote: | > > > But what if I want to "apply" the 'b' ? How do I do that ? | > > | > > The following uses type families (functions) and compiles under GHC | HEAD: | > > | > > {-# OPTIONS_GHC -XTypeFamilies -XEmptyDataDecls - | XTypeSynonymInstances #-} | > > | > > data Foo a b | > > | > > class Bar (x :: * -> *) | > > | > > instance Bar (Foo a) | > > | > > type family BarB a b :: * -> * | > > type instance BarB a b = Foo b | > > | > > instance Bar (BarB a b) | > > | > > | > > regards, | > > | > > Bas van Dijk | > | > | | Mads, my sollution was not correct. | | This is why: | | instance Bar (BarB a b) | | is equal to: | | instance Bar (Foo b) | | which is just equal to: | | instance Bar (Foo a) | | The 'b' in 'instance Bar (Foo b)' has nothing to do with the 'b' in | 'Foo a b'. In fact the 'b' in 'BarB a b' is equal to the 'a' in 'Foo a | b'. | | Sorry that I bothered you with this but like I said, it was late and I | already consumed some wine. Not a good combination when programming | ;-) | | Bas. | _______________________________________________ | Haskell mailing list | Haskell@haskell.org | http://www.haskell.org/mailman/listinfo/haskell From himself at poczta.nom.pl Tue Sep 18 06:39:25 2007 From: himself at poczta.nom.pl (Andrzej Jaworski) Date: Tue Sep 18 05:38:31 2007 Subject: [Haskell] Swapping parameters and type classes Message-ID: <003001c7f9e0$36127bc0$5b66ce57@bzdryk> Well, the corridors are better known for the men in power:-) Why don't leave this entry as Reception for the uninitiated and move on to Announcements and ... Curiosity? Regards, -A.J. From imanolescu at gmail.com Tue Sep 18 08:39:07 2007 From: imanolescu at gmail.com (Ioana Manolescu) Date: Tue Sep 18 08:38:50 2007 Subject: [Haskell] PLAN-X 2008 second call for papers and demos In-Reply-To: <6ecc70ff0709180536t6fb2f4cbm618ebf049f6a3e3d@mail.gmail.com> References: <6ecc70ff0709180536t6fb2f4cbm618ebf049f6a3e3d@mail.gmail.com> Message-ID: <6ecc70ff0709180539m2f82f06aiaed5d67176c647c7@mail.gmail.com> (Apologies for cross-posting) Call for Papers and Demos ========================= PLAN-X 2008 --- Programming Language Techniques for XML ACM SIGPLAN Workshop colocated with POPL 2008 San Francisco, California, USA - 9 January 2008 http://gemo.futurs.inria.fr/events/PLANX2008/ *** *** New: Submission is now open! *** http://gemo.futurs.inria.fr/events/PLANX2008/myreview/ *** The PLAN-X 2008 workshop is the forum to present and discuss bleeding-edge research at the intersection of programming language and data base technology with an emphasis on tree-shaped data structures and their XML representation. Topics of interest are all aspects of XML processing and querying: theories, methodologies, paradigms, language designs, types, analyses, runtime aspects, implementations, tools, applications. This edition of PLAN-X is particularly interested in blending the XML processing approaches developed by the programming languages and data management communities. Expressive power and high performance are among the common goals that these communities pursue. We encourage the submission of crosscutting contributions that apply techniques from one community to problems from the other. The primary criteria for paper selection are originality, relevance, and timeliness to ensure that we can enjoy reports on ongoing and unfinished work with high potential in the workshop. Submissions =========== We seek submissions in two categories * regular papers (10 pages, 30 minutes presentation) * demo papers (4 pages, 10 minutes plenary presentation + 30 minutes slot for individual discussions shared with other demos) For details see the submission instructions on http://gemo.futurs.inria.fr/events/PLANX2008/?page=subm Important Dates =============== Submission deadline 15 October 2007 Notification 30 November 2007 Final papers due 14 December 2007 Program Committee ================= V?ronique Benzaken Universit? de Paris-Sud 11, France Alin Deutsch University of California, San Diego, USA Wenfei Fan University of Edinburgh, UK Mary Fernandez ATT Research, USA Haruo Hosoya University of Tokyo, Japan Ralf L?mmel Universit?t Koblenz, Germany Sebastian Maneth National ICT and UNSW, Sydney, Australia Jim Melton Oracle Corporation, USA Michael Schwartzbach University of Aarhus, Denmark J?r?me Vouillon CNRS, France Ioana Manolescu (general chair) Gemo group, INRIA Futurs, France Peter Thiemann (program chair) University of Freiburg, Germany From himself at poczta.nom.pl Tue Sep 18 10:48:06 2007 From: himself at poczta.nom.pl (Andrzej Jaworski) Date: Tue Sep 18 09:48:08 2007 Subject: [Haskell] Swapping parameters and type classes References: <003001c7f9e0$36127bc0$5b66ce57@bzdryk> Message-ID: <001a01c7fa03$0894e4d0$5b66ce57@bzdryk> Responding to Simon Peyton-Jones' reminder that this is a low-bandwidth list I was obscure and commited a blunder. This one and many other threads here are started undoubtedly by experts [sorry guys:-)] and coffee brake should work for them, but on numerous occasions threads here spawn beginner type questions. So, my thinking was that it is perhaps against the tide trying to stop them. Why not to make the list Haskell a first contact general practitioner? Then creating e.g. "Announcements & Challenge" or "Announcements & ask guru" list could take the best from "Haskell" but also would make it less front line and thus more elitist, which should imply the manner by itself. You could always cross-post but subscribe or answer to one. Cheers, -A.J. From igloo at earth.li Tue Sep 18 10:47:11 2007 From: igloo at earth.li (Ian Lynagh) Date: Tue Sep 18 10:46:56 2007 Subject: [Haskell] Swapping parameters and type classes In-Reply-To: <001a01c7fa03$0894e4d0$5b66ce57@bzdryk> References: <003001c7f9e0$36127bc0$5b66ce57@bzdryk> <001a01c7fa03$0894e4d0$5b66ce57@bzdryk> Message-ID: <20070918144711.GA24465@matrix.chaos.earth.li> On Tue, Sep 18, 2007 at 03:48:06PM +0100, Andrzej Jaworski wrote: > Responding to Simon Peyton-Jones' reminder that this is a low-bandwidth list I > was obscure and commited a blunder. > > This one and many other threads here are started undoubtedly by experts [sorry > guys:-)] and coffee brake should work for them, but on numerous occasions > threads here spawn beginner type questions. So, my thinking was that it is > perhaps against the tide trying to stop them. > Why not to make the list Haskell a first contact general practitioner? Then > creating e.g. "Announcements & Challenge" or "Announcements & ask guru" list > could take the best from "Haskell" but also would make it less front line and > thus more elitist, which should imply the manner by itself. I proposed renaming haskell@ -> haskell-announce@ haskell-cafe@ -> haskell@ in http://www.haskell.org/pipermail/haskell-cafe/2007-July/028719.html but the only reply was There are very few inappropriate posts to the haskell@ list. I very much doubt that the list names are a problem. in http://www.haskell.org/pipermail/haskell-cafe/2007-July/028727.html so I dropped it. I've just quickly categorised the haskell@ posts from August to see what the numbers are really like. The posts I've marked "off-topic" are ones that, as far as I can see, are no more suited to haskell@ than most of the messages that are sent to haskell-cafe@. Other peoples' categorisations might vary, but I'd be surprised if they did significantly. http://urchin.earth.li/~ian/haskell-list-categorisation.txt Of 68 messages, 52 were off-topic and 16 were on-topic, so about a 75-25 split. 5 of the off-topic messages were replies to on-topic messages, so would probably have been off-topic regardless of the list name unless we set the haskell-announce@ reply-to address to be haskell@ or moderated haskell-announce@. Of 28 threads, 13 were entirely off-topic while 15 were at least partly on-topic, so about a 50-50 split. This is a much better ratio as it is the chattier threads that tend to be off-topic, of course. There was only 1 on-topic message that wasn't the start of a thread. In response to I very much doubt that the list names are a problem. I fully understand why someone new to the community, and thus unfamiliar with the lists' intended purposes, posted http://www.haskell.org/pipermail/haskell/2007-August/019746.html to a list called haskell@, but I'm sure they wouldn't have posted it to haskell-announce@. Something I noticed is that, of the 15 on-topic threads, 9 (including "The Monad.Reader") were things like calls for papers and conference announcements, which have a largely different audience than new-library announcements. Maybe there's even an argument for splitting haskell-announce in two? haskell-academic-announce? > You could always > cross-post but subscribe or answer to one. Cross-posting to mailing lists doesn't work well, and there's really no reason for haskell-cafe@ subscribers not to be subscribed to haskell@, so you might as well only post to haskell@ if you think it should be crossposted. Thanks Ian From mfn-haskell at cs.york.ac.uk Tue Sep 18 12:27:28 2007 From: mfn-haskell at cs.york.ac.uk (Matthew Naylor) Date: Tue Sep 18 12:37:45 2007 Subject: [Haskell] ANNOUNCE: SparseCheck Message-ID: <20070918162728.GA17725@pc149.cs.york.ac.uk> Dear Haskellers, You might be interested in SparseCheck, a library for typed, depth-bounded logic programming in Haskell allowing convenient expression of test-data generators for properties with sparse domains. http://www.cs.york.ac.uk/~mfn/sparsecheck/ SparseCheck is a based on a library called LP (to be presented at the Haskell Workshop) that was developed jointly with Emil Axelsson. Matthew. From haskell_db at yahoo.de Tue Sep 18 12:32:50 2007 From: haskell_db at yahoo.de (klaus meier) Date: Tue Sep 18 14:25:00 2007 Subject: [Haskell] Update: HaL2 Videos, Second Talk: Wolfgang Jeltsch now in full length Message-ID: Hello, we updated the video given at HaL2 (http://iba-cg.de/haskell.html): "Second Talk: Wolfgang Jeltsch (TU Cottbus) talks about Grapefruit, a Haskell-library for the declarative description of graphic user interfaces." because the last one was accidentally truncated. Greetings, Klaus Meier From igloo at earth.li Tue Sep 18 21:38:05 2007 From: igloo at earth.li (Ian Lynagh) Date: Tue Sep 18 21:37:52 2007 Subject: [Haskell] downtime for monk ({darcs, hackage, cvs}.haskell.org) Monday from 3pm UTC Message-ID: <20070919013805.GA31400@matrix.chaos.earth.li> Hi all, The machine called monk, which serves as darcs.haskell.org hackage.haskell.org cvs.haskell.org haskell.galois.com will be down from 3pm UTC on Monday 24th for an OS and RAM upgrade. If you know of any important services run on the machine other than darcs, CVS, trac, hackage and darcsweb then please let us know. Thanks Ian From voigt at tcs.inf.tu-dresden.de Wed Sep 19 03:55:42 2007 From: voigt at tcs.inf.tu-dresden.de (Janis Voigtlaender) Date: Wed Sep 19 03:55:23 2007 Subject: [Haskell] Functor ((,) a) Message-ID: <46F0D5FE.6090202@tcs.inf.tu-dresden.de> Hi, the Prelude docs found via http://haskell.org/hoogle/hoodoc.cgi?module=Prelude&name=Functor&mode=class claim that there is an instance Functor ((,) a) And yet, I get (in GHC, but similarly in Hugs): Prelude> fmap (+1) (undefined,2) :1:0: No instance for (Functor ((,) a)) arising from use of `fmap' at :1:0-22 Possible fix: add an instance declaration for (Functor ((,) a)) In the expression: fmap ((+ 1)) (undefined, 2) In the definition of `it': it = fmap ((+ 1)) (undefined, 2) What do I have to import to get the Functor ((,) a) instance? (Of course, I can define it myself, but this is not the point.) Thanks, Janis. -- Dr. Janis Voigtlaender http://wwwtcs.inf.tu-dresden.de/~voigt/ mailto:voigt@tcs.inf.tu-dresden.de From dan.doel at gmail.com Wed Sep 19 04:12:28 2007 From: dan.doel at gmail.com (Dan Doel) Date: Wed Sep 19 04:12:12 2007 Subject: [Haskell] Functor ((,) a) In-Reply-To: <46F0D5FE.6090202@tcs.inf.tu-dresden.de> References: <46F0D5FE.6090202@tcs.inf.tu-dresden.de> Message-ID: <200709190412.28286.dan.doel@gmail.com> On Wednesday 19 September 2007, Janis Voigtlaender wrote: > Hi, > > the Prelude docs found via > > http://haskell.org/hoogle/hoodoc.cgi?module=Prelude&name=Functor&mode=class > > claim that there is an instance > > Functor ((,) a) > > And yet, I get (in GHC, but similarly in Hugs): > > Prelude> fmap (+1) (undefined,2) > > :1:0: > No instance for (Functor ((,) a)) > arising from use of `fmap' at :1:0-22 > Possible fix: add an instance declaration for (Functor ((,) a)) > In the expression: fmap ((+ 1)) (undefined, 2) > In the definition of `it': it = fmap ((+ 1)) (undefined, 2) > > What do I have to import to get the Functor ((,) a) instance? > > (Of course, I can define it myself, but this is not the point.) In GHC 6.6 and above, you'll need to import Control.Monad.Instances (a bit of a weird place to put it, but I guess there's no Control.Functor and such). If you have an earlier version than that, I'd say import Control.Monad.Writer at a guess. -- Dan From Alistair_Bayley at invescoperpetual.co.uk Wed Sep 19 04:16:56 2007 From: Alistair_Bayley at invescoperpetual.co.uk (Bayley, Alistair) Date: Wed Sep 19 04:16:38 2007 Subject: [Haskell] downtime for monk ({darcs, hackage, cvs}.haskell.org) Monday from 3pm UTC In-Reply-To: <20070919013805.GA31400@matrix.chaos.earth.li> References: <20070919013805.GA31400@matrix.chaos.earth.li> Message-ID: <125EACD0CAE4D24ABDB4D148C4593DA901BDFCB0@GBLONXMB02.corp.amvescap.net> > From: haskell-bounces@haskell.org > [mailto:haskell-bounces@haskell.org] On Behalf Of Ian Lynagh > > The machine called monk ... > will be down from 3pm UTC on Monday 24th for an OS and RAM upgrade. Do you have any estimate for how long the upgrades will take? Thanks, Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. ***************************************************************** From voigt at tcs.inf.tu-dresden.de Wed Sep 19 04:24:50 2007 From: voigt at tcs.inf.tu-dresden.de (Janis Voigtlaender) Date: Wed Sep 19 04:24:30 2007 Subject: [Haskell] Functor ((,) a) In-Reply-To: <200709190412.28286.dan.doel@gmail.com> References: <46F0D5FE.6090202@tcs.inf.tu-dresden.de> <200709190412.28286.dan.doel@gmail.com> Message-ID: <46F0DCD2.8060901@tcs.inf.tu-dresden.de> Dan Doel wrote: >>What do I have to import to get the Functor ((,) a) instance? >> >>(Of course, I can define it myself, but this is not the point.) > > > In GHC 6.6 and above, you'll need to import Control.Monad.Instances (a bit of > a weird place to put it, but I guess there's no Control.Functor and such). > > If you have an earlier version than that, I'd say import Control.Monad.Writer > at a guess. Thanks a lot. Works! BTW, what would have been the easiest way for me to find this out on my own? Somehow, I would have hoped to be able to navigate to the appropriate point from the mentioned place in the online docs, where it is stated that the instance in question exists. Ciao, Janis. -- Dr. Janis Voigtlaender http://wwwtcs.inf.tu-dresden.de/~voigt/ mailto:voigt@tcs.inf.tu-dresden.de From gmh at Cs.Nott.AC.UK Wed Sep 19 09:28:03 2007 From: gmh at Cs.Nott.AC.UK (Graham Hutton) Date: Wed Sep 19 09:30:33 2007 Subject: [Haskell] Postdoctoral Fellowship in Functional Programming Message-ID: <27643.1190208483@cs.nott.ac.uk> +--------------------------------------------------------------------+ POSTDOCTORAL RESEARCH FELLOW IN FUNCTIONAL PROGRAMMING School of Computer Science University of Nottingham, UK Applications are invited for a 3-year postdoctoral research fellowship in functional programming, to work with Dr Graham Hutton on the EPSRC-funded project "Reasoning About Exceptions and Interrupts". Most modern programming languages provide special features for detecting and managing unexpected events, in the form of exception and interrupt handling primitives. Despite their importance, the issue of provable correctness for programs involving these features has received little attention, but is particularly crucial given the difficulty of writing correct programs in this setting. The aim of this project is to address this problem within the context of modern functional programming languages such as Haskell and Epigram. Applicants for this position will require a PhD in Computer Science, and research experience in functional programming. Additional desirable attributes include experience in formal semantics, program verification, concurrency theory, or theorem provers. The successful applicant will work in collaboration with Dr Graham Hutton in the Foundations of Programming group in Nottingham, a leading centre for research on formal approaches to software construction and verification. The group currently comprises 7 academic staff, 5 research staff, and 13 PhD students. Salary will be within the range 25,134 - 32,796 pounds per year, depending on qualifications and experience. The post is available immediately, and will be offered on a fixed-term contract for 3 years. Further details regarding the position and how to apply are available from Dr Graham Hutton, http://www.cs.nott.ac.uk/~gmh. Closing date for applications: 12th October 2007. +--------------------------------------------------------------------+ | Dr Graham Hutton Email : gmh@cs.nott.ac.uk | | School of Computer Science | | University of Nottingham Web : www.cs.nott.ac.uk/~gmh | | Jubilee Campus, Wollaton Road | | Nottingham NG8 1BB, UK Phone : +44 (0)115 951 4220 | +--------------------------------------------------------------------+ This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From jvlask at hotmail.com Thu Sep 20 18:30:11 2007 From: jvlask at hotmail.com (john lask) Date: Thu Sep 20 18:29:47 2007 Subject: [Haskell] simple function: stack overflow in hugs vs none in ghc Message-ID: Hi hoping someone can shed some light on this: The following code causes a "C stack overflow" in hugs (version 20051031) but not in ghc (version 6.6) The point of the exercise is to process a very large file lazily, returning the consumed and unconsumed parts (i.e. basic parser combinators). The simplified (stylised example of the problem) is displayed bellow. test1 (on a large file) will succeed in ghc but fail in hugs test2 on same file will succeed in both ghc and hugs the problem appears to be retaining a hold on the unconsummed portion and returning it. maybe something to do with updating CAFS, all too subtle for me. The question: is there any changes that can be made to the code to make test1 work in hugs without changing the essence of the function. >test1 = readFile "big.dat" >>= (\x->print $ parse x) >test2 = readFile "big.dat" >>= (\x->print $ fst $ parse x) big.dat is just some large data file say 1MB. (not particularly large by todays standards!) >parse x = sqnc item x > where > > item =( \ ts -> case ts of > [] -> ( Nothing, []) > ts -> ( Just (head ts), tail ts) ) > > sqnc p ts = let ( r, ts' ) = p ts in case r of > Nothing -> ([],ts') > Just x -> let (r',ts'') = (sqnc p ts') in ( >x:r', ts'' ) _________________________________________________________________ Advertisement: Search for local singles online at Lavalife http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Flavalife9%2Eninemsn%2Ecom%2Eau%2Fclickthru%2Fclickthru%2Eact%3Fid%3Dninemsn%26context%3Dan99%26locale%3Den%5FAU%26a%3D30290&_t=764581033&_r=email_taglines_Search&_m=EXT From tom at pledger.gen.nz Sun Sep 23 16:11:32 2007 From: tom at pledger.gen.nz (Tom Pledger) Date: Sun Sep 23 16:11:00 2007 Subject: [Haskell] simple function: stack overflow in hugs vs none in ghc Message-ID: <20070924081132.sl8b22pioo8gws8o@webmail.pledger.gen.nz> John Lask wrote: : | The following code causes a "C stack overflow" in hugs (version 20051031) | but not in ghc (version 6.6) | The point of the exercise is to process a very large file lazily, | returning the consumed and unconsumed parts (i.e. basic parser combinators). : | > sqnc p ts = let ( r, ts' ) = p ts in case r of | > Nothing -> ([],ts') | > Just x -> let (r',ts'') = (sqnc p ts') in (x:r', ts'' ) : I don't know how ghc is avoiding the stack overflow, but it looks like it's caused by strict pattern matching. The first call to sqnc wants reassurance that the second call is returning a pair (as opposed to _|_) before deciding that it's OK to return a pair. Try putting a tilde in the recursive call, to make the pattern lazy. let ~(r',ts'') = ... There's a recent thread on lazy patterns in the haskell-cafe list, too. http://www.haskell.org//pipermail/haskell-cafe/2007-September/031974.html Regards, Tom From Tomas.Caithaml at seznam.cz Sun Sep 23 17:24:45 2007 From: Tomas.Caithaml at seznam.cz (=?us-ascii?Q?Tomas=20Caithaml?=) Date: Sun Sep 23 17:24:13 2007 Subject: [Haskell] Math behind Haskell Message-ID: <1158.1460-26898-375446374-1190582685@seznam.cz> Hi all. When I was playing with Haskell and reading stuff about it, I noticed that there is a lot of information in a form of research papers and a lot of mathematics involved. I must confess that I quite like this academic approach. Well, I thought that while I am still at university I could take some math classes to help me better understand these things and broaden my horizon. Any suggestion what could be relevant? I came up with: * Lambda calculus - the basis of functional languages * Category theory - where all these mysterious things like monads, arrows, and functors come from. * Topology (?) - don't know; I thought it is important rather in mathematical analysis (which I don't like much) but I have seen somewhere some references to it in context of CS. Any other suggestions? Thanks, Tom. From trebla at vex.net Sun Sep 23 18:50:15 2007 From: trebla at vex.net (Albert Y. C. Lai) Date: Sun Sep 23 18:49:44 2007 Subject: [Haskell] Math behind Haskell In-Reply-To: <1158.1460-26898-375446374-1190582685@seznam.cz> References: <1158.1460-26898-375446374-1190582685@seznam.cz> Message-ID: <46F6EDA7.5080609@vex.net> Tomas Caithaml wrote: > Any other suggestions? Lattice theory. Actually just the part about "continuous partial orders" and "least fixed points" suffice. It is hard to find a math course on lattice theory that spends time on continuous partial orders; it is easier to find a CS course on denotational semantics, which covers the necessary math. I don't think topology is much needed for Haskell. Whatever little is needed manifests as lattice theory already. Topology has other uses in CS, but take note that topological spaces relevant to CS are seldom Hausdorff, whereas most math courses spend all the time on Hausdorff spaces. From jamf at iprj.uerj.br Sun Sep 23 19:10:49 2007 From: jamf at iprj.uerj.br (Juarez Assumpcao Muylaert Filho) Date: Sun Sep 23 19:10:28 2007 Subject: [Haskell] Math behind Haskell In-Reply-To: <46F6EDA7.5080609@vex.net> References: <1158.1460-26898-375446374-1190582685@seznam.cz> <46F6EDA7.5080609@vex.net> Message-ID: <46F6F279.6080106@iprj.uerj.br> Albert Y. C. Lai wrote: > Tomas Caithaml wrote: >> Any other suggestions? > > Lattice theory. Actually just the part about "continuous partial > orders" and "least fixed points" suffice. It is hard to find a math > course on lattice theory that spends time on continuous partial > orders; it is easier to find a CS course on denotational semantics, > which covers the necessary math. > > I don't think topology is much needed for Haskell. Whatever little is > needed manifests as lattice theory already. Topology has other uses in > CS, but take note that topological spaces relevant to CS are seldom > Hausdorff, whereas most math courses spend all the time on Hausdorff > spaces. > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > Hi, The following ref might be helpful: M.H. Escardo. *Synthetic topology of data types and classical spaces*. ENTCS,