From lemming at henning-thielemann.de Mon Oct 1 09:29:32 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Mon Oct 1 09:28:32 2007 Subject: Fwd: Suitable new name for Dimensional library In-Reply-To: <8b2a1a960709281327i2d32012bjde176763937db398@mail.gmail.com> References: <8b2a1a960709271940x2a09b797wbdc95afff221db61@mail.gmail.com> <8b2a1a960709281324x2bd4e28bs454923c20d8dbd29@mail.gmail.com> <8b2a1a960709281327i2d32012bjde176763937db398@mail.gmail.com> Message-ID: On Fri, 28 Sep 2007, Bj?rn Buckwalter wrote: > Taken further though, if someone develops another "static" unit > library where should they put it? An arbitrarily complex tree of > namespaces could be built trying to distinguish libraries to > anticipate future clashes. > > This leads me to wonder -- is it better for a library to have a more > or less arbitrary differentiating name rather than a descriptive name? > Examples are 'Text.ParserCombinators.Parsec', 'Text.Parsers.Frisby'. >> From their names it's not obvious what distinguishes them from other > parsers in the same namespace but at least the tree is fairly flat and > hopefully narrowed down enough to permit investigating each > alternative. In the units case I imagine > 'Numeric.Units.SomethingArbitrary' would be appropriate. Indeed, someone might implement static unit checking by a different approach. We cannot predict this. So actually it seems to be better to use an arbitrary differentiating name, say Numeric.Units.Bucky Numeric.Units.Lemming Using module names which describe only the module function might work if there is consensus on its relevance and its API. That is, only for very basic modules of a 'standard library'. From lemming at henning-thielemann.de Mon Oct 1 10:06:00 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Mon Oct 1 10:05:00 2007 Subject: Control.Monad, Control.Applicative vs. Data.Foldable, Data.Traversable Message-ID: What is the reason for some of the standard type classes being in 'Data' folder and some in 'Control'? Since, say 'Reader' is a monad, an applicative thing, an arrow and an instance of other classes - why is it located in Control.Monad? Why not Data.Reader? I find it reasonable to have a directory for concrete data types and one directory for classes. Currently I cannot see, why the Reader data type is in Monad, Monad is in Control, but Foldable class is in Data, together with List, Tree and other concrete data types. From kolmodin at dtek.chalmers.se Fri Oct 5 12:09:52 2007 From: kolmodin at dtek.chalmers.se (Lennart Kolmodin) Date: Fri Oct 5 12:08:40 2007 Subject: Proposal: Fix abstract unix sockets (#1699) In-Reply-To: <20070917115225.GA3777@matrix.chaos.earth.li> References: <46ECF478.8010905@dtek.chalmers.se> <20070917115225.GA3777@matrix.chaos.earth.li> Message-ID: <470661D0.8080503@dtek.chalmers.se> Ian Lynagh wrote: > Hi Lennart, > > On Sun, Sep 16, 2007 at 10:16:40AM +0100, Lennart Kolmodin wrote: >> I've added proposal #1699 to fix abstract unix sockets on Linux for the >> network library. > > You haven't suggested a deadline; between the GHC release and ICFP et al, > perhaps 15 Oct would make sense? Sounds excellent. >> The patch is so far only tested under Linux (2.6.15), but should not >> affect Windows or other OSes which does not have AUS. > > So if I understand correctly, with this patch certain paths would be > treated differently, but only on Linux machines? If someone tries to use > AUS on a non-Linux system, will things break horribly? i.e. would it be > better to have a separate package/module for this Linux-specific > behaviour? I expect an exception will be thrown by 'connect' if you try to use a AUS on a non-linux box. The user only difference for the users is that they can now prefix their UnixPath with a zero. So no change of the API, iirc. A technique previously used is to create a new constructor for AUS and simply not expose it on systems that doesn't support it. This requires the portability-aware devs to #ifdef on the target platform. >> Also, due to much more socklen usage: >> * Switch Network.Socket to use CSockLen instead of CInt. >> * Cleanup surrounding code. > > It would be better for code fixes and cleanup to be in a separate patch > from new functionality; this part sounds like it should definitely be > applied. Right, yes. The reason I didn't was because I discovered things needed to be fixed once I already had changed other stuff... aye, lazy, yes... Cheers, Lennart Kolmodin -- "The only thing that interferes with my learning is my education." -- Albert Einstein From dons at galois.com Sun Oct 7 08:54:13 2007 From: dons at galois.com (Don Stewart) Date: Sun Oct 7 08:53:01 2007 Subject: X11 package Message-ID: <20071007125413.GD13126@scytale.galois.com> I've taken over maintainership of the X11 package, as we need it for xmonad. The previous maintainer was libraries@. Let me know if you've any problems with this. -- Don From bringert at cs.chalmers.se Mon Oct 8 17:10:02 2007 From: bringert at cs.chalmers.se (Bjorn Bringert) Date: Mon Oct 8 17:07:55 2007 Subject: Hackage and GHC 6.8 In-Reply-To: <20070925083848.GA2551@soi.city.ac.uk> References: <20070924010213.GF27284@liouville.galois.com> <20070925083848.GA2551@soi.city.ac.uk> Message-ID: <075FF7F4-02AC-44EB-ABDD-5D511ED90006@cs.chalmers.se> On Sep 25, 2007, at 10:38 , Ross Paterson wrote: > On Sun, Sep 23, 2007 at 06:02:13PM -0700, Don Stewart wrote: >> Neil Davies wrote: >>> Given that GHC 6.8 is just around the corner and, given how it has >>> re-organised the libraries so that the dependencies in many (most/ >>> all) >>> the packages in the hackage DB are now not correct. >>> >>> Is there a plan of how to get hackage DB up to speed with GHC 6.8 ? >> >> Ian, GHC HQ, can you elaborate on what the plan is on fixing the >> hackage >> libraries for ghc 6.8 -- should everyone be springing into action to >> update .cabal files and fix api changes? > > I'm a bit confused about the version numbering for the boot libraries. > The versions bundled with various versions of GHC are: > > ghc-6.6: base-2.0 template-haskell-2.0 unix-1.0 > ghc-6.6.1: base-2.1.1 template-haskell-2.1 unix-2.1 > ghc-6.8 RC: base-2.1 template-haskell-0.1 unix-2.0 > > What versions are planned for the release? This seems quite broken. It makes writing Cabal configurations messy. base <= 2.0 and == 2.1.1 are the monolithic base. base == 2.1 (and presumably >= 2.2) are the split up base. Add to this that bytestring was in base == 2.0 (not <=2.0) and in == 2.1.1. Is there any reason not to bump the base that comes with GHC 6.8 to base-2.2? /Bj?rn From dons at galois.com Mon Oct 8 18:02:53 2007 From: dons at galois.com (Don Stewart) Date: Mon Oct 8 18:01:51 2007 Subject: Hackage and GHC 6.8 In-Reply-To: <075FF7F4-02AC-44EB-ABDD-5D511ED90006@cs.chalmers.se> References: <20070924010213.GF27284@liouville.galois.com> <20070925083848.GA2551@soi.city.ac.uk> <075FF7F4-02AC-44EB-ABDD-5D511ED90006@cs.chalmers.se> Message-ID: <20071008220253.GB17279@scytale.galois.com> bringert: > On Sep 25, 2007, at 10:38 , Ross Paterson wrote: > > >On Sun, Sep 23, 2007 at 06:02:13PM -0700, Don Stewart wrote: > >>Neil Davies wrote: > >>>Given that GHC 6.8 is just around the corner and, given how it has > >>>re-organised the libraries so that the dependencies in many (most/ > >>>all) > >>>the packages in the hackage DB are now not correct. > >>> > >>>Is there a plan of how to get hackage DB up to speed with GHC 6.8 ? > >> > >>Ian, GHC HQ, can you elaborate on what the plan is on fixing the > >>hackage > >>libraries for ghc 6.8 -- should everyone be springing into action to > >>update .cabal files and fix api changes? > > > >I'm a bit confused about the version numbering for the boot libraries. > >The versions bundled with various versions of GHC are: > > > >ghc-6.6: base-2.0 template-haskell-2.0 unix-1.0 > >ghc-6.6.1: base-2.1.1 template-haskell-2.1 unix-2.1 > >ghc-6.8 RC: base-2.1 template-haskell-0.1 unix-2.0 > > > >What versions are planned for the release? > > This seems quite broken. It makes writing Cabal configurations messy. > base <= 2.0 and == 2.1.1 are the monolithic base. base == 2.1 (and > presumably >= 2.2) are the split up base. Add to this that bytestring > was in base == 2.0 (not <=2.0) and in == 2.1.1. > > Is there any reason not to bump the base that comes with GHC 6.8 to > base-2.2? > or 3.0 From ross at soi.city.ac.uk Mon Oct 8 18:56:00 2007 From: ross at soi.city.ac.uk (Ross Paterson) Date: Mon Oct 8 18:54:46 2007 Subject: Hackage and GHC 6.8 In-Reply-To: <075FF7F4-02AC-44EB-ABDD-5D511ED90006@cs.chalmers.se> References: <20070924010213.GF27284@liouville.galois.com> <20070925083848.GA2551@soi.city.ac.uk> <075FF7F4-02AC-44EB-ABDD-5D511ED90006@cs.chalmers.se> Message-ID: <20071008225600.GA5458@soi.city.ac.uk> On Mon, Oct 08, 2007 at 11:10:02PM +0200, Bjorn Bringert wrote: > On Sep 25, 2007, at 10:38 , Ross Paterson wrote: >> I'm a bit confused about the version numbering for the boot libraries. >> The versions bundled with various versions of GHC are: >> >> ghc-6.6: base-2.0 template-haskell-2.0 unix-1.0 >> ghc-6.6.1: base-2.1.1 template-haskell-2.1 unix-2.1 >> ghc-6.8 RC: base-2.1 template-haskell-0.1 unix-2.0 >> >> What versions are planned for the release? > > This seems quite broken. It makes writing Cabal configurations messy. base > <= 2.0 and == 2.1.1 are the monolithic base. base == 2.1 (and presumably >= > 2.2) are the split up base. Add to this that bytestring was in base == 2.0 > (not <=2.0) and in == 2.1.1. > > Is there any reason not to bump the base that comes with GHC 6.8 to > base-2.2? To allow specifying conservative dependencies, it is also necessary to specify for each boot package the range of version numbers that can ship with GHC 6.8.x (all guaranteed to have the same interface). And, when GHC 6.8.1 is released, to advance the version numbers of these packages in the HEAD beyond these ranges. From bjorn.buckwalter at gmail.com Tue Oct 9 13:46:14 2007 From: bjorn.buckwalter at gmail.com (=?ISO-8859-1?Q?Bj=F6rn_Buckwalter?=) Date: Tue Oct 9 13:44:49 2007 Subject: Fwd: Suitable new name for Dimensional library In-Reply-To: References: <8b2a1a960709271940x2a09b797wbdc95afff221db61@mail.gmail.com> <8b2a1a960709281324x2bd4e28bs454923c20d8dbd29@mail.gmail.com> <8b2a1a960709281327i2d32012bjde176763937db398@mail.gmail.com> Message-ID: <8b2a1a960710091046w400160ebhda0a779383498439@mail.gmail.com> Henning, all, I decided to go with 'Numeric.Units.Dimensional'. I feel that 'Dimensional' provides sufficient differentiation as unit libraries go and the preceding 'Numeric.Units' takes care of my concern of 'Dimensional' being too vague. Thanks all for your inputs! I've released dimensional-0.7 with the new module name space and a few small additions w.r.t. version 0.6. It can be downloaded from the project homepage[1] or hackage. Regards, Bjorn Buckwalter [1] http://dimensional.googlecode.com/ On 10/1/07, Henning Thielemann wrote: > > On Fri, 28 Sep 2007, Bj?rn Buckwalter wrote: > > > Taken further though, if someone develops another "static" unit > > library where should they put it? An arbitrarily complex tree of > > namespaces could be built trying to distinguish libraries to > > anticipate future clashes. > > > > This leads me to wonder -- is it better for a library to have a more > > or less arbitrary differentiating name rather than a descriptive name? > > Examples are 'Text.ParserCombinators.Parsec', 'Text.Parsers.Frisby'. > >> From their names it's not obvious what distinguishes them from other > > parsers in the same namespace but at least the tree is fairly flat and > > hopefully narrowed down enough to permit investigating each > > alternative. In the units case I imagine > > 'Numeric.Units.SomethingArbitrary' would be appropriate. > > Indeed, someone might implement static unit checking by a different > approach. We cannot predict this. So actually it seems to be better to use > an arbitrary differentiating name, say > > Numeric.Units.Bucky > Numeric.Units.Lemming > > Using module names which describe only the module function might work if > there is consensus on its relevance and its API. That is, only for very > basic modules of a 'standard library'. From paul at cogito.org.uk Wed Oct 10 08:51:57 2007 From: paul at cogito.org.uk (Paul Johnson) Date: Wed Oct 10 08:50:32 2007 Subject: Trying to install binary-0.4 Message-ID: <470CCAED.4010702@cogito.org.uk> In my copious free time I'm putting together a client-side library for AMQP. This needs efficient packing of bytestrings, so I downloaded Dons' bytestring 0.4. Unfortunately it won't install: I get [paj@eiffel binary-0.4]$ ./Setup.lhs configure Configuring binary-0.4... configure: Dependency base-any: using base-2.1.1 Setup.lhs: cannot satisfy dependency containers-any Should this be "collections" not "containers"? I can't find a "containers" package in Hackage. Paul. From johan.tibell at gmail.com Wed Oct 10 09:03:28 2007 From: johan.tibell at gmail.com (Johan Tibell) Date: Wed Oct 10 09:02:01 2007 Subject: Trying to install binary-0.4 In-Reply-To: <470CCAED.4010702@cogito.org.uk> References: <470CCAED.4010702@cogito.org.uk> Message-ID: <90889fe70710100603p495f0cf7ua00be0c0360a8600@mail.gmail.com> In the latest version of GHC (6.8) the base library was split up into many smaller libraries. Among them containers. Your problem is probably related to that. I don't have my Haskell setup nearby unfortunately so I can't tell you exactly what the problem is. -- Johan On 10/10/07, Paul Johnson wrote: > In my copious free time I'm putting together a client-side library for > AMQP. This needs efficient packing of bytestrings, so I downloaded > Dons' bytestring 0.4. Unfortunately it won't install: I get > > [paj@eiffel binary-0.4]$ ./Setup.lhs configure > Configuring binary-0.4... > configure: Dependency base-any: using base-2.1.1 > Setup.lhs: cannot satisfy dependency containers-any > > > Should this be "collections" not "containers"? I can't find a > "containers" package in Hackage. > > Paul. > > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries > From mdanish at andrew.cmu.edu Wed Oct 10 09:00:47 2007 From: mdanish at andrew.cmu.edu (Matthew Danish) Date: Wed Oct 10 09:02:22 2007 Subject: Trying to install binary-0.4 In-Reply-To: <470CCAED.4010702@cogito.org.uk> References: <470CCAED.4010702@cogito.org.uk> Message-ID: <20071010130047.GJ29000@mapcar.org> On Wed, Oct 10, 2007 at 01:51:57PM +0100, Paul Johnson wrote: > In my copious free time I'm putting together a client-side library for > AMQP. This needs efficient packing of bytestrings, so I downloaded > Dons' bytestring 0.4. Unfortunately it won't install: I get > > [paj@eiffel binary-0.4]$ ./Setup.lhs configure > Configuring binary-0.4... > configure: Dependency base-any: using base-2.1.1 > Setup.lhs: cannot satisfy dependency containers-any > > > Should this be "collections" not "containers"? I can't find a > "containers" package in Hackage. My guess would be that binary-0.4 is packaged for the new Cabal and GHC, which has split base into many packages like "containers." Either install the release candidate, or, eliminate the unsatisfied dependencies from the .cabal file and hope it compiles. -- -- Matthew Danish -- user: mrd domain: cmu.edu -- OpenPGP public key: C24B6010 on keyring.debian.org From dons at galois.com Wed Oct 10 10:22:29 2007 From: dons at galois.com (Don Stewart) Date: Wed Oct 10 10:21:16 2007 Subject: Trying to install binary-0.4 In-Reply-To: <470CCAED.4010702@cogito.org.uk> References: <470CCAED.4010702@cogito.org.uk> Message-ID: <20071010142229.GA30114@scytale.galois.com> paul: > In my copious free time I'm putting together a client-side library for > AMQP. This needs efficient packing of bytestrings, so I downloaded > Dons' bytestring 0.4. Unfortunately it won't install: I get > > [paj@eiffel binary-0.4]$ ./Setup.lhs configure > Configuring binary-0.4... > configure: Dependency base-any: using base-2.1.1 > Setup.lhs: cannot satisfy dependency containers-any > > > Should this be "collections" not "containers"? I can't find a > "containers" package in Hackage. Since you're not using ghc 6.8, you should use binary 0.3 :) -- Don From paul at cogito.org.uk Wed Oct 10 10:36:45 2007 From: paul at cogito.org.uk (Paul Johnson) Date: Wed Oct 10 10:35:19 2007 Subject: Trying to install binary-0.4 In-Reply-To: <90889fe70710100603p495f0cf7ua00be0c0360a8600@mail.gmail.com> References: <470CCAED.4010702@cogito.org.uk> <90889fe70710100603p495f0cf7ua00be0c0360a8600@mail.gmail.com> Message-ID: <470CE37D.7020403@cogito.org.uk> Johan Tibell wrote: > In the latest version of GHC (6.8) the base library was split up into > many smaller libraries. Among them containers. Your problem is > probably related to that. I don't have my Haskell setup nearby > unfortunately so I can't tell you exactly what the problem is. Looks like I'm going to be upgrading to GHC 6.8 then. Paul. From dons at galois.com Thu Oct 11 19:21:49 2007 From: dons at galois.com (Don Stewart) Date: Thu Oct 11 19:20:19 2007 Subject: X11 package In-Reply-To: <87wstwhanj.fsf@malde.org> References: <20071007125413.GD13126@scytale.galois.com> <87wstwhanj.fsf@malde.org> Message-ID: <20071011232149.GQ25356@scytale.galois.com> ketil: > Don Stewart writes: > > > I've taken over maintainership of the X11 package, as we need it for > > xmonad. The previous maintainer was libraries@. Let me know if you've > > any problems with this. > > Absolutely not! Thanks for doing this. Mind taking over Parsec as > well? :-) > Overwhelming support :) Consider X11 owned. -- Don From dons at galois.com Fri Oct 12 14:35:22 2007 From: dons at galois.com (Don Stewart) Date: Fri Oct 12 14:33:51 2007 Subject: X11 1.2.3 released Message-ID: <20071012183522.GB22287@scytale.galois.com> A new release of X11, ready for ghc 6.8, (and the upcoming xmonad release), is on hackage, and tagged in darcs: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/X11-1.2.3 Main change is Ross fixed the Setup.hs file to not use wacky hooks. Future plans are to merge the X11-extras (aka Xinerama bindings) into X11, for the next release. -- Don From lemming at henning-thielemann.de Fri Oct 12 16:17:01 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Fri Oct 12 16:15:24 2007 Subject: runInteractiveProcess and buffering Message-ID: It looks like my problem has to do with buffering, but I don't know how to solve it. main :: IO () main = do (inp,out,err,pid) <- runInteractiveProcess "aseqdump" ["-p", "72:0"] Nothing Nothing hSetBuffering out NoBuffering hGetBuffering out >>= print hGetLine out >>= putStrLn return () The data of 'out' seems to be buffered, because 'aseqdump' must produce many lines until even the first one is returned by 'hGetLine' and printed by 'putStrLn'. I tried to disable buffering for 'out' and indeed 'NoBuffering' is printed to the terminal, but the output from 'aseqdump' is still deferred. From rfhayes at reillyhayes.com Fri Oct 12 17:30:54 2007 From: rfhayes at reillyhayes.com (R Hayes) Date: Fri Oct 12 17:29:31 2007 Subject: Trying to install binary-0.4 In-Reply-To: <470CCAED.4010702@cogito.org.uk> References: <470CCAED.4010702@cogito.org.uk> Message-ID: <2E0C0BD7-DEFE-4B92-BCF6-78A9BC566A98@reillyhayes.com> Paul, Just out of curiosity, which version of the AMQP spec are you writing to? 0.9? Which implementations of the broker are you testing against? -reilly On Oct 10, 2007, at 5:51 AM, Paul Johnson wrote: > In my copious free time I'm putting together a client-side library > for AMQP. This needs efficient packing of bytestrings, so I > downloaded Dons' bytestring 0.4. Unfortunately it won't install: I > get > > [paj@eiffel binary-0.4]$ ./Setup.lhs configure > Configuring binary-0.4... > configure: Dependency base-any: using base-2.1.1 > Setup.lhs: cannot satisfy dependency containers-any > > > Should this be "collections" not "containers"? I can't find a > "containers" package in Hackage. > > Paul. > > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries From agl at imperialviolet.org Fri Oct 12 23:52:46 2007 From: agl at imperialviolet.org (Adam Langley) Date: Fri Oct 12 23:51:08 2007 Subject: runInteractiveProcess and buffering In-Reply-To: References: Message-ID: <396556a20710122052m43b45169n2a0ffb37aca68ee3@mail.gmail.com> On 10/12/07, Henning Thielemann wrote: > The data of 'out' seems to be buffered, because 'aseqdump' must produce > many lines until even the first one is returned by 'hGetLine' and printed > by 'putStrLn'. I tried to disable buffering for 'out' and indeed > 'NoBuffering' is printed to the terminal, but the output from 'aseqdump' > is still deferred. [I suspect this is a job for haskell-cafe@, anyway] Are you sure that you aseqdump isn't buffering itself? The standard C libraries will buffer output at the line level at least, and are free to buffer much more than that if they think that the output is not to a terminal. Try building this code: #include #include int main() { printf("line 1\n"); write(1, "line 2\n", 7); printf("line 3\n"); return 0; } For me (glibc 2.6), if I send stdout to a terminal then it's line buffered and I get the lines in the correct order. However, if I redirect to a file, line 3 comes first because the printf lines are buffered until the process dies. AGL -- Adam Langley agl@imperialviolet.org http://www.imperialviolet.org 650-283-9641 From ashley at semantic.org Sat Oct 13 04:23:27 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Sat Oct 13 04:22:52 2007 Subject: Proposal: Add Compositor class as superclass of Arrow Message-ID: http://hackage.haskell.org/trac/ghc/ticket/1773 (darcs patch attached to ticket) The Compositor class has two members: class Compositor comp where identity :: comp a a (>>>) :: comp a b -> comp b c -> comp a c with the obvious monoid. Since all Arrows are Compositors, make Compositor a superclass of Arrow. A number of useful types are Compositors but not Arrows: 1. Bijections data Bijection a b = MkBijection (a -> b) (b -> a) 2. Codecs, i.e. encoder/decoder pairs such as charset converters data Codec base derived = MkCodec { encode :: derived -> base, decode :: base -> Maybe derived -- or other Monad } utf8 :: Codec [Word8] String xml :: Codec String XML 3. Lenses These make updatable sections of data structures. data Lens s t = MkLens { lensGet :: s -> t, lensPutback :: t -> s -> s } See http://www.cis.upenn.edu/~bcpierce/papers/lenses-etapsslides.pdf 4. Reified proofs of type identity These are useful if you use GADTs and type-witnesses a lot. newtype SameType a a' = MkSameType (forall f. f a -> f a') Proposal period: two weeks, until 10-27 From apfelmus at quantentunnel.de Sat Oct 13 05:08:57 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Sat Oct 13 05:07:10 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: Ashley Yakeley wrote: > http://hackage.haskell.org/trac/ghc/ticket/1773 > (darcs patch attached to ticket) > > The Compositor class has two members: > > class Compositor comp where > identity :: comp a a > (>>>) :: comp a b -> comp b c -> comp a c > > with the obvious monoid. Since all Arrows are Compositors, make Yes, bring 'em in! But _only_ under their standard name :) class Category c where id :: c a a (.) :: c b c -> c a b -> c a c subject to the well-known laws f = id . f = f . id f . (g . h) = (f . g) . h Who says category theory isn't for functional programmers? ;) Unfortunately, the names id and (.) are already taken / give headache to those that don't like map :: Functor f => (a -> b) -> f a -> f b . Regards, apfelmus From twanvl at gmail.com Sat Oct 13 07:03:25 2007 From: twanvl at gmail.com (Twan van Laarhoven) Date: Sat Oct 13 07:01:35 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: <4710A5FD.7060306@gmail.com> apfelmus wrote: > Yes, bring 'em in! But _only_ under their standard name :) > > class Category c where > id :: c a a > (.) :: c b c -> c a b -> c a c I think using these names is a good idea, it means that you can write generic code without it becoming an ugly mess of non-standard names. > Unfortunately, the names id and (.) are already taken / give headache > to those that don't like map :: Functor f => (a -> b) -> f a -> f b . I don't see a problem here, if you don't want to use these functions then don't import Control.Category. This is similair to the situation with adding the arrow operators to Data.Tuple. Also, these functions are likely to give less problems than the map function; I can't think of a case where they are not directly used as a function, which immediatly leads to c = (->). I am not a category-theorist, but is Category c the right terminoligy? As I understand it 'c a b' is a morphism between the objects 'a' and 'b' from the category Hask. I don't think there even is a name for the type constructor c itself. When I wrote this exact class for myself a while ago I called it 'Morphism', which makes (some) sense, espacially since we also have the 'Arrow' class. But I realize that morphism is not the correct term either. Twan From paul at cogito.org.uk Sat Oct 13 12:04:22 2007 From: paul at cogito.org.uk (Paul Johnson) Date: Sat Oct 13 12:02:48 2007 Subject: Trying to install binary-0.4 In-Reply-To: <2E0C0BD7-DEFE-4B92-BCF6-78A9BC566A98@reillyhayes.com> References: <470CCAED.4010702@cogito.org.uk> <2E0C0BD7-DEFE-4B92-BCF6-78A9BC566A98@reillyhayes.com> Message-ID: <4710EC86.1090807@cogito.org.uk> R Hayes wrote: > Paul, > > Just out of curiosity, which version of the AMQP spec are you writing > to? 0.9? 0.9 > Which implementations of the broker are you testing against? Not got that far yet. I'm currently working on the framing layer. Paul. From lemming at henning-thielemann.de Sat Oct 13 12:25:06 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sat Oct 13 12:23:26 2007 Subject: Applicative functor for building C structs with Storable Message-ID: Are there analogons to ByteString's Put and Get Monads to construct and disect binary data in a C struct for exchange with a C program? From lemming at henning-thielemann.de Sat Oct 13 12:56:32 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sat Oct 13 12:54:55 2007 Subject: runInteractiveProcess and buffering In-Reply-To: <396556a20710122052m43b45169n2a0ffb37aca68ee3@mail.gmail.com> References: <396556a20710122052m43b45169n2a0ffb37aca68ee3@mail.gmail.com> Message-ID: On Fri, 12 Oct 2007, Adam Langley wrote: > On 10/12/07, Henning Thielemann wrote: >> The data of 'out' seems to be buffered, because 'aseqdump' must produce >> many lines until even the first one is returned by 'hGetLine' and printed >> by 'putStrLn'. I tried to disable buffering for 'out' and indeed >> 'NoBuffering' is printed to the terminal, but the output from 'aseqdump' >> is still deferred. > > [I suspect this is a job for haskell-cafe@, anyway] > > Are you sure that you aseqdump isn't buffering itself? I'm not sure, I only see that it works when started in a terminal. However if I pipe it to 'less' then the output is deferred for a while. This seems to indicate that the C program actually buffers itself. :-( > The standard C libraries will buffer output at the line level at least, > and are free to buffer much more than that if they think that the output > is not to a terminal. Is this decision done automatically by C's standard library or must the C programmer do this manually? I couldn't find such a switch in the C program. From agl at imperialviolet.org Sat Oct 13 13:29:41 2007 From: agl at imperialviolet.org (Adam Langley) Date: Sat Oct 13 13:28:03 2007 Subject: runInteractiveProcess and buffering In-Reply-To: References: <396556a20710122052m43b45169n2a0ffb37aca68ee3@mail.gmail.com> Message-ID: <396556a20710131029q676c33ddn2ffaba9daa77399b@mail.gmail.com> On 10/13/07, Henning Thielemann wrote: > Is this decision done automatically by C's standard library or must the C > programmer do this manually? I couldn't find such a switch in the C > program. I believe that glibc fstat's FD 1 to find out if stdout is a terminal and sets its buffering up accordingly. The solution is to call fflush(stdout) at the correct places in the C code, or to force the buffering explicitly at the beginning of the program (see man setbuf). AGL -- Adam Langley agl@imperialviolet.org http://www.imperialviolet.org 650-283-9641 From agl at imperialviolet.org Sat Oct 13 13:34:31 2007 From: agl at imperialviolet.org (Adam Langley) Date: Sat Oct 13 13:32:52 2007 Subject: Applicative functor for building C structs with Storable In-Reply-To: References: Message-ID: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> On 10/13/07, Henning Thielemann wrote: > Are there analogons to ByteString's Put and Get Monads to construct and > disect binary data in a C struct for exchange with a C program? The memory layout of structs depends on the ABI of system. You can take a guess and write code in the Get and Put monads. Your guess will probably work pretty well within a single architecture (e.g. x86 or x86-64). However, the portable way to do this is to get the information from the C compiler, which is the approach that c2hs[1] and friends use. I would recommend this unless there's some good reason to think otherwise. (see [2] for the exact hook) [1] http://www.cse.unsw.edu.au/~chak/haskell/c2hs/ [2] http://www.cse.unsw.edu.au/~chak/haskell/c2hs/docu/c2hs-2.html#ss2.8 AGL -- Adam Langley agl@imperialviolet.org http://www.imperialviolet.org 650-283-9641 From magnus at therning.org Sat Oct 13 14:26:45 2007 From: magnus at therning.org (Magnus Therning) Date: Sat Oct 13 14:25:08 2007 Subject: Data encoding library Message-ID: <20071013182645.GA3418@die.therning.org> I've just created the page http://haskell.org/haskellwiki/Library/Data_encoding (there are no links into it at the moment). Any comments on what I've written there? Are the locations in the hierarchy good? I have code to share if you are interested in commenting on it as well. Just let me know and I'll find a place to put it for public download. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus?therning?org Jabber: magnus?therning?gmail?com http://therning.org/magnus Windows [n.] A thirty-two bit extension and GUI shell to a sixteen bit patch to an eight bit operating system originally coded for a four bit microprocessor and sold by a two-bit company that can't stand one bit of competition. -- Anonymous USEnet post -------------- 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/libraries/attachments/20071013/379d8d6f/attachment.bin From ashley at semantic.org Sat Oct 13 15:34:35 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Sat Oct 13 15:33:20 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: apfelmus wrote: > Yes, bring 'em in! But _only_ under their standard name :) > > class Category c where > id :: c a a > (.) :: c b c -> c a b -> c a c class Category cat where id :: cat a a (.) :: cat b c -> cat a b -> cat a c I'm not against this, but it would mean moving Category to the Prelude. As far as bikeshed issues: 1. I don't care either way about the name. "Category" or "Morphism" would both be fine. 2. I made a sort of "minimal bikeshed" patch, with this from Arrow: (>>>) :: comp a b -> comp b c -> comp a c But I actually prefer (<<<) :: comp b c -> comp a b -> comp a c , like (.). I originally called that member 'compose'. > Unfortunately, the names id and (.) are already taken / give headache > to those that don't like map :: Functor f => (a -> b) -> f a -> f b . I prefer the generalised 'map' too. In fact I always use fmap over lists, map is just one more thing to remember so I don't. But that's another proposal... -- Ashley Yakeley Seattle, WA From apfelmus at quantentunnel.de Sun Oct 14 06:55:28 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Sun Oct 14 06:53:33 2007 Subject: Data encoding library In-Reply-To: <20071013182645.GA3418@die.therning.org> References: <20071013182645.GA3418@die.therning.org> Message-ID: Magnus Therning wrote: > I've just created the page > http://haskell.org/haskellwiki/Library/Data_encoding (there are no links > into it at the moment). > > Any comments on what I've written there? > Are the locations in the hierarchy good? Nice, but do you really need separate modules for each encoding? I mean, Ashely's proposal > 2. Codecs, i.e. encoder/decoder pairs such as charset converters > > data Codec base derived = MkCodec > { > encode :: derived -> base, > decode :: base -> Maybe derived -- or other Monad > } > > utf8 :: Codec [Word8] String > xml :: Codec String XML from the recent thread http://article.gmane.org/gmane.comp.lang.haskell.libraries/7663 would fit the bill perfectly, wouldn't it? In other words, encodings are just pairs of functions, nothing complicated base16 :: Codec String [Word8] -- decode Strings to Word8 base32 :: Codec String [Word8] base64 :: ... base64url :: uuencode :: For more documentation in the types, a type synonym may come in very handy type ASCII = String base16 :: Codec ASCII [Word8] ... Want to encode an example? Here you go encode base16 [0xde,0xad,0xbe,0xef] :: ASCII Btw, it is essential that decode may fail on bad input! Also, I don't have a clue about what chop and unchop are supposed to do. Regards, apfelmus From apfelmus at quantentunnel.de Sun Oct 14 08:51:51 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Sun Oct 14 08:50:07 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <4710A5FD.7060306@gmail.com> References: <4710A5FD.7060306@gmail.com> Message-ID: Twan van Laarhoven wrote: > apfelmus wrote: > > class Category c where >> id :: c a a >> (.) :: c b c -> c a b -> c a c > >> Unfortunately, the names id and (.) are already taken > > I don't see a problem here, if you don't want to use these functions > then don't import Control.Category. This is similar to the situation > with adding the arrow operators to Data.Tuple. Yes, except that these here are already in the Prelude. But hey, you can always import Control.Category import Prelude hiding (id,(.)) > I am not a category-theorist, but is Category c the right terminology? > As I understand it 'c a b' is a morphism between the objects 'a' and 'b' > from the category Hask. I don't think there even is a name for the type > constructor c itself. When I wrote this exact class for myself a while > ago I called it 'Morphism', which makes (some) sense, especially since > we also have the 'Arrow' class. But I realize that morphism is not the > correct term either. Yeah, neither terminology is correct, but I'd opt for Category for the following reason: While a and b are objects in the category Hask, they may well be phantom types. For instance, c could implement a small stack based domain specific language and the types merely ensure that all stack operations are ok data C a b = Pop | Swap | Int Int | Float Float | Add data a :- b -- empty data Number -- empty pop :: C (a :- s) s swap :: C (a :- b :- s) (b :- a :- s) int :: Int -> C s (Number :- s) float :: Float -> C s (Number :- s) add :: C (Number :- Number :- s) (Number :- s) In the category Hask, those types Number and a :- b are empty but from the viewpoint of our category of stack operations, there are quite a lot of useful morphisms between them. Thus, in a sense, C can redefine the meaning of objects from Hask, so I think of it as more than a Morphism between objects in Hask. Regards, apfelmus From magnus at therning.org Sun Oct 14 12:50:59 2007 From: magnus at therning.org (Magnus Therning) Date: Sun Oct 14 12:49:20 2007 Subject: Data encoding library In-Reply-To: References: <20071013182645.GA3418@die.therning.org> Message-ID: <20071014165059.GA3438@die.therning.org> On Sun, Oct 14, 2007 at 12:55:28 +0200, apfelmus wrote: > Magnus Therning wrote: >> I've just created the page >> http://haskell.org/haskellwiki/Library/Data_encoding (there are no links >> into it at the moment). >> Any comments on what I've written there? >> Are the locations in the hierarchy good? > > Nice, but do you really need separate modules for each encoding? >I mean, Ashely's proposal There is no particular need for separate modules, except that in the current version there would be name clashes. >> 2. Codecs, i.e. encoder/decoder pairs such as charset converters >> data Codec base derived = MkCodec >> { >> encode :: derived -> base, >> decode :: base -> Maybe derived -- or other Monad >> } >> utf8 :: Codec [Word8] String >> xml :: Codec String XML > > from the recent thread > > http://article.gmane.org/gmane.comp.lang.haskell.libraries/7663 > > would fit the bill perfectly, wouldn't it? In other words, encodings are > just pairs of functions, nothing complicated > > base16 :: Codec String [Word8] -- decode Strings to Word8 > base32 :: Codec String [Word8] > base64 :: ... > base64url :: > uuencode :: > > For more documentation in the types, a type synonym may come in very handy > > type ASCII = String > base16 :: Codec ASCII [Word8] > ... > > Want to encode an example? Here you go > > encode base16 [0xde,0xad,0xbe,0xef] :: ASCII A similar result could be gotten by using phantom types, right? But then there must be some way of liberating the result. I'm not sure yet whether they are worth it. AFAIU the example from above then changes to encode [0xde,0xad,0xbe,0xef] :: Base16 ASCII > Btw, it is essential that decode may fail on bad input! I will for sure change the result of decode to deal with failures. > Also, I don't have a clue about what chop and unchop are supposed > to do. For some encodings there are standard ways of splitting an encoded string over several lines. Unfortunately it's not always as simple as just splitting a string at a particular length. Uuencode is the most complicated I've come across so far. That's what chop/unchop is for. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus?therning?org Jabber: magnus?therning?gmail?com http://therning.org/magnus -------------- 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/libraries/attachments/20071014/265a91e5/attachment.bin From apfelmus at quantentunnel.de Sun Oct 14 14:11:14 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Sun Oct 14 14:10:28 2007 Subject: Data encoding library In-Reply-To: <20071014165059.GA3438@die.therning.org> References: <20071013182645.GA3418@die.therning.org> <20071014165059.GA3438@die.therning.org> Message-ID: Magnus Therning wrote: >>> 2. Codecs, i.e. encoder/decoder pairs such as charset converters >>> data Codec base derived = MkCodec >>> { >>> encode :: derived -> base, >>> decode :: base -> Maybe derived -- or other Monad >>> } >>> utf8 :: Codec [Word8] String >>> xml :: Codec String XML >> >> type ASCII = String >> base16 :: Codec ASCII [Word8] >> ... >> >> encode base16 [0xde,0xad,0xbe,0xef] :: ASCII > > A similar result could be gotten by using phantom types, right? Most likely, although I'm not sure whether the choice from your blog is the right one. I mean, the only-a-little-bit-phantom type newtype Base16 a = Base16 { unBase16 :: a } deriving (Eq,Show) will do the job too instance DataEncoding Base16 where encode = Base16 . b16Encode decode = b16Decode . unBase16 chop n = Base16 . b16chop n . unBase16 unchop = Base16 . b16unchop . unBase16 liberate = unBase16 incarcerate = Base16 Usually, the "normal" phantom type approach would be to make the encoding a phantom argument of a string type, not the other way round: newtype EncodedString enc = ES String data Base16 -- empty type, no constructors instance DataEncoding (EncodedString Base16) where ... But your idea of fixing the encoding in the type for more type safety is good. Another way to do that would be to have an abstract data type -- this is not a String, this is base16-encoded data! newtype Base16 = Base16 String with functions encode :: [Word8] -> Base16 decode :: Base16 -> [Word8] and functions encode :: Base16 -> String decode :: String -> Maybe Base16 The "normal" phantom type approach has the advantage of making the last functions polymorphic encode :: EncodedString enc -> String decode :: String -> EncodedString enc encode (ES s) = s decode s = ES s at the expense of shifting the possible failure to decode :: EncodedString Base16 -> Maybe [Word8] Of course, you can use both phantom types and the codec approach eliminating the need for a type class base16 :: Codec [Word8] (EncodedString Base16) string :: Codec (EncodedString a) String > But then there must be some way of liberating the result. > I'm not sure yet whether they are worth it. > > AFAIU the example from above then changes to > > encode [0xde,0xad,0xbe,0xef] :: Base16 ASCII Concerning the choice between encoding the encoding (... ;-) in the types (like Base16) or as values (like base16 :: Codec ...), the observation is that you have to specify the encoding anyway :) either as type annotation ("type argument") encode [0xde,0xad,0xbe,0xef] :: EncodedString Base16 encode' (undefined :: Base16) [0xde,0xad,0xbe,0xef] or as value argument encode base16 [0xde,0xad,0xbe,0xef] In this case, I would prefer the value argument approach for its brevity and mnemonics ("encode in base16 the following data"). However, possible strong type guarantees usually are a good argument for the typed approach. To be true, I'm not really sure whether strong types would gain us something here. >> Also, I don't have a clue about what chop and unchop are supposed >> to do. > > For some encodings there are standard ways of splitting an encoded > string over several lines. Unfortunately it's not always as simple as > just splitting a string at a particular length. Uuencode is the most > complicated I've come across so far. That's what chop/unchop is for. Ah, that's what they are for. An idea would be to build the line length into the encoding, like base16 :: Int -> Codec [Word8] [String] with the intention that encode (base16 70) x will encode x with a line length of 70 characters. Hm, should decode (base16 70) s fail when the lines are not 70 characters in length, or should it accept any line length? Maybe it should be basae16 :: Maybe Int -> Codec [Words8] [String] since the programmer may choose to not wrap lines anyway. But perhaps the line length is best paired with the data base16 :: Codec ([Words8], Maybe Int) [String] so that encode base16 (..., Just 70) x will encode with a line length of 70 characters and let (,ll) = decode base16 s in ... will return the parsed line length in ll . Oh my lambda, it's wondrous how Haskell gives so many possibilities to ponder for such a seemingly innocent API design problem :) Regards, apfelmus From gale at sefer.org Sun Oct 14 15:00:59 2007 From: gale at sefer.org (Yitzchak Gale) Date: Sun Oct 14 14:59:20 2007 Subject: Let's do ListT right, finally Message-ID: <2608b8a80710141200k665403bhfa1ee3cd8ba6692e@mail.gmail.com> Hi Ian, thanks for responding to my plea! I am renaming this thread and moving it to libraries. Please respond there. I wrote: >> http://haskell.org/haskellwiki/ListT_done_right >> and not the broken implementation that comes with mtl. >> (Finally fixed in 6.8? Please?) Ian Lynagh wrote: > If you want to propose that mtl switches to a different definition of > ListT then please see > http://www.haskell.org/haskellwiki/Library_submissions OK, then. This is a major rewrite of this module. So let me open up the topic for discussion even before posting a submission. Do we need to worry about breaking code? Not very much, I suspect. That "monad" really is broken - it's not a monad at all. The problem and its solution have been well known for years. I personally tried using the "standard" ListT for a while, just because it's the standard. Until I ran into enough problems that I finally slapped my forehead and said "forget it". But just in case: Is there anyone reading this who would be hurt by this change and opposes it? Should we provide a more gradual deprecation path (what is it)? Thanks, Yitz From lemming at henning-thielemann.de Sun Oct 14 15:19:24 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sun Oct 14 15:17:42 2007 Subject: building and analysing C structs with Storable In-Reply-To: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> References: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> Message-ID: On Sat, 13 Oct 2007, Adam Langley wrote: > On 10/13/07, Henning Thielemann wrote: >> Are there analogons to ByteString's Put and Get Monads to construct and >> disect binary data in a C struct for exchange with a C program? > > The memory layout of structs depends on the ABI of system. You can > take a guess and write code in the Get and Put monads. Your guess will > probably work pretty well within a single architecture (e.g. x86 or > x86-64). > > However, the portable way to do this is to get the information from > the C compiler, which is the approach that c2hs[1] and friends use. I > would recommend this unless there's some good reason to think > otherwise. (see [2] for the exact hook) > > [1] http://www.cse.unsw.edu.au/~chak/haskell/c2hs/ > [2] http://www.cse.unsw.edu.au/~chak/haskell/c2hs/docu/c2hs-2.html#ss2.8 I do not quite see the need for an extra tool. I thought it must be possible to ship a Haskell compiler with modules that depend on the system's C compiler, just like the modules that are implemented differently for Windows and Unix. Such modules could provide the functionality to create and inspect C structs for exchange with system libraries. From stefanor at cox.net Sun Oct 14 15:23:00 2007 From: stefanor at cox.net (Stefan O'Rear) Date: Sun Oct 14 15:21:20 2007 Subject: building and analysing C structs with Storable In-Reply-To: References: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> Message-ID: <20071014192300.GA4089@localhost.localdomain> On Sun, Oct 14, 2007 at 09:19:24PM +0200, Henning Thielemann wrote: > > On Sat, 13 Oct 2007, Adam Langley wrote: > >> On 10/13/07, Henning Thielemann wrote: >>> Are there analogons to ByteString's Put and Get Monads to construct and >>> disect binary data in a C struct for exchange with a C program? >> >> The memory layout of structs depends on the ABI of system. You can >> take a guess and write code in the Get and Put monads. Your guess will >> probably work pretty well within a single architecture (e.g. x86 or >> x86-64). >> >> However, the portable way to do this is to get the information from >> the C compiler, which is the approach that c2hs[1] and friends use. I >> would recommend this unless there's some good reason to think >> otherwise. (see [2] for the exact hook) >> >> [1] http://www.cse.unsw.edu.au/~chak/haskell/c2hs/ >> [2] http://www.cse.unsw.edu.au/~chak/haskell/c2hs/docu/c2hs-2.html#ss2.8 > > I do not quite see the need for an extra tool. I thought it must be > possible to ship a Haskell compiler with modules that depend on the > system's C compiler, just like the modules that are implemented differently > for Windows and Unix. Such modules could provide the functionality to > create and inspect C structs for exchange with system libraries. You say "the system's C compiler" as if there was only one. It's quite common for UNIXoid systems to have several C compilers installed simultaneously; and if you use the module corresponding to the wrong compiler, you get silent data loss. I wouldn't risk it. 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/libraries/attachments/20071014/3c75a374/attachment.bin From lemming at henning-thielemann.de Sun Oct 14 15:28:45 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sun Oct 14 15:27:02 2007 Subject: building and analysing C structs with Storable In-Reply-To: <20071014192300.GA4089@localhost.localdomain> References: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> <20071014192300.GA4089@localhost.localdomain> Message-ID: On Sun, 14 Oct 2007, Stefan O'Rear wrote: > On Sun, Oct 14, 2007 at 09:19:24PM +0200, Henning Thielemann wrote: >> >> On Sat, 13 Oct 2007, Adam Langley wrote: >> >>> On 10/13/07, Henning Thielemann wrote: >>>> Are there analogons to ByteString's Put and Get Monads to construct and >>>> disect binary data in a C struct for exchange with a C program? >>> >>> The memory layout of structs depends on the ABI of system. You can >>> take a guess and write code in the Get and Put monads. Your guess will >>> probably work pretty well within a single architecture (e.g. x86 or >>> x86-64). >>> >>> However, the portable way to do this is to get the information from >>> the C compiler, which is the approach that c2hs[1] and friends use. I >>> would recommend this unless there's some good reason to think >>> otherwise. (see [2] for the exact hook) >>> >>> [1] http://www.cse.unsw.edu.au/~chak/haskell/c2hs/ >>> [2] http://www.cse.unsw.edu.au/~chak/haskell/c2hs/docu/c2hs-2.html#ss2.8 >> >> I do not quite see the need for an extra tool. I thought it must be >> possible to ship a Haskell compiler with modules that depend on the >> system's C compiler, just like the modules that are implemented differently >> for Windows and Unix. Such modules could provide the functionality to >> create and inspect C structs for exchange with system libraries. > > You say "the system's C compiler" as if there was only one. It's quite > common for UNIXoid systems to have several C compilers installed > simultaneously; and if you use the module corresponding to the wrong > compiler, you get silent data loss. I wouldn't risk it. Do different C compilers on the same platform actually use different layouts for structs? If yes, how can I find out, with which compiler a library was compiled? From stefanor at cox.net Sun Oct 14 15:53:09 2007 From: stefanor at cox.net (Stefan O'Rear) Date: Sun Oct 14 15:51:28 2007 Subject: building and analysing C structs with Storable In-Reply-To: References: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> <20071014192300.GA4089@localhost.localdomain> Message-ID: <20071014195309.GA4174@localhost.localdomain> On Sun, Oct 14, 2007 at 09:28:45PM +0200, Henning Thielemann wrote: > Do different C compilers on the same platform actually use different > layouts for structs? Yes, because there are tradeoffs involved. On x86, the optimal alignment for long double is 8 bytes, but a lot of people aren't crazy about 6 bytes of padding per 10 byte datum, so some compilers default to 4 byte alignment. > If yes, how can I find out, with which compiler a > library was compiled? Ask the person who did the compiling. 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/libraries/attachments/20071014/06b444cd/attachment.bin From lemming at henning-thielemann.de Sun Oct 14 16:05:27 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sun Oct 14 16:06:25 2007 Subject: building and analysing C structs with Storable In-Reply-To: <20071014195309.GA4174@localhost.localdomain> References: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> <20071014192300.GA4089@localhost.localdomain> <20071014195309.GA4174@localhost.localdomain> Message-ID: On Sun, 14 Oct 2007, Stefan O'Rear wrote: > On Sun, Oct 14, 2007 at 09:28:45PM +0200, Henning Thielemann wrote: >> Do different C compilers on the same platform actually use different >> layouts for structs? > > Yes, because there are tradeoffs involved. On x86, the optimal > alignment for long double is 8 bytes, but a lot of people aren't crazy > about 6 bytes of padding per 10 byte datum, so some compilers default to > 4 byte alignment. > >> If yes, how can I find out, with which compiler a >> library was compiled? > > Ask the person who did the compiling. ... but then c2hs cannot do it better (=automatically) than the "compiler dependent Haskell module" approach, can it? From gale at sefer.org Sun Oct 14 16:12:28 2007 From: gale at sefer.org (Yitzchak Gale) Date: Sun Oct 14 16:10:45 2007 Subject: [Haskell-cafe] Let's do ListT right, finally In-Reply-To: <625b74080710141243x5ae2fe81xa767a878644c1f6b@mail.gmail.com> References: <2608b8a80710141200k665403bhfa1ee3cd8ba6692e@mail.gmail.com> <625b74080710141243x5ae2fe81xa767a878644c1f6b@mail.gmail.com> Message-ID: <2608b8a80710141312i4d958bc5h5e19f0f22fc8ecb7@mail.gmail.com> Hi Dan, I wrote: >> That "monad" really is broken - it's not a monad at all. Dan Piponi wrote: > Depending on your point of view, ListT isn't broken. It correctly > transforms commutative monads into monads. Interesting. What do you mean by a "commutative monad"? It can't be a monad with some sort of additional commutative law, because the old ListT doesn't even satisfy the monad laws. Or does it in some sense? > The replacement ListT is usually the monad transformer > I need when I want a List-like monad transformer, > so I'm all for it being in (the standard prelude) mtl. OK. I take this as a +1 vote for the rewrite. > But it seems sad there isn't a place for the old one > to live. OK, do you propose that we keep it and change its name? -Yitz From stefanor at cox.net Sun Oct 14 16:27:13 2007 From: stefanor at cox.net (Stefan O'Rear) Date: Sun Oct 14 16:25:32 2007 Subject: building and analysing C structs with Storable In-Reply-To: References: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> <20071014192300.GA4089@localhost.localdomain> <20071014195309.GA4174@localhost.localdomain> Message-ID: <20071014202713.GA4230@localhost.localdomain> On Sun, Oct 14, 2007 at 10:05:27PM +0200, Henning Thielemann wrote: > > On Sun, 14 Oct 2007, Stefan O'Rear wrote: > >> On Sun, Oct 14, 2007 at 09:28:45PM +0200, Henning Thielemann wrote: >>> Do different C compilers on the same platform actually use different >>> layouts for structs? >> >> Yes, because there are tradeoffs involved. On x86, the optimal >> alignment for long double is 8 bytes, but a lot of people aren't crazy >> about 6 bytes of padding per 10 byte datum, so some compilers default to >> 4 byte alignment. >> >>> If yes, how can I find out, with which compiler a >>> library was compiled? >> >> Ask the person who did the compiling. > > ... but then c2hs cannot do it better (=automatically) than the "compiler > dependent Haskell module" approach, can it? On second thought, you're right. It would work. However, you still need the information in the header file, due to the possibility of things like __attribute__((packed)). c2hs reads and fully parses the headers themselves; so must your TH binding generator. 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/libraries/attachments/20071014/97370535/attachment.bin From dave at zednenem.com Sun Oct 14 16:50:42 2007 From: dave at zednenem.com (David Menendez) Date: Sun Oct 14 16:49:08 2007 Subject: [Haskell-cafe] Let's do ListT right, finally In-Reply-To: <625b74080710141243x5ae2fe81xa767a878644c1f6b@mail.gmail.com> References: <2608b8a80710141200k665403bhfa1ee3cd8ba6692e@mail.gmail.com> <625b74080710141243x5ae2fe81xa767a878644c1f6b@mail.gmail.com> Message-ID: <49a77b7a0710141350w14f57717ge293a2ac899b6f18@mail.gmail.com> On 10/14/07, Dan Piponi wrote: > On 10/14/07, Yitzchak Gale wrote: > > Not very much, I suspect. That "monad" really is broken - > > it's not a monad at all. > > Depending on your point of view, ListT isn't broken. It correctly > transforms commutative monads into monads. The problem is that you > can't express "commutative monad" any differently from "monad" in > Haskell. And so it's been shoehorned into the wrong type class. If desired, we could easily define a class for commutative monads, and then state that ListT m is only a monad if m is a commutative monad. For example, class Monad m => CommutativeMonad m instance (CommutativeMonad m) => Monad (ListT m) where return a = ListT (return [a]) etc. Naturally, it's up to the programmer to guarantee that instances of CommutativeMonad are actually commutative monads. -- Dave Menendez From gale at sefer.org Sun Oct 14 18:02:27 2007 From: gale at sefer.org (Yitzchak Gale) Date: Sun Oct 14 18:00:51 2007 Subject: [Haskell-cafe] Let's do ListT right, finally In-Reply-To: <49a77b7a0710141350w14f57717ge293a2ac899b6f18@mail.gmail.com> References: <2608b8a80710141200k665403bhfa1ee3cd8ba6692e@mail.gmail.com> <625b74080710141243x5ae2fe81xa767a878644c1f6b@mail.gmail.com> <49a77b7a0710141350w14f57717ge293a2ac899b6f18@mail.gmail.com> Message-ID: <2608b8a80710141502l4c52883w1797c1a9ec3fecdb@mail.gmail.com> David Menendez wrote: > If desired, we could easily define a class for commutative monads, and > then state that ListT m is only a monad if m is a commutative monad. If we do that, can I suggest that we use some name other than ListT for that? So far, we seem to agree that most practical applications use the new ListT. Thanks, Yitz From john at repetae.net Sun Oct 14 23:51:13 2007 From: john at repetae.net (John Meacham) Date: Sun Oct 14 23:49:31 2007 Subject: building and analysing C structs with Storable In-Reply-To: References: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> <20071014192300.GA4089@localhost.localdomain> Message-ID: <20071015035113.GJ5340@momenergy.repetae.net> On Sun, Oct 14, 2007 at 09:28:45PM +0200, Henning Thielemann wrote: > >You say "the system's C compiler" as if there was only one. It's quite > >common for UNIXoid systems to have several C compilers installed > >simultaneously; and if you use the module corresponding to the wrong > >compiler, you get silent data loss. I wouldn't risk it. > > Do different C compilers on the same platform actually use different > layouts for structs? If yes, how can I find out, with which compiler a > library was compiled? Not in general, the exact layout of C structs and whatnot is set forth in the ABI spec developed by the chip manufacturer. All compilers must follow it or they cannot even use the same libraries. that said, some compilers out there do sometimes deviate from the ABI, or allow it as an option, but there is generally an accepted ABI for a OS-platform pair. Otherwise things like 'libc' would not be abled to be linked against. for instance the ABI for x86-64 is here http://www.x86-64.org/documentation/abi-0.98.pdf John -- John Meacham - ?repetae.net?john? From ramsdell at mitre.org Mon Oct 15 14:32:44 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Mon Oct 15 14:31:11 2007 Subject: Linking executables and the library of a Cabal package description Message-ID: I'm sure this will be an easy question for those on this list. What do you need to add to a Cabal package description so as to allow an executable in the description to be built from the library it also describes? I searched the Cabal documentation many times, but came up empty handed. John $ make runhaskell Setup.hs build Preprocessing library a-1.0... Preprocessing executables for a-1.0... Building a-1.0... [1 of 1] Compiling A ( A.hs, dist/build/A.o ) /usr/bin/ar: creating dist/build/libHSa-1.0.a exec/Main.hs:3:7: Could not find module `A': Use -v to see a list of the files searched for. make: *** [all] Error 1 $ : after cleaning... $ more `find . -type f ` > ../a.txt $ cat ../a.txt :::::::::::::: ./a.cabal :::::::::::::: Name: a Version: 1.0 Build-Depends: base Exposed-Modules: A Executable: b Main-Is: Main.hs Other-Modules: A Hs-Source-Dirs: exec :::::::::::::: ./Setup.hs :::::::::::::: import Distribution.Simple main = defaultMain :::::::::::::: ./Makefile :::::::::::::: SETUP = runhaskell Setup.hs all: if test ! -f .setup-config; then $(SETUP) configure; fi $(SETUP) build Makefile: @echo make $@ %: force $(SETUP) $@ .PHONY: all force :::::::::::::: ./A.hs :::::::::::::: module A where a :: Int a = 3 :::::::::::::: ./exec/Main.hs :::::::::::::: module Main (main) where import A main :: IO () main = print a $ ghc -h ghc-6.6.1: unrecognised flags: -h Usage: For basic information, try the `--help' option. $ uname -a Linux goo 2.6.22.9-91.fc7 #1 SMP Thu Sep 27 23:10:59 EDT 2007 i686 i686 i386 GNU/Linux $ From josef.svenningsson at gmail.com Mon Oct 15 15:16:38 2007 From: josef.svenningsson at gmail.com (Josef Svenningsson) Date: Mon Oct 15 15:14:52 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <46EEC677.2020000@cs.nott.ac.uk> <8dde104f0709211015y3269ca9bpea3216f5367ac34@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> Message-ID: <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> Lads and lasses of the libraries list, The discussion deadline for the proposal of adding &&& and *** to Data.Tuple is up. Here's a summary of the discussion: * Twan van Laarhoven suggested that we should also add functions corresponding to first and second in Control.Arrow. Benjamin Franksen suggested the names onFst and onSnd. There were no objections against this and I've created a new patch which contains these functions as well. * There is a majority for this patch but it's not overwhelming. Here is the current count: In favour: Neil Mitchell, Don Steward, Twan van Laarhoven, Isaac Dupree and myself Against: Ian Lynagh, Henrik Nilsson * I responded to the objections against this patch but haven't gotten any replies so I can't say we've reached a consensus on this one. Despite the fact that we don't have a consensus I interpret the majority as a go for this patch. Cheers, Josef From conal at conal.net Mon Oct 15 16:39:15 2007 From: conal at conal.net (Conal Elliott) Date: Mon Oct 15 16:37:30 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: <20070920224628.6gmz6wuzsok0s8ow@webmail.spamcop.net> References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <20070920202337.GA3051@localhost.localdomain> <20070920224628.6gmz6wuzsok0s8ow@webmail.spamcop.net> Message-ID: Maybe I've missed the essence of this discussion, but I seem to see to opposite sentiments running through. One is to create additional, *specialized* (for "->") names for existing general arrow operators, rather than using the generalized versions, citing simpler error messages. The other thread is regret over th Haskell 98 committee having done just this kind of specialization (dumbing down) for monads vs lists. My personal vote is for generality of the language & libraries, and address the newbie issue with training-wheels prelude & libs or something like Jon's "subsumes" proposal. People may say that generality of functions like "first" & "second" is unnecessary for their purposes. Personally, I sometimes find that such "unnecessary" generality leads me to discover that an idea I'm working on is much more general (and therefore useful to others) than I'd originally imagined. I agree that the names "onFst" and "onSnd" are easier to interpret than "first" and "second". So let's use those names for the general (Arrow) versions, rather than the specializations. Comments? Cheers, - Conal On 9/20/07, ajb@spamcop.net wrote: > > G'day all. > > Quoting Stefan O'Rear : > > > The reason ++ and mplus is so similar is that they used to be the same; > > (++) *was* the MonadPlus class member. Cale Gibbard explains this as > > {{{Quite a few people on the Haskell 98 committee had an irrational fear > > of polymorphism.}}} > > That's a slight exaggeration. They actually had nightmares involving > trying to explain to their undergraduate students what the inevitable > type error messages meant. > > At a time when Haskell was mostly a teaching/research language, this made > a certain amount of sense. Now that Haskell is officially Cool(tm), the > argument is much weaker. > > Cheers, > Andrew Bromage > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071015/83685aec/attachment.htm From duncan.coutts at worc.ox.ac.uk Mon Oct 15 16:44:05 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Mon Oct 15 16:51:27 2007 Subject: Applicative functor for building C structs with Storable In-Reply-To: References: Message-ID: <1192481045.9844.143.camel@localhost> On Sat, 2007-10-13 at 18:25 +0200, Henning Thielemann wrote: > Are there analogons to ByteString's Put and Get Monads to construct and > disect binary data in a C struct for exchange with a C program? It's certainly possible. As John Meacham says on most platforms there is a standard ABI (ie standard on that platform, not standard between platforms). So one could make a lib on top of Data.Binary.Get/Put that embeds the knowledge about some particular platform's C struct ABI and allows reading/writing them. Like, Data.Binary's Get/Put it could be used just via the Applicative combinators. You could probably also get a good deal of code re-use between different platform ABIs by parametrising by things like alignment, endianness, size of primitives etc. Duncan From bernardy at chalmers.se Mon Oct 15 17:31:37 2007 From: bernardy at chalmers.se (Jean-Philippe Bernardy) Date: Mon Oct 15 17:29:51 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <20070920202337.GA3051@localhost.localdomain> <20070920224628.6gmz6wuzsok0s8ow@webmail.spamcop.net> Message-ID: <953e0d250710151431n28787050g5282ff3d20c441f0@mail.gmail.com> > Comments? +1 -- JP From ross at soi.city.ac.uk Mon Oct 15 19:50:03 2007 From: ross at soi.city.ac.uk (Ross Paterson) Date: Mon Oct 15 19:48:33 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <46EEC677.2020000@cs.nott.ac.uk> <8dde104f0709211015y3269ca9bpea3216f5367ac34@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> Message-ID: <20071015235003.GB2716@soi.city.ac.uk> On Mon, Oct 15, 2007 at 09:16:38PM +0200, Josef Svenningsson wrote: > Despite the fact that we don't have a consensus I interpret the > majority as a go for this patch. In general, I think it's important to try for consensus with the core libraries. The discussion it requires is much more likely to explore the issues. Voting should be the last resort. From ajb at spamcop.net Mon Oct 15 22:54:04 2007 From: ajb at spamcop.net (ajb@spamcop.net) Date: Mon Oct 15 22:52:16 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <20070920202337.GA3051@localhost.localdomain> <20070920224628.6gmz6wuzsok0s8ow@webmail.spamcop.net> Message-ID: <20071015225404.vsgd1vaitc4so8kg@webmail.spamcop.net> G'day all. Quoting Conal Elliott : > Maybe I've missed the essence of this discussion, but I seem to see to > opposite sentiments running through. One is to create additional, > *specialized* (for "->") names for existing general arrow operators, rather > than using the generalized versions, citing simpler error messages. The > other thread is regret over th Haskell 98 committee having done just this > kind of specialization (dumbing down) for monads vs lists. Just for the record, my problem is not that there are specialised versions of things for lists/functions rather than monads/arrows, but rather that some of the "good" names are taken by the specialised versions (e.g. map vs fmap). I should point out the following operations, which are in Data.Graph.Inductive.Query.Monad (so no wonder nobody knows about them): mapFst :: (a -> b) -> (a, c) -> (b, c) mapSnd :: (a -> b) -> (c, a) -> (c, b) (><) :: (a -> b) -> (c -> d) -> (a, c) -> (b, d) How about moving those into Data.Tuple, along with a work-alike for (***)? How about (>*<)? Cheers, Andrew Bromage From bertram.felgenhauer at googlemail.com Tue Oct 16 01:44:54 2007 From: bertram.felgenhauer at googlemail.com (Bertram Felgenhauer) Date: Tue Oct 16 01:43:15 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <20070920202337.GA3051@localhost.localdomain> <20070920224628.6gmz6wuzsok0s8ow@webmail.spamcop.net> Message-ID: <20071016054454.GA4246@zombie.inf.tu-dresden.de> Conal Elliott wrote: > Maybe I've missed the essence of this discussion, but I seem to see to > opposite sentiments running through. One is to create additional, > *specialized* (for "->") names for existing general arrow operators, rather > than using the generalized versions, citing simpler error messages. The > other thread is regret over th Haskell 98 committee having done just this > kind of specialization (dumbing down) for monads vs lists. > I agree that the names "onFst" and "onSnd" are easier to interpret than > "first" and "second". So let's use those names for the general (Arrow) > versions, rather than the specializations. Changing the names of 'first' and 'second' in Control.Arrow is a bad idea, I think. It'll break a lot of packages. Adding functions that conflict with Control.Arrow in Data.Tuple looks far less problematic, because Data.Tuple is quite rarely used. The Prelude reexport of Data.Tuple for nhc should be pruned, however. Data points: Number of occurences of "Data.Tuple" in various packages: (note: not all of these are package imports.) 9 ghc/libraries/base/ 7 ghc/ 5 ghc/testsuite/ 4 lambdabot/ 1 ghc/libraries/template-haskell/ Same for "Control.Arrow": (note: includes non-imports and imports like Control.Arrow.ListArrow, so it's overcounting quite a bit) 174 hxt/ 128 ghc/libraries/arrows/ 21 ghc/testsuite/ 16 lambdabot/ 6 ghc/ 5 ghc/libraries/base/ 2 ghc/libraries/containers/ 1 xmonad/ The sample consists of ghc + testsuite + libraries + extra libraries, HAppS, X11-extras, binary, derive, gtk2hs, haddock, hssdl, http, hxt, jhc, lambdabot, tagsoup, uniplate, xmonad and zlib. Bertram From lemming at henning-thielemann.de Tue Oct 16 03:44:27 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue Oct 16 03:42:43 2007 Subject: building and analysing C structs with Storable In-Reply-To: <20071015035113.GJ5340@momenergy.repetae.net> References: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> <20071014192300.GA4089@localhost.localdomain> <20071015035113.GJ5340@momenergy.repetae.net> Message-ID: On Sun, 14 Oct 2007, John Meacham wrote: > On Sun, Oct 14, 2007 at 09:28:45PM +0200, Henning Thielemann wrote: >>> You say "the system's C compiler" as if there was only one. It's quite >>> common for UNIXoid systems to have several C compilers installed >>> simultaneously; and if you use the module corresponding to the wrong >>> compiler, you get silent data loss. I wouldn't risk it. >> >> Do different C compilers on the same platform actually use different >> layouts for structs? If yes, how can I find out, with which compiler a >> library was compiled? > > Not in general, the exact layout of C structs and whatnot is set forth > in the ABI spec developed by the chip manufacturer. All compilers must > follow it or they cannot even use the same libraries. that said, some > compilers out there do sometimes deviate from the ABI, or allow it as an > option, but there is generally an accepted ABI for a OS-platform pair. > Otherwise things like 'libc' would not be abled to be linked against. This means, if this knowledge is baked into system dependent instances of Storable (especially 'alignment') then generic routines for constructing and disecting C structs are straightforward to implement. Right? From duncan.coutts at worc.ox.ac.uk Tue Oct 16 05:46:26 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Tue Oct 16 05:41:53 2007 Subject: CPP confusion Message-ID: <1192527986.9844.175.camel@localhost> All, There seems to me to be a great deal of confusion with CPP options in Haskell land. We apply the same cpp options to C code and to Haskell code, and there are other tools like pre-processors which make things even more confusing. The latest thing I've stumbled over is HsUnix.h in ghc-6.8. This header file is for defines to use when pre-processing Haskell code. It used to live in the global $GHCLIBDIR/include but now lives in the include dir for the unix package. This is probably the right thing to do, however... How do packages that want to use this include actually use it? If they #include it directly in a .hs file then it'll work since ghc -package unix adds the unix package's include dir to the search path. But what if someone needs to use it in a .hsc file? Well, then it does not work. It does not work because Cabal does not pass these include directories to hsc2hs, since we've relied on ghc to do that. But obviously that does not work for hsc2hs. As it happens the fork of hsc2hs that ghc comes bundled with uses ghc as it's C compiler, so we could in fact pass hsc2hs --cflag=-package --cflag=unix then it does work because hsc2hs ends up passing ghc -package unix and then ghc adds the unix's include dir to the search path when it goes on to call gcc to actually compile the C code. Yay, for many layers of confusion. So what is the solution? We could take advantage of the fact that we know that hsc2hs really uses ghc as it's C compiler and change the flags we pass it when we happen to be building with ghc. On the other hand this all becomes non-portable. In fact this totally relies on a package database to remember what search directories to use when pre-processing dependent packages. In other words it only has a chance of working with ghc at the moment, or nhc in future if/when it implements a package database. What to do? Short and long term suggestions please. Duncan From simonmarhaskell at gmail.com Tue Oct 16 08:08:49 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Tue Oct 16 08:07:06 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <200710162354.37812.dm.maillists@gmail.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> Message-ID: <4714A9D1.8070501@microsoft.com> Several good points have been raised in this thread, and while I might not agree with everything, I think we can all agree on the goal: things shouldn't break so often. So rather than keep replying to individual points, I'd like to make some concrete proposals so we can make progress. 1. Document the version numbering policy. We should have done this earlier, but we didn't. The proposed policy, for the sake of completeness is: x.y where: x changes ==> API changed x constant but y changes ==> API extended only x and y constant ==> API is identical further sub-versions may be added after the x.y, their meaning is package-defined. Ordering on versions is lexicographic, given multiple versions that satisfy a dependency Cabal will pick the latest. 2. Precise dependencies. As suggested by various people in this thread: we change the convention so that dependencies must specify a single x.y API version, or a range of versions with an upper bound. Cabal or Hackage can refuse to accept packages that don't follow this convention (perhaps Hackage is a better place to enforce it, and Cabal should just warn, I'm not sure). Yes, earlier I argued that not specifying precise dependencies allows some packages to continue working even when dependencies change, and that having precise dependencies means that all packages are guaranteed to break when base is updated. However, I agree that specifying precise dependencies is ultimately the right thing, we'll get better errors when things break, There's lots more to discuss, but I think the above 2 proposals are a step in the right direction, agreed? Cheers, Simon From Alistair_Bayley at invescoperpetual.co.uk Tue Oct 16 08:15:28 2007 From: Alistair_Bayley at invescoperpetual.co.uk (Bayley, Alistair) Date: Tue Oct 16 08:13:46 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4714A9D1.8070501@microsoft.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de><47147355.6020109@gmail.com><200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> Message-ID: <125EACD0CAE4D24ABDB4D148C4593DA9049E9015@GBLONXMB02.corp.amvescap.net> > From: libraries-bounces@haskell.org > [mailto:libraries-bounces@haskell.org] On Behalf Of Simon Marlow > > x changes ==> API changed > x constant but y changes ==> API extended only > x and y constant ==> API is identical > > Ordering on versions is lexicographic, given multiple > versions that satisfy a dependency Cabal will pick the latest. Just a minor point, but would mind explaining exactly what lexicographic ordering implies? It appears to me that e.g. version 9.3 of a package would be preferred over version 10.0. That strikes me as counter-intuitive. 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 haskell at list.mightyreason.com Tue Oct 16 08:32:46 2007 From: haskell at list.mightyreason.com (ChrisK) Date: Tue Oct 16 08:31:13 2007 Subject: Proposal: register a package as providing several API versions In-Reply-To: <4714A9D1.8070501@microsoft.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> Message-ID: <4714AF6E.70903@list.mightyreason.com> Simon Marlow wrote: > Several good points have been raised in this thread, and while I might > not agree with everything, I think we can all agree on the goal: things > shouldn't break so often. I have another concrete proposal to avoid things breaking so often. Let us steal from something that works: shared library versioning on unixy systems. On Max OS X, I note that I have, in /usr/lib: > lrwxr-xr-x 1 root wheel 15 Jul 24 2005 libcurl.2.dylib -> libcurl.3.dylib > lrwxr-xr-x 1 root wheel 15 Jul 24 2005 libcurl.3.0.0.dylib -> libcurl.3.dylib > -rwxr-xr-x 1 root wheel 201156 Aug 17 17:14 libcurl.3.dylib > lrwxr-xr-x 1 root wheel 15 Jul 24 2005 libcurl.dylib -> libcurl.3.dylib The above declaratively expresses that libcurl-3.3.0 provides the version 3 API and the version 2 API. This is the capability that should be added to Haskell library packages. Right now a library can only declare a single version number. So if I update hsFoo from 2.1.1 to 3.0.0 then I cannot express whether or not the version 3 API is a superset of (backward compatible with) the version 2 API. Once it is possible to have cabal register the hsFoo-3.0.0 also as hsFoo-2 it will be easy to upgrade to hsFoo. No old programs will fail to compile. Who here knows enough about the ghc-pkg database to say how easy or hard this would be? -- Chris From simonmarhaskell at gmail.com Tue Oct 16 08:45:09 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Tue Oct 16 08:43:34 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <125EACD0CAE4D24ABDB4D148C4593DA9049E9015@GBLONXMB02.corp.amvescap.net> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de><47147355.6020109@gmail.com><200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <125EACD0CAE4D24ABDB4D148C4593DA9049E9015@GBLONXMB02.corp.amvescap.net> Message-ID: <4714B255.7030709@gmail.com> Bayley, Alistair wrote: >> From: libraries-bounces@haskell.org >> [mailto:libraries-bounces@haskell.org] On Behalf Of Simon Marlow >> >> x changes ==> API changed >> x constant but y changes ==> API extended only >> x and y constant ==> API is identical >> >> Ordering on versions is lexicographic, given multiple >> versions that satisfy a dependency Cabal will pick the latest. > > Just a minor point, but would mind explaining exactly what lexicographic > ordering implies? It appears to me that e.g. version 9.3 of a package > would be preferred over version 10.0. That strikes me as > counter-intuitive. The lexicographical ordering would make 10.0 > 9.3. In general, A.B > C.D iff A > C or A == C && B > D. When we say the "latest" version we mean "greatest", implying that version numbers increase with time. Does that help? Cheers, Simon From simonmarhaskell at gmail.com Tue Oct 16 08:57:01 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Tue Oct 16 08:55:20 2007 Subject: Proposal: register a package as providing several API versions In-Reply-To: <4714AF6E.70903@list.mightyreason.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <4714AF6E.70903@list.mightyreason.com> Message-ID: <4714B51D.7060507@gmail.com> ChrisK wrote: > Simon Marlow wrote: >> Several good points have been raised in this thread, and while I might >> not agree with everything, I think we can all agree on the goal: things >> shouldn't break so often. > > I have another concrete proposal to avoid things breaking so often. Let us > steal from something that works: shared library versioning on unixy systems. > > On Max OS X, I note that I have, in /usr/lib: >> lrwxr-xr-x 1 root wheel 15 Jul 24 2005 libcurl.2.dylib -> libcurl.3.dylib >> lrwxr-xr-x 1 root wheel 15 Jul 24 2005 libcurl.3.0.0.dylib -> libcurl.3.dylib >> -rwxr-xr-x 1 root wheel 201156 Aug 17 17:14 libcurl.3.dylib >> lrwxr-xr-x 1 root wheel 15 Jul 24 2005 libcurl.dylib -> libcurl.3.dylib > > The above declaratively expresses that libcurl-3.3.0 provides the version 3 API > and the version 2 API. > > This is the capability that should be added to Haskell library packages. > > Right now a library can only declare a single version number. So if I update > hsFoo from 2.1.1 to 3.0.0 then I cannot express whether or not the version 3 API > is a superset of (backward compatible with) the version 2 API. Certainly, this is something we want to support. However, there's an important difference between shared-library linking and Haskell: in Haskell, a superset of an API is not backwards-compatible, because it has the potential to cause new name clashes. > Once it is possible to have cabal register the hsFoo-3.0.0 also as hsFoo-2 it > will be easy to upgrade to hsFoo. No old programs will fail to compile. > > Who here knows enough about the ghc-pkg database to say how easy or hard this > would be? It could be done using the tricks that Claus just posted and I followed up on. You'd need a separate package for hsFoo-2 that specifies exactly which bits of hsFoo-3 are re-exported. Given some Cabal support and a little extension in GHC, this could be made relatively painless for the library maintainer. Cheers, Simon From Alistair_Bayley at invescoperpetual.co.uk Tue Oct 16 09:01:01 2007 From: Alistair_Bayley at invescoperpetual.co.uk (Bayley, Alistair) Date: Tue Oct 16 08:59:20 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4714B255.7030709@gmail.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de><47147355.6020109@gmail.com><200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <125EACD0CAE4D24ABDB4D148C4593DA9049E9015@GBLONXMB02.corp.amvescap.net> <4714B255.7030709@gmail.com> Message-ID: <125EACD0CAE4D24ABDB4D148C4593DA9049E9017@GBLONXMB02.corp.amvescap.net> > From: Simon Marlow [mailto:simonmarhaskell@gmail.com] > > The lexicographical ordering would make 10.0 > 9.3. In > general, A.B > C.D > iff A > C or A == C && B > D. When we say the "latest" > version we mean > "greatest", implying that version numbers increase with time. > Does that help? Sort of. It's what I'd expect from a sensible version comparison. It's just not something I'd ever choose to call lexicographic ordering. IMO, lexicographgic ordering is a basic string comparision so e.g. max "10.0" "9.3" = "9.3" I'd call what you're doing numeric ordering. Does it have a better name, like version-number-ordering, or section-number-ordering (e.g. Section 3.2.5, Section 3.2.6)? 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 simonmarhaskell at gmail.com Tue Oct 16 09:05:52 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Tue Oct 16 09:04:08 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <125EACD0CAE4D24ABDB4D148C4593DA9049E9017@GBLONXMB02.corp.amvescap.net> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de><47147355.6020109@gmail.com><200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <125EACD0CAE4D24ABDB4D148C4593DA9049E9015@GBLONXMB02.corp.amvescap.net> <4714B255.7030709@gmail.com> <125EACD0CAE4D24ABDB4D148C4593DA9049E9017@GBLONXMB02.corp.amvescap.net> Message-ID: <4714B730.1050503@microsoft.com> Bayley, Alistair wrote: >> From: Simon Marlow [mailto:simonmarhaskell@gmail.com] >> >> The lexicographical ordering would make 10.0 > 9.3. In >> general, A.B > C.D >> iff A > C or A == C && B > D. When we say the "latest" >> version we mean >> "greatest", implying that version numbers increase with time. >> Does that help? > > > Sort of. It's what I'd expect from a sensible version comparison. It's > just not something I'd ever choose to call lexicographic ordering. IMO, > lexicographgic ordering is a basic string comparision so e.g. > > max "10.0" "9.3" = "9.3" > > I'd call what you're doing numeric ordering. Does it have a better name, > like version-number-ordering, or section-number-ordering (e.g. Section > 3.2.5, Section 3.2.6)? I've heard it called lexicographical ordering before, but I'm happy to call it by whatever name induces the least confusion! Cheers, Simon From simonmarhaskell at gmail.com Tue Oct 16 09:19:33 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Tue Oct 16 09:17:53 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: References: Message-ID: <4714BA65.6080202@gmail.com> John D. Ramsdell wrote: > I'm sure this will be an easy question for those on this list. What > do you need to add to a Cabal package description so as to allow an > executable in the description to be built from the library it also > describes? I searched the Cabal documentation many times, but came up > empty handed. > > John > > $ make > runhaskell Setup.hs build > Preprocessing library a-1.0... > Preprocessing executables for a-1.0... > Building a-1.0... > [1 of 1] Compiling A ( A.hs, dist/build/A.o ) > /usr/bin/ar: creating dist/build/libHSa-1.0.a > > exec/Main.hs:3:7: > Could not find module `A': > Use -v to see a list of the files searched for. I'm not sure exactly what problem you're running into here, but my advice would be to split the library off into a separate package. Libraries and executables in the same package are not well supported by Cabal. Really we should fix or remove that feature, my vote would be to remove it. Cheers, Simon From stefanor at cox.net Tue Oct 16 10:09:56 2007 From: stefanor at cox.net (Stefan O'Rear) Date: Tue Oct 16 10:08:16 2007 Subject: [Haskell-cafe] Re: Proposal: register a package as providing several API versions In-Reply-To: <4714B51D.7060507@gmail.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <4714AF6E.70903@list.mightyreason.com> <4714B51D.7060507@gmail.com> Message-ID: <20071016140956.GA3284@localhost.localdomain> On Tue, Oct 16, 2007 at 01:57:01PM +0100, Simon Marlow wrote: > Certainly, this is something we want to support. However, there's an > important difference between shared-library linking and Haskell: in > Haskell, a superset of an API is not backwards-compatible, because it has > the potential to cause new name clashes. This is the case on Unixy .so systems too, because the namespace is flat. If libreadline suddenly starts exporting a symbol named SDL_init, programs which use both readline and sdl will break. I have not seen this happen in practice. (Which might have something to do with the aforementioned name mangling :)) 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/libraries/attachments/20071016/bbca6c34/attachment.bin From apfelmus at quantentunnel.de Tue Oct 16 09:48:19 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Tue Oct 16 10:34:38 2007 Subject: Proposal: register a package as providing several API versions In-Reply-To: <4714AF6E.70903@list.mightyreason.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <4714AF6E.70903@list.mightyreason.com> Message-ID: Simon Marlow wrote: > The proposed policy, for the sake of completeness is: x.y where: > > x changes ==> API changed > x constant but y changes ==> API extended only > x and y constant ==> API is identical > [..] > dependencies must specify a single x.y API version, or a range of > versions with an upper bound. What about x == 0? I mean, the intention of 0 is that 0.1, 0.2 and so on may well overthrow the API. But that's a bikeshed issue. ChrisK wrote: > The above declaratively expresses that libcurl-3.3.0 provides the version 3 API > and the version 2 API. Good idea. In the end, both proposals are based on the same observation: the dependency knows best which of its versions are compatible and which aren't. It's *not* a responsibility of the dependent package to know that. It only has to know one particular version it compiles against. So, it would just specify "I do compile with foobar 1.2" and let foobar 1.3 decide whether it's compatible with 1.2 or not. Given Simon's proposed policy, the answer would be "yes", if it were not for possible name clashes: > However, there's an important difference between shared-library > linking and Haskell: in Haskell, a superset of an API is not > backwards-compatible, because it has the potential to cause new name clashes. Solution? explicit imports? explicit module signatures with subtyping? implicit signature conversion foobar 1.3 -> foobar 1.2 on the package level? Regards, apfelmus From ketil+haskell at ii.uib.no Tue Oct 16 10:37:21 2007 From: ketil+haskell at ii.uib.no (Ketil Malde) Date: Tue Oct 16 10:35:40 2007 Subject: Proposal: register a package as providing several API versions In-Reply-To: <4714AF6E.70903@list.mightyreason.com> (ChrisK's message of "Tue\, 16 Oct 2007 13\:32\:46 +0100") References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <4714AF6E.70903@list.mightyreason.com> Message-ID: <87hckrf7mm.fsf@nmd9999.imr.no> ChrisK writes: > Once it is possible to have cabal register the hsFoo-3.0.0 also as hsFoo-2 it > will be easy to upgrade to hsFoo. No old programs will fail to compile. > Who here knows enough about the ghc-pkg database to say how easy or hard this > would be? Ignoring disk space, I suppose the motivation is that it will ease the user experience by only having to download, compile and install a single package? And perhaps ease the maintenance a bit for the library author, too. One way to do this would be to have multiple .cabal files in the package, with small differences like different version numbering. You can use a Makefile or other hack to automate switching. -k -- If I haven't seen further, it is by standing in the footprints of giants From claus.reinke at talk21.com Tue Oct 16 11:38:34 2007 From: claus.reinke at talk21.com (Claus Reinke) Date: Tue Oct 16 11:36:50 2007 Subject: [Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4 References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de><47147355.6020109@gmail.com><200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> Message-ID: <02c001c8100a$9e9f8170$5b238351@cr3lt> > 1. Document the version numbering policy. agreed. just making everybody's interpretation explicit has already exposed subtle differences, so documenting common ground will help. > We should have done this earlier, but we didn't. The proposed policy, for > the sake of completeness is: x.y where: > > x changes ==> API changed > x constant but y changes ==> API extended only > x and y constant ==> API is identical > > further sub-versions may be added after the x.y, their meaning is > package-defined. Ordering on versions is lexicographic, given multiple > versions that satisfy a dependency Cabal will pick the latest. referring to a haskell function to compute ordering, or to parse version strings into lists of numbers, might remove ambiguities here. for instance, some people use patch-levels as sub-versions, some use dates. also, compare Simon's (S) with Daniel's (D) version: | If the convention for modifying package versions of form x.y.z is: | - increment z for bugfixes/changes that don't alter the interface | - increment y for changes that consist solely of additions to the interface, | parts of the interface may be marked as deprecated | - increment x for changes that include removal of deprecated parts of the | interface version D gives us strictly more information from a version number: just from number differences, we can tell what kind of changes happened to the api. i like that. version S is closer to current practice, which is less informative but psychologically motivated:-) if one does a substantial rewrite without changing the api, or if one adds fundamentally new features without breaking backwards compatibility, one likes to bump the leading number (that is no doubt inspired by commercialism: paying customers are said to prefer higher version numbers, and to focus on new features). corollary: after fixing the version numbering policy (policies?), the implications on usage need to be investigated (sorting wrt dates? does a version number tell us anything about which version can stand in for which dependency?). > 2. Precise dependencies. > > As suggested by various people in this thread: we change the convention so > that dependencies must specify a single x.y API version, or a range of > versions with an upper bound. Cabal or Hackage can refuse to accept > packages that don't follow this convention (perhaps Hackage is a better > place to enforce it, and Cabal should just warn, I'm not sure). > > Yes, earlier I argued that not specifying precise dependencies allows some > packages to continue working even when dependencies change, and that having > precise dependencies means that all packages are guaranteed to break when > base is updated. However, I agree that specifying precise dependencies is > ultimately the right thing, we'll get better errors when things break, agreed. please note, however, that this is likely to flush out issues that have so far been swiped under the carpet. this is a good thing, as it will lead to proposals for making cabal deal with these issues properly (replacing unspecified user complaints with concrete bugs and fixes). but it will increase the noise!-) claus From claus.reinke at talk21.com Tue Oct 16 11:41:11 2007 From: claus.reinke at talk21.com (Claus Reinke) Date: Tue Oct 16 11:39:27 2007 Subject: [Haskell-cafe] Re: Proposal: register a package as providingseveral API versions References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com><4714A9D1.8070501@microsoft.com><4714AF6E.70903@list.mightyreason.com> <4714B51D.7060507@gmail.com> Message-ID: <02c201c8100a$fcb951a0$5b238351@cr3lt> >> I have another concrete proposal to avoid things breaking so often. Let us >> steal from something that works: shared library versioning on unixy systems. indeed!-) there are established workarounds that are needed to make that system work as it does, so it is a good idea to check whether cabal has the means to cover those situations. >> The above declaratively expresses that libcurl-3.3.0 provides the version 3 API >> and the version 2 API. >> >> This is the capability that should be added to Haskell library packages. >> >> Right now a library can only declare a single version number. So if I update >> hsFoo from 2.1.1 to 3.0.0 then I cannot express whether or not the version 3 API >> is a superset of (backward compatible with) the version 2 API. > > Certainly, this is something we want to support. However, there's an > important difference between shared-library linking and Haskell: in > Haskell, a superset of an API is not backwards-compatible, because it has > the potential to cause new name clashes. yes, one would need to define what it means for one api to be compatible with another. even so, i think that permitting a single package to act as a provider for multiple versions of an api is a necessary feature, even more so if loose dependency specs like 'base', or 'base >= 1.0' are going to be discouraged. > It could be done using the tricks that Claus just posted and I followed up > on. You'd need a separate package for hsFoo-2 that specifies exactly which > bits of hsFoo-3 are re-exported. Given some Cabal support and a little > extension in GHC, this could be made relatively painless for the library > maintainer. are those tricks necessary in this specific case? couldn't we have a list/range of versions in the version: field, and let cabal handle the details? aside: what happens if we try to combine two modules M and N that use the same api A, but provided by two different packages P1 and P2? say, M was built when P1 was still around, but when N was built, P2 had replaced P1, still supporting A, but not necessarily with the same internal representation as used in P1. claus From simonmarhaskell at gmail.com Tue Oct 16 11:52:17 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Tue Oct 16 11:50:32 2007 Subject: [Haskell-cafe] Re: Proposal: register a package as providingseveral API versions In-Reply-To: <02c201c8100a$fcb951a0$5b238351@cr3lt> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com><4714A9D1.8070501@microsoft.com><4714AF6E.70903@list.mightyreason.com> <4714B51D.7060507@gmail.com> <02c201c8100a$fcb951a0$5b238351@cr3lt> Message-ID: <4714DE31.6050503@gmail.com> Claus Reinke wrote: >> It could be done using the tricks that Claus just posted and I >> followed up on. You'd need a separate package for hsFoo-2 that >> specifies exactly which bits of hsFoo-3 are re-exported. Given some >> Cabal support and a little extension in GHC, this could be made >> relatively painless for the library maintainer. > > are those tricks necessary in this specific case? couldn't we > have a list/range of versions in the version: field, and let cabal > handle the details? I don't understand what you're proposing here. Surely just writing version: 1.0, 2.0 isn't enough - you need to say what the 1.0 and 2.0 APIs actually *are*, and then wouldn't that require more syntax? I don't yet see a good reason to do this in a single .cabal file instead of two separate packages. The two-package way seems to require fewer extensions to Cabal. > aside: what happens if we try to combine two modules M and N > that use the same api A, but provided by two different packages > P1 and P2? say, M was built when P1 was still around, but when > N was built, P2 had replaced P1, still supporting A, but not necessarily > with the same internal representation as used in P1. Not sure what you mean by "try to combine". A concrete example? Cheers, Simon From claus.reinke at talk21.com Tue Oct 16 12:32:06 2007 From: claus.reinke at talk21.com (Claus Reinke) Date: Tue Oct 16 12:30:20 2007 Subject: [Haskell-cafe] Re: Proposal: register a package asprovidingseveral API versions References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com><4714A9D1.8070501@microsoft.com><4714AF6E.70903@list.mightyreason.com><4714B51D.7060507@gmail.com> <02c201c8100a$fcb951a0$5b238351@cr3lt> <4714DE31.6050503@gmail.com> Message-ID: <035a01c81012$184e0080$5b238351@cr3lt> >> are those tricks necessary in this specific case? couldn't we >> have a list/range of versions in the version: field, and let cabal >> handle the details? > > I don't understand what you're proposing here. Surely just writing > > version: 1.0, 2.0 > > isn't enough - you need to say what the 1.0 and 2.0 APIs actually *are*, > and then wouldn't that require more syntax? I don't yet see a good reason > to do this in a single .cabal file instead of two separate packages. The > two-package way seems to require fewer extensions to Cabal. yes, and no. cabal is currently not symmetric in this: providers specify apis (at the level of exposed modules), clients only specify api numbers as dependencies. the idea was for the cabal file to specify a single provided api, but to register that as sufficient for a list of dependency numbers. so the package would implement the latest api, but could be used by clients expecting either the old or the new api. >> aside: what happens if we try to combine two modules M and N >> that use the same api A, but provided by two different packages >> P1 and P2? say, M was built when P1 was still around, but when >> N was built, P2 had replaced P1, still supporting A, but not necessarily >> with the same internal representation as used in P1. > > Not sure what you mean by "try to combine". A concrete example? lets see - how about this: -- package P-1, Name: P, Version: 0.1 module A(L,f,g) where newtype L a = L [a] f a (L as) = elem a as g as = L as -- package P-2, Name: P, Version: 0.2 module A(L,f,g) where newtype L a = L (a->Bool) f a (L as) = as a g as = L (`elem` as) if i got this right, both P-1 and P-2 support the same api A, right down to types. but while P-1's A and P-2's A are each internally consistent, they can't be mixed. now, consider module M where import A m = g [1,2,3] module N where import A n :: Integer -> A.L Integer -> Bool n = f so, if i install P-1, then build M, then install P-2, then build N, wouldn't N pick up the "newer" P-2, while M would use the "older" P-1? and if so, what happens if we then add module Main where import M import N main = print (n 0 m) i don't seem to be able to predict the result, without actually trying it out. can you?-) i suspect it won't be pretty, though. claus From ross at soi.city.ac.uk Tue Oct 16 14:36:49 2007 From: ross at soi.city.ac.uk (Ross Paterson) Date: Tue Oct 16 14:35:18 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4714A9D1.8070501@microsoft.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> Message-ID: <20071016183649.GA5847@soi.city.ac.uk> On Tue, Oct 16, 2007 at 01:08:49PM +0100, Simon Marlow wrote: > So rather than keep replying to individual points, I'd like to make some > concrete proposals so we can make progress. > > 1. Document the version numbering policy. > > We should have done this earlier, but we didn't. The proposed policy, for > the sake of completeness is: x.y where: > > x changes ==> API changed > x constant but y changes ==> API extended only > x and y constant ==> API is identical > > further sub-versions may be added after the x.y, their meaning is > package-defined. This should be required for at least the GHC boot packages (and encouraged for others). I would make "API extended only" a bit more precise: any module that uses explicit import lists will not be affected by the changes. So one can add classes, types and functions, but not instances (except where either the class or the type is new). You probably can't add data constructors or fields, and have to be careful with new methods. I'd also prefer that major versions used two numbers, because that's common now, it supports the experimental versions 0.x apfelmus mentioned, and it makes it easier to leave room for development versions (possibly using an odd-even scheme). If you make your development repository available, and it contains API changes, you'll want its version number to have a larger major number. From isaacdupree at charter.net Tue Oct 16 15:02:10 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Tue Oct 16 15:01:27 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: <20071015235003.GB2716@soi.city.ac.uk> References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <46EEC677.2020000@cs.nott.ac.uk> <8dde104f0709211015y3269ca9bpea3216f5367ac34@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> <20071015235003.GB2716@soi.city.ac.uk> Message-ID: <47150AB2.3090409@charter.net> Ross Paterson wrote: > On Mon, Oct 15, 2007 at 09:16:38PM +0200, Josef Svenningsson wrote: >> Despite the fact that we don't have a consensus I interpret the >> majority as a go for this patch. > > In general, I think it's important to try for consensus with the core > libraries. The discussion it requires is much more likely to explore > the issues. Voting should be the last resort. I agree. I'm not sure I want to vote for this. Isaac From isaacdupree at charter.net Tue Oct 16 15:25:35 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Tue Oct 16 15:25:10 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <20071016183649.GA5847@soi.city.ac.uk> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016183649.GA5847@soi.city.ac.uk> Message-ID: <4715102F.7030704@charter.net> Ross Paterson wrote: > I would make "API extended only" a bit more precise: any module that uses > explicit import lists will not be affected by the changes. So one can > add classes, types and functions, but not instances (except where either > the class or the type is new). okay > You probably can't add data constructors > or fields, and have to be careful with new methods. If they're exported and new members of existing classes/datatypes, then you can't add them, because they might be imported with "class/typename(..)". (right?) What about semantic changes to the API? Including, adding a default to a class method changes the default from 'undefined', which someone might have relied on as the default (although it seems unlikely). Isaac From dons at galois.com Tue Oct 16 15:44:33 2007 From: dons at galois.com (Don Stewart) Date: Tue Oct 16 15:42:55 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4714A9D1.8070501@microsoft.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> Message-ID: <20071016194433.GF15214@scytale.galois.com> simonmarhaskell: > Several good points have been raised in this thread, and while I might not > agree with everything, I think we can all agree on the goal: things > shouldn't break so often. > > So rather than keep replying to individual points, I'd like to make some > concrete proposals so we can make progress. > > 1. Document the version numbering policy. > > We should have done this earlier, but we didn't. The proposed policy, for > the sake of completeness is: x.y where: > > x changes ==> API changed > x constant but y changes ==> API extended only > x and y constant ==> API is identical > > further sub-versions may be added after the x.y, their meaning is > package-defined. Ordering on versions is lexicographic, given multiple > versions that satisfy a dependency Cabal will pick the latest. > > 2. Precise dependencies. > > As suggested by various people in this thread: we change the convention so > that dependencies must specify a single x.y API version, or a range of > versions with an upper bound. Cabal or Hackage can refuse to accept > packages that don't follow this convention (perhaps Hackage is a better > place to enforce it, and Cabal should just warn, I'm not sure). I agree. >= 1.0 isn't viable in the long term. Rather, a specific list, or bounded range of tested versions seems likely to be more robust. -- Don From ramsdell at mitre.org Tue Oct 16 15:48:21 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Tue Oct 16 15:46:34 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: <4714BA65.6080202@gmail.com> References: <4714BA65.6080202@gmail.com> Message-ID: Simon Marlow writes: > Really we should fix or remove that feature, my vote would be to > remove it. Simon, Thank you for your quick reply. Whatever is done about this feature, I urge a change be made in the documentation as soon as possible. Section two of the Cabal documentation includes Example 3, an example even more complex than the one I sent to the list. It's prominent position in the document suggested to me that this feature is well tested, and that any problem I was having using it was, as they say, user error. I would not have spent so much time rereading the document had I know what I do now. For my application, it is natural to package it as a library and several binaries built on top of the library, so I would like to see this feature supported, but the description of it removed from the documentation until it works. John From ndmitchell at gmail.com Tue Oct 16 15:48:52 2007 From: ndmitchell at gmail.com (Neil Mitchell) Date: Tue Oct 16 15:47:14 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <20071016194433.GF15214@scytale.galois.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016194433.GF15214@scytale.galois.com> Message-ID: <404396ef0710161248r1fe1573t4e99872b3b21bae9@mail.gmail.com> Hi > I agree. >= 1.0 isn't viable in the long term. Rather, a specific list, > or bounded range of tested versions seems likely to be more robust. In general, if it compiles and type checks, it will work. It is rare that an interface stays sufficiently similar that the thing compiles, but then crashes at runtime. Given that, shouldn't the tested versions be something a machine figures out - rather than something each library author has to tend to with every new release of every other library in hackage? Thanks Neil From dons at galois.com Tue Oct 16 16:07:23 2007 From: dons at galois.com (Don Stewart) Date: Tue Oct 16 16:05:35 2007 Subject: Support for high baud rates in the serial binding Message-ID: <20071016200723.GL15214@scytale.galois.com> The attached patch adds support for higher baud rates to System.Posix.Terminal. We need this in practice, so it would be nice to get this into stable. Its a trivial change. -- Don -------------- next part -------------- New patches: [Support for 57600 and 115200 baudrates pweaver@galois.com**20071016191631] { hunk ./System/Posix/Terminal.hsc 337 + | B57600 + | B115200 hunk ./System/Posix/Terminal.hsc 632 +baud2Word B57600 = (#const B57600) +baud2Word B115200 = (#const B115200) hunk ./System/Posix/Terminal.hsc 656 + else if x == (#const B57600) then B57600 + else if x == (#const B115200) then B115200 } Context: [Add basic pseudoterminal support. Bryan O'Sullivan **20070925113330] [check for shm_open/shm_unlink (for archs like OpenBSD without them) Don Stewart **20070916025218] [Add more entries to boring file Ian Lynagh **20070913210721] [Add a boring file Ian Lynagh **20070913204658] [in pPrPr_disableITimers (who made up that name?) call the RTS to disable the timer Simon Marlow **20070912145647 Since we switched to using timer_create() in the RTS, this function has been failing to disables the timer interrupts. This turns out to be the cause of the random framework failures in the test suite. Invoking the RTS to turn off the timer signal is the right thing. ] [TAG ghc-6.8 branched 2007-09-03 Ian Lynagh **20070903155840] Patch bundle hash: bc92611f100215941b46157287c6dcb85b81f2db From isaacdupree at charter.net Tue Oct 16 16:06:27 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Tue Oct 16 16:05:52 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <404396ef0710161248r1fe1573t4e99872b3b21bae9@mail.gmail.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016194433.GF15214@scytale.galois.com> <404396ef0710161248r1fe1573t4e99872b3b21bae9@mail.gmail.com> Message-ID: <471519C3.1090503@charter.net> Neil Mitchell wrote: > Hi > >> I agree. >= 1.0 isn't viable in the long term. Rather, a specific list, >> or bounded range of tested versions seems likely to be more robust. > > In general, if it compiles and type checks, it will work. It is rare > that an interface stays sufficiently similar that the thing compiles, > but then crashes at runtime. True.. GoboLinux's package system records the exact set of versions something compiles with (just for reference), and uses min version bounds (and max bounds where needed) for dependencies. It's always possible for Haskell library implementation-bug-fixes to change relied-on behavior, as discussed in the original ECT description. I agree that compiling and type-checking is a pretty good sign of working. Passing tests (e.g. QuickCheck) could be tested too, where available. If optimizations and unsafePerformIO interact differently, different compiler versions could also affect whether something works correctly, but still compiles... But, the issue here is much more limited: we assume that there were some set of versions of these libraries that DID work, and, that every version of each library, on its own (or with only the libraries it depends on), works. So it might be valuable to record subjectively-working exact version sets, somewhere. Isaac From conal at conal.net Tue Oct 16 17:10:20 2007 From: conal at conal.net (Conal Elliott) Date: Tue Oct 16 17:08:31 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: <20071016054454.GA4246@zombie.inf.tu-dresden.de> References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <20070920202337.GA3051@localhost.localdomain> <20070920224628.6gmz6wuzsok0s8ow@webmail.spamcop.net> <20071016054454.GA4246@zombie.inf.tu-dresden.de> Message-ID: It wouldn't have to be a change. We could add these new synonyms. I'm personally happy with first & second for use with functions & other Arrow types. My main suggestion is that if we want new names for memorability, then let's add them for the general meanings rather than the specialized ones. On 10/15/07, Bertram Felgenhauer wrote: > > > Changing the names of 'first' and 'second' in Control.Arrow is a bad > idea, I think. It'll break a lot of packages. [...] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071016/43518191/attachment.htm From igloo at earth.li Tue Oct 16 18:30:03 2007 From: igloo at earth.li (Ian Lynagh) Date: Tue Oct 16 18:28:14 2007 Subject: CPP confusion In-Reply-To: <1192527986.9844.175.camel@localhost> References: <1192527986.9844.175.camel@localhost> Message-ID: <20071016223002.GA16485@matrix.chaos.earth.li> [can we keep this on just one mailing list please? cabal-devel@ makes most sense to me] On Tue, Oct 16, 2007 at 10:46:26AM +0100, Duncan Coutts wrote: > > The latest thing I've stumbled over is HsUnix.h in ghc-6.8. This header > file is for defines to use when pre-processing Haskell code. It used to > live in the global $GHCLIBDIR/include but now lives in the include dir > for the unix package. This is probably the right thing to do, however... > > How do packages that want to use this include actually use it? If they > #include it directly in a .hs file then it'll work since ghc -package > unix adds the unix package's include dir to the search path. But what if > someone needs to use it in a .hsc file? > > Well, then it does not work. It does not work because Cabal does not > pass these include directories to hsc2hs Is there a reason we can't just fix that, and pass hsc2hs "-Ifoo" for each includes directory "foo" in a package we depend on? > In fact this totally relies on a package > database to remember what search directories to use when pre-processing > dependent packages. In other words it only has a chance of working with > ghc at the moment, or nhc in future if/when it implements a package > database. Yes, I think that at some point all impls will need some sort of package database (or perhaps Cabal could manage a package database itself for some or all impls?). Thanks Ian From duncan.coutts at worc.ox.ac.uk Tue Oct 16 18:52:08 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Tue Oct 16 18:47:51 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: References: Message-ID: <1192575128.9844.212.camel@localhost> On Mon, 2007-10-15 at 14:32 -0400, John D. Ramsdell wrote: > I'm sure this will be an easy question for those on this list. What > do you need to add to a Cabal package description so as to allow an > executable in the description to be built from the library it also > describes? I searched the Cabal documentation many times, but came up > empty handed. > Name: a > Version: 1.0 > Build-Depends: base > Exposed-Modules: A > > Executable: b > Main-Is: Main.hs > Other-Modules: A > Hs-Source-Dirs: exec I think the problem here is search paths. Try adding . to the Hs-Source-Dirs, or alternatively moving everything into the root dir rather than under exec. This smells like a bug in cabal to me. Duncan From duncan.coutts at worc.ox.ac.uk Tue Oct 16 18:55:11 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Tue Oct 16 18:51:04 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <125EACD0CAE4D24ABDB4D148C4593DA9049E9017@GBLONXMB02.corp.amvescap.net> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de><47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <125EACD0CAE4D24ABDB4D148C4593DA9049E9015@GBLONXMB02.corp.amvescap.net> <4714B255.7030709@gmail.com> <125EACD0CAE4D24ABDB4D148C4593DA9049E9017@GBLONXMB02.corp.amvescap.net> Message-ID: <1192575311.9844.214.camel@localhost> On Tue, 2007-10-16 at 14:01 +0100, Bayley, Alistair wrote: > > From: Simon Marlow [mailto:simonmarhaskell@gmail.com] > > > > The lexicographical ordering would make 10.0 > 9.3. In > > general, A.B > C.D > > iff A > C or A == C && B > D. When we say the "latest" > > version we mean > > "greatest", implying that version numbers increase with time. > > Does that help? > > > Sort of. It's what I'd expect from a sensible version comparison. It's > just not something I'd ever choose to call lexicographic ordering. IMO, > lexicographgic ordering is a basic string comparision so e.g. > > max "10.0" "9.3" = "9.3" > > I'd call what you're doing numeric ordering. Does it have a better name, > like version-number-ordering, or section-number-ordering (e.g. Section > 3.2.5, Section 3.2.6)? It's lexicographic ordering on the list of numbers, not on the string representation. ie it's [10, 0] > [9, 3] not "10.0" > "9.3" Internally we represent version numbers as lists of integers and use the default Ord instance. Duncan From dm.maillists at gmail.com Tue Oct 16 18:57:05 2007 From: dm.maillists at gmail.com (Daniel McAllansmith) Date: Tue Oct 16 18:55:26 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4714A9D1.8070501@microsoft.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> Message-ID: <200710171157.06821.dm.maillists@gmail.com> Following is a summary of my thoughts on the matter, in large part so I can figure out what I'm thinking... apologies if it's a bit of a ramble. All comments welcome. Basically - version numbering which differs from Simon's proposal - precise dependencies, I think the same as Simon is proposing - 'permanent' availability of compatible package versions - never a need to update working cabal files - a cabal file installs exactly one version of a package 1) Package version numbers are of the form x.y.z 2) There are version-segment ordering functions cmpX, cmpY, and cmpZ. cmpX and cmpY are globally defined and operate over non-negative integers. Perhaps cmpZ is globally defined, or could be defined per package, or be lexicographic, or... something else. cmpZ could even be a partial ordering I suppose. 3) A cabal file specifies how to build a single version of a package. name: foo version: 2.12.5 This cabal file will build version 2.12.5 of package foo. 4) The dependencies in a cabal file define baseline versions of required packages. depends: bar [3.4] baz [1.2.6, 3] Version 2.12.5 of foo requires a version of bar that is API-compatible with 3.4.0 and a version of baz that is API-compatible with 1.2.6 _or_ API-compatible with 3.0.0. Note that this doesn't imply that baz 3.0.0 is API-compatible with baz 1.2.6 (by definition it is not), it implies that foo is using a subset of the intersection of those two baz APIs. Note that baz 2.y.z would not satisfy the dependency. Perhaps a function was removed with the bump to 2 and restored only with the bump to 3. 5) Package version numbers encode whether one version of a package is API-compatible with another version of the package. Given two versions x.y.z and i.j.k of a package: - x == i && y == j ==> x.y.z is API-identical (hence API-compatible) with i.j.k, cmpZ can be used to determine preferred version - x == i && y > j ==> x.y.z is API-compatible with i.j.k, it has undergone compatibility-preserving changes, x.y.z is preferred to i.j.k - x > i ==> x.y.z is not API-compatible with i.j.k, it has undergone non-compatibility-preserving changes - otherwise ==> x.y.z is not API-compatible with i.j.k, it is a lower version that has less functionality 6) A compatibility-preserving change is generally a change which just adds to the API. Ross Paterson points out adding extra data constructors or instances may not be compatibility-preserving. A non-compatibility-preserving change is generally a change which includes the removal of some part of the API. It might also include changes which leave the API unmodified but significantly degrade usability, e.g. worse time or space performance. 7) Once a version of a package is building successfully it remains available for a 'long time'. If sufficient versions of a package remain available then API-compatible versions of required packages are always available, so the building of packages should never break. An uploaded cabal file should never need to be changed, regardless of what happens to the packages it depends upon. 8) If a version of a package is discovered to have security flaws or serious bugs it should remain available in a quarantined state until a fixed API-compatible version is available. 9) Something (hackage?) could enforce adherence to version numbering policy. At the least any new version uploaded that claims to be API-compatible can be test compiled against packages which depend on it. Something (hackage?) could assist package maintainers in releasing a new version of their package with updated dependency information. Hackage could attempt to compile against non API-compatible versions and report the outcome, for example foo 2.12.5 compiles with the new baz 3.0.0 but not the latest baz 2.y.z Dan From dm.maillists at gmail.com Tue Oct 16 19:04:08 2007 From: dm.maillists at gmail.com (Daniel McAllansmith) Date: Tue Oct 16 19:02:37 2007 Subject: Proposal: register a package as providing several API versions In-Reply-To: <4714AF6E.70903@list.mightyreason.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <4714A9D1.8070501@microsoft.com> <4714AF6E.70903@list.mightyreason.com> Message-ID: <200710171204.10192.dm.maillists@gmail.com> On Wednesday 17 October 2007 01:32, ChrisK wrote: > Simon Marlow wrote: > > Several good points have been raised in this thread, and while I might > > not agree with everything, I think we can all agree on the goal: things > > shouldn't break so often. > > I have another concrete proposal to avoid things breaking so often. Let us > steal from something that works: shared library versioning on unixy > systems. > > On Max OS X, I note that I have, in /usr/lib: > > lrwxr-xr-x 1 root wheel 15 Jul 24 2005 libcurl.2.dylib -> > > libcurl.3.dylib lrwxr-xr-x 1 root wheel 15 Jul 24 2005 > > libcurl.3.0.0.dylib -> libcurl.3.dylib -rwxr-xr-x 1 root wheel > > 201156 Aug 17 17:14 libcurl.3.dylib lrwxr-xr-x 1 root wheel 15 > > Jul 24 2005 libcurl.dylib -> libcurl.3.dylib > > The above declaratively expresses that libcurl-3.3.0 provides the version 3 > API and the version 2 API. > > This is the capability that should be added to Haskell library packages. > > Right now a library can only declare a single version number. So if I > update hsFoo from 2.1.1 to 3.0.0 then I cannot express whether or not the > version 3 API is a superset of (backward compatible with) the version 2 > API. If 3.0.0 is a superset of 2.1.1 why was it necessary to bump to 3.0.0? Why not 2.2.0? From igloo at earth.li Tue Oct 16 19:35:43 2007 From: igloo at earth.li (Ian Lynagh) Date: Tue Oct 16 19:34:01 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4714A9D1.8070501@microsoft.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> Message-ID: <20071016233543.GA17830@matrix.chaos.earth.li> [would it be possible to pick a single list to discuss this on please, so there is no danger of some people missing some subthreads if they aren't on all the lists, or getting messages 3 times if they are?] On Tue, Oct 16, 2007 at 01:08:49PM +0100, Simon Marlow wrote: > > 2. Precise dependencies. While not directly related to this, I have the impression some people want precise dependencies so that things work properly when multiple versions of a library are installed. Personally I'm not a fan of that, as if I have package foo: module Foo where data T package bar: module Bar where bar :: T package baz: module Baz where baz :: T -> () then baz bar might be a type error if I have multiple versions of foo installed and bar and baz have been compiled against different versions. Thanks Ian From ramsdell at mitre.org Tue Oct 16 20:09:14 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Tue Oct 16 20:07:24 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: <1192575128.9844.212.camel@localhost> References: <1192575128.9844.212.camel@localhost> Message-ID: Duncan Coutts writes: > I think the problem here is search paths. Try adding . to the > Hs-Source-Dirs, or alternatively moving everything into the root dir > rather than under exec. If you add . to the Hs-Source-Dirs, you build module A twice, once for the library, and once for the building of b. Notice b is not linked with the library. $ runhaskell Setup.hs build Preprocessing library a-1.0... Preprocessing executables for a-1.0... Building a-1.0... [1 of 1] Compiling A ( A.hs, dist/build/A.o ) /usr/bin/ar: creating dist/build/libHSa-1.0.a [1 of 2] Compiling A ( A.hs, dist/build/b/b-tmp/A.o ) [2 of 2] Compiling Main ( exec/Main.hs, dist/build/b/b-tmp/Main.o ) Linking dist/build/b/b ... $ > This smells like a bug in cabal to me. Time for me to submit a bug report? John From duncan.coutts at worc.ox.ac.uk Tue Oct 16 20:28:45 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Tue Oct 16 20:24:07 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <20071016233543.GA17830@matrix.chaos.earth.li> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016233543.GA17830@matrix.chaos.earth.li> Message-ID: <1192580925.9844.221.camel@localhost> On Wed, 2007-10-17 at 00:35 +0100, Ian Lynagh wrote: > [would it be possible to pick a single list to discuss this on please, > so there is no danger of some people missing some subthreads if they > aren't on all the lists, or getting messages 3 times if they are?] > > On Tue, Oct 16, 2007 at 01:08:49PM +0100, Simon Marlow wrote: > > > > 2. Precise dependencies. > > While not directly related to this, I have the impression some people > want precise dependencies so that things work properly when multiple > versions of a library are installed. > > Personally I'm not a fan of that, as if I have > > package foo: > module Foo where > data T > > package bar: > module Bar where > bar :: T > > package baz: > module Baz where > baz :: T -> () > > then > baz bar > might be a type error if I have multiple versions of foo installed and > bar and baz have been compiled against different versions. Sure, those are not compatible. But we can detect that just by looking at the dependencies of each package. The solution is to distinguish private and public dependencies and to slot packages on their own version numbers and all version numbers of the packages they publicly depend upon. Then in your example we'd just compile another copy of bar or baz using a compatible version of foo. This is what Nix does. Duncan From duncan.coutts at worc.ox.ac.uk Tue Oct 16 20:37:48 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Tue Oct 16 20:33:10 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: References: <1192575128.9844.212.camel@localhost> Message-ID: <1192581468.9844.227.camel@localhost> On Tue, 2007-10-16 at 20:09 -0400, John D. Ramsdell wrote: > Duncan Coutts writes: > > > I think the problem here is search paths. Try adding . to the > > Hs-Source-Dirs, or alternatively moving everything into the root dir > > rather than under exec. > > If you add . to the Hs-Source-Dirs, you build module A twice, once for > the library, and once for the building of b. Notice b is not linked > with the library. Correct. There is a design choice here. If you link with the library you cannot use private modules. If you go direct to the source you can use anything but have to build twice. To link with the lib, use a separate .cabal file that has an executable. > $ runhaskell Setup.hs build > Preprocessing library a-1.0... > Preprocessing executables for a-1.0... > Building a-1.0... > [1 of 1] Compiling A ( A.hs, dist/build/A.o ) > /usr/bin/ar: creating dist/build/libHSa-1.0.a > [1 of 2] Compiling A ( A.hs, dist/build/b/b-tmp/A.o ) > [2 of 2] Compiling Main ( exec/Main.hs, dist/build/b/b-tmp/Main.o ) > Linking dist/build/b/b ... > $ > > > This smells like a bug in cabal to me. > > Time for me to submit a bug report? For the search path problem, yes. So looking at the code, it seems we add '.' as a default, but if you set any hs-src-dirs explicitly then you don't get the '.' default, you have to add that explicitly. Perhaps this is the right behaviour. It's a bit confusing though. Duncan From john at repetae.net Tue Oct 16 21:19:51 2007 From: john at repetae.net (John Meacham) Date: Tue Oct 16 21:18:01 2007 Subject: CPP confusion In-Reply-To: <1192527986.9844.175.camel@localhost> References: <1192527986.9844.175.camel@localhost> Message-ID: <20071017011951.GB4040@momenergy.repetae.net> On Tue, Oct 16, 2007 at 10:46:26AM +0100, Duncan Coutts wrote: > So what is the solution? We could take advantage of the fact that we > know that hsc2hs really uses ghc as it's C compiler and change the flags > we pass it when we happen to be building with ghc. On the other hand > this all becomes non-portable. In fact this totally relies on a package > database to remember what search directories to use when pre-processing > dependent packages. In other words it only has a chance of working with > ghc at the moment, or nhc in future if/when it implements a package > database. > > What to do? > > Short and long term suggestions please. This doesn't really solve the problem, but as a long term goal, it would be nice if hsc2hs could be split off into its own project and distributed independently of any compiler. so, like, people would have haskell-utils: hsc2hs, cabal-install, runhaskell ghc: ghc compiler jhc: jhc compiler all installed and non-conflicting as separate packages (in the sense of OS software packages, not ghc ones) that don't conflict. John -- John Meacham - ?repetae.net?john? From simonmarhaskell at gmail.com Wed Oct 17 05:26:16 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Wed Oct 17 05:24:38 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <404396ef0710161248r1fe1573t4e99872b3b21bae9@mail.gmail.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016194433.GF15214@scytale.galois.com> <404396ef0710161248r1fe1573t4e99872b3b21bae9@mail.gmail.com> Message-ID: <4715D538.9060201@microsoft.com> Neil Mitchell wrote: > Hi > >> I agree. >= 1.0 isn't viable in the long term. Rather, a specific list, >> or bounded range of tested versions seems likely to be more robust. > > In general, if it compiles and type checks, it will work. It is rare > that an interface stays sufficiently similar that the thing compiles, > but then crashes at runtime. Given that, shouldn't the tested versions > be something a machine figures out - rather than something each > library author has to tend to with every new release of every other > library in hackage? The only reasonable way we have to test whether a package compiles with a new version of a dependency is to try compiling it. To do anything else would be duplicating what the compiler does, and risks getting it wrong. But you're right that tools could help a lot: for example, after a base version bump, Hackage could try to build all its packages against the new base to figure out which ones need source code modifications and which can probably just have their .cabal files tweaked to allow the new version. Hackage could tentatively fix the .cabal files itself and/or contact the maintainer. We'll really need some tool to analyse API changes too, otherwise API versioning is too error-prone. Anyone like to tackle this? It shouldn't be too hard using the GHC API.. Cheers, Simon From simonmarhaskell at gmail.com Wed Oct 17 07:54:12 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Wed Oct 17 07:52:49 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <20071016183649.GA5847@soi.city.ac.uk> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016183649.GA5847@soi.city.ac.uk> Message-ID: <4715F7E4.1030002@gmail.com> I've written down the proposed policy for versioning here: http://haskell.org/haskellwiki/Package_versioning_policy It turned out there was a previous page written by Bulat that contained essentially this policy, but it wasn't linked from anywhere which explains why it was overlooked. I took the liberty of rewriting the text. I took into account Ross's suggestions that the major version should have two components, and that we need to be more precise about what it means to extend an API. After a round of editing, we can start to link to this page from everywhere, and start migrating packages to this scheme where necessary. Cheers, Simon From ramsdell at mitre.org Wed Oct 17 09:07:12 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Wed Oct 17 09:05:21 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: <1192581468.9844.227.camel@localhost> References: <1192575128.9844.212.camel@localhost> <1192581468.9844.227.camel@localhost> Message-ID: Duncan Coutts writes: > > If you add . to the Hs-Source-Dirs, you build module A twice, once for > > the library, and once for the building of b. Notice b is not linked > > with the library. > > Correct. > > There is a design choice here. If you link with the library you > cannot use private modules. That's good. I would expect you cannot use the private modules. Otherwise, they wouldn't be very private! One of the points of linking against the library is to ensure clients have access to only the exposed modules. > If you go direct to the source you can use anything but have to > build twice. This is obviously not what anyone would want. > To link with the lib, use a separate .cabal file that has an > executable. This is obviously not what one wants. The executables and the library are conceptually part of the same unit of code. At the very least, the Cabal documentation should up front about this design choice. The text surrounding Example 3 in Section 2 should explain that the generated library is not used to build the executables in the package. Having said all of that, are you sure there is not something I can add to get the behavior I'm looking for? In the real application, the library sources are in src/lib, and one of the executables is in src/basic. Cabal builds the library in dist/build, and builds the executable in dist/build/basic. It seems that everything needed for linking with every executable in my package is in its parent directory. Perhaps the stanza describing an executable has to contain a property for extra-lib-dirs, extra-libraries, or something about includes. Shouldn't I be able to tell the linker for an executable to look in parent of its build directory? John From igloo at earth.li Wed Oct 17 09:39:49 2007 From: igloo at earth.li (Ian Lynagh) Date: Wed Oct 17 09:38:15 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4715F7E4.1030002@gmail.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016183649.GA5847@soi.city.ac.uk> <4715F7E4.1030002@gmail.com> Message-ID: <20071017133949.GA28313@matrix.chaos.earth.li> On Wed, Oct 17, 2007 at 12:54:12PM +0100, Simon Marlow wrote: > I've written down the proposed policy for versioning here: > > http://haskell.org/haskellwiki/Package_versioning_policy This says: If [...] instances were added or removed, then the new A.B must be greater than the previous A.B. This presumably includes changing module imports, or depending on a newer version of a package, which results in the visible instances changing? I think this should be spelt out in the policy. The example: build-depends: mypkg == 2.1.1 should be: build-depends: mypkg >= 2.1.1, mypkg < 2.1.2 with the current dependency syntax/semantics. Thanks Ian From ross at soi.city.ac.uk Wed Oct 17 09:44:19 2007 From: ross at soi.city.ac.uk (Ross Paterson) Date: Wed Oct 17 09:42:40 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4715F7E4.1030002@gmail.com> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016183649.GA5847@soi.city.ac.uk> <4715F7E4.1030002@gmail.com> Message-ID: <20071017134419.GA3146@soi.city.ac.uk> On Wed, Oct 17, 2007 at 12:54:12PM +0100, Simon Marlow wrote: > I've written down the proposed policy for versioning here: > > http://haskell.org/haskellwiki/Package_versioning_policy > > It turned out there was a previous page written by Bulat that contained > essentially this policy, but it wasn't linked from anywhere which explains > why it was overlooked. I took the liberty of rewriting the text. You wrote: > A client that wants to specify that they depend on a particular version > of the API can specify a particular A.B.C and be sure of getting that > API only. For example, build-depends: mypkg-2.1.1 Are you proposing an extension along the lines of that proposed by Thomas (and Bulat, and others), i.e. this would be equivalent to build-depends: mypkg >= 2.1.1 && < 2.1.2 ? The current syntax of mypkg == 2.1.1 would match the initial release but not subsequent patch releases. From igloo at earth.li Wed Oct 17 09:59:07 2007 From: igloo at earth.li (Ian Lynagh) Date: Wed Oct 17 09:57:16 2007 Subject: Let's do ListT right, finally In-Reply-To: <2608b8a80710141200k665403bhfa1ee3cd8ba6692e@mail.gmail.com> References: <2608b8a80710141200k665403bhfa1ee3cd8ba6692e@mail.gmail.com> Message-ID: <20071017135907.GB28313@matrix.chaos.earth.li> On Sun, Oct 14, 2007 at 09:00:59PM +0200, Yitzchak Gale wrote: > > Do we need to worry about breaking code? A http://www.google.com/codesearch for lang:Haskell runListT finds 3 possible uses (that I haven't looked at in any detail): http://www.cs.vu.nl/Strafunski/StrategyLib-3.0.tar.gz (StrategyLib-3.0/src/MonadRun.hs) http://tuukka.iki.fi/tmp/fenfire-hs.imagevob/Utils.hs http://www.mail-archive.com/haskell@haskell.org/msg18629/Exception.hs Thanks Ian From ketil+haskell at ii.uib.no Wed Oct 17 10:03:35 2007 From: ketil+haskell at ii.uib.no (Ketil Malde) Date: Wed Oct 17 10:01:43 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: (John D. Ramsdell's message of "17 Oct 2007 09\:07\:12 -0400") References: <1192575128.9844.212.camel@localhost> <1192581468.9844.227.camel@localhost> Message-ID: <87y7e1n8i0.fsf@nmd9999.imr.no> ramsdell@mitre.org (John D. Ramsdell) writes: >> To link with the lib, use a separate .cabal file that has an >> executable. > This is obviously not what one wants. The executables and the library > are conceptually part of the same unit of code. But with different requirements (i.e. the executable depends on the library, but clearly the library does not depend on itself). I think two cabal files is a good solution, how about using the name as a parameter to Setup.hs? E.g., "./Setup.hs configure foo" would prepare to build using "foo.cabal"? -k -- If I haven't seen further, it is by standing in the footprints of giants From gale at sefer.org Wed Oct 17 10:28:28 2007 From: gale at sefer.org (Yitzchak Gale) Date: Wed Oct 17 10:26:38 2007 Subject: Let's do ListT right, finally In-Reply-To: <20071017135907.GB28313@matrix.chaos.earth.li> References: <2608b8a80710141200k665403bhfa1ee3cd8ba6692e@mail.gmail.com> <20071017135907.GB28313@matrix.chaos.earth.li> Message-ID: <2608b8a80710170728l6ee5ec3fwda29eb5146824ff0@mail.gmail.com> I wrote: >> Do we need to worry about breaking code? Ian Lynagh wrote: > A http://www.google.com/codesearch for > lang:Haskell runListT > finds 3 possible uses (that I haven't looked at in any detail): > > http://www.cs.vu.nl/Strafunski/StrategyLib-3.0.tar.gz (StrategyLib-3.0/src/MonadRun.hs) > http://tuukka.iki.fi/tmp/fenfire-hs.imagevob/Utils.hs > http://www.mail-archive.com/haskell@haskell.org/msg18629/Exception.hs Thanks! Good idea. 1. Strafunski does not appear to have been updated for a while. The latest version listed on their site is 5.0, tested with GHC 6.4.1, released Nov. 2005. 2. Fenfire does seem to be under current development. I'm not sure how this change would affect them. 3. Brian Hulley's Exception.hs is targeted for Haskell', so this should not be a problem. Unless someone is already using it seriously... Anyone know anything more about these, or others? Thanks, Yitz From ramsdell at mitre.org Wed Oct 17 11:33:31 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Wed Oct 17 11:38:33 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: <87y7e1n8i0.fsf@nmd9999.imr.no> References: <1192575128.9844.212.camel@localhost> <1192581468.9844.227.camel@localhost> <87y7e1n8i0.fsf@nmd9999.imr.no> Message-ID: I have a solution to the linking problem, at least for ghc users. I added the -v option to my "runhaskell Setup.hs build" command, and tried adding various properties. The break came when I realized ghc was being given the --make option, and with this option, one cannot satisfy it only with an interface file. Ghc either gets the information it needs from a source file, or from a package. So the trick is to include a package.conf file in your distribution that specifies only relative paths (dist/build). You then add ghc specific options to your Cabal package description. a.cabal --------------------- Name: a Version: 1.0 Build-Depends: base Exposed-Modules: A Executable: b Main-Is: Main.hs Hs-Source-Dirs: exec ghc-options: -package-conf package.conf -package a --------------------- package.conf --------------------- [InstalledPackageInfo {package = PackageIdentifier {pkgName = "a", pkgVersion = Version {versionBranch = [1,0], versionTags = []}}, license = AllRightsReserved, copyright = "", maintainer = "", author = "", stability = "", homepage = "", pkgUrl = "", description = "", category = "", exposed = True, exposedModules = ["A"], hiddenModules = [], importDirs = ["dist/build"], libraryDirs = ["dist/build"], hsLibraries = ["HSa-1.0"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = ["dist/build/include"], includes = [], depends = [PackageIdentifier {pkgName = "base", pkgVersion = Version {versionBranch = [2,1,1], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["/home/ramsdell/proj/b/goo/share/a-1.0/doc/html/a.haddock"], haddockHTMLs = ["/home/ramsdell/proj/b/goo/share/a-1.0/doc/html"]}] --------------------- So it's not a Cabal bug after all! In my package.conf file, can I get away with just specifying the pkgName, exposed, exposedModules, importDirs, libraryDirs, and hsLibraries fields? John From duncan.coutts at worc.ox.ac.uk Wed Oct 17 11:46:40 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Oct 17 11:41:59 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: References: <1192575128.9844.212.camel@localhost> <1192581468.9844.227.camel@localhost> Message-ID: <1192636000.8926.16.camel@localhost> On Wed, 2007-10-17 at 09:07 -0400, John D. Ramsdell wrote: > Duncan Coutts writes: > > > > If you add . to the Hs-Source-Dirs, you build module A twice, once for > > > the library, and once for the building of b. Notice b is not linked > > > with the library. > > > > Correct. > > > > There is a design choice here. If you link with the library you > > cannot use private modules. > > That's good. I would expect you cannot use the private modules. > Otherwise, they wouldn't be very private! One of the points of > linking against the library is to ensure clients have access to only > the exposed modules. > > > If you go direct to the source you can use anything but have to > > build twice. > > This is obviously not what anyone would want. It is exactly what some people want for test programs. They want to be able to access the private modules to test functions that are not exposed in the library public api. > > To link with the lib, use a separate .cabal file that has an > > executable. > > This is obviously not what one wants. The executables and the library > are conceptually part of the same unit of code. > > At the very least, the Cabal documentation should up front about this > design choice. The text surrounding Example 3 in Section 2 should > explain that the generated library is not used to build the > executables in the package. > > Having said all of that, are you sure there is not something I can add > to get the behavior I'm looking for? In the real application, the > library sources are in src/lib, and one of the executables is in > src/basic. Cabal builds the library in dist/build, and builds the > executable in dist/build/basic. It seems that everything needed for > linking with every executable in my package is in its parent > directory. Perhaps the stanza describing an executable has to contain > a property for extra-lib-dirs, extra-libraries, or something about > includes. Shouldn't I be able to tell the linker for an executable to > look in parent of its build directory? They can't share a build directory since there's nothing that says that they build the same modules using the same build flags. you could try and hack it but I wouldn't recommend it. The right way to solve this is to only allow a single library or executable in a package and to make it possible to have multiple .cabal files in a directory. Then they can describe components that may depend on each other and we should be able to build the dependent components automatically. Then it's possible to either make an executable that depend on the library, or to make one that uses the modules directly. Duncan From ramsdell at mitre.org Wed Oct 17 12:57:39 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Wed Oct 17 12:55:47 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: <1192636000.8926.16.camel@localhost> References: <1192575128.9844.212.camel@localhost> <1192581468.9844.227.camel@localhost> <1192636000.8926.16.camel@localhost> Message-ID: Duncan Coutts writes: > The right way to solve this ... I think the right way to solve this is to have Cabal generate a package.conf file in dist/build for development whenever it successfully builds a library. If people want to link executables in package with the library in the package, they need only to add -package-conf dist/build/package.conf -package PACKAGE to their ghc-options property. If they prefer the current behavior, they leave the ghc-options property as it is. With this scheme, everybody gets what they want. John From josef.svenningsson at gmail.com Wed Oct 17 13:51:16 2007 From: josef.svenningsson at gmail.com (Josef Svenningsson) Date: Wed Oct 17 13:49:27 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: <20071015235003.GB2716@soi.city.ac.uk> References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <46EEC677.2020000@cs.nott.ac.uk> <8dde104f0709211015y3269ca9bpea3216f5367ac34@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> <20071015235003.GB2716@soi.city.ac.uk> Message-ID: <8dde104f0710171051jcce93e7j5e44e3ebe7e0d471@mail.gmail.com> On 10/16/07, Ross Paterson wrote: > On Mon, Oct 15, 2007 at 09:16:38PM +0200, Josef Svenningsson wrote: > > Despite the fact that we don't have a consensus I interpret the > > majority as a go for this patch. > > In general, I think it's important to try for consensus with the core > libraries. The discussion it requires is much more likely to explore > the issues. Voting should be the last resort. That makes sense. What course of action do you suggest for this proposal then? I tried to continue the discussion with those who were against it in order to reach a consensus but I haven't gotten any replies. We could of course just drop the proposal but that seems a little unsatisfactory given the clear majority in favor. So, any suggestions for how to proceed? /Josef From igloo at earth.li Wed Oct 17 15:28:07 2007 From: igloo at earth.li (Ian Lynagh) Date: Wed Oct 17 15:26:21 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <1192580925.9844.221.camel@localhost> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016233543.GA17830@matrix.chaos.earth.li> <1192580925.9844.221.camel@localhost> Message-ID: <20071017192807.GA530@matrix.chaos.earth.li> On Wed, Oct 17, 2007 at 01:28:45AM +0100, Duncan Coutts wrote: > On Wed, 2007-10-17 at 00:35 +0100, Ian Lynagh wrote: > > > > package foo: > > module Foo where > > data T > > > > package bar: > > module Bar where > > bar :: T > > > > package baz: > > module Baz where > > baz :: T -> () > > > > then > > baz bar > > might be a type error if I have multiple versions of foo installed and > > bar and baz have been compiled against different versions. > > Sure, those are not compatible. But we can detect that just by looking > at the dependencies of each package. In general it is possible to have 2 different versions of a package in a single program, though, e.g. bar and baz could internally use different versions of a binary-tree package. Thanks Ian From ashley at semantic.org Wed Oct 17 19:21:33 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Wed Oct 17 19:19:50 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: <4710A5FD.7060306@gmail.com> Message-ID: apfelmus wrote: > Twan van Laarhoven wrote: >> I don't see a problem here, if you don't want to use these functions >> then don't import Control.Category. This is similar to the situation >> with adding the arrow operators to Data.Tuple. > > Yes, except that these here are already in the Prelude. But hey, you can > always > > import Control.Category > import Prelude hiding (id,(.)) Should we use id and (.)? It makes it easier to eventually replace the functions in Prelude, if that's a later goal. On the other hand, it means having to write out the hiding as you say. Agree on "Category" as the best name. -- Ashley Yakeley From conal at conal.net Wed Oct 17 21:54:34 2007 From: conal at conal.net (Conal Elliott) Date: Wed Oct 17 21:52:42 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: While we're at it, how about one or more classes in between Category/Compositor and Arrow? One example is DeepArrow (see wiki page [1] and haddock docs [2]). Sample instances: functions and transformers of typed type representations, UIs, code, and pairs of same. I've currently structured DeepArrow as a subclass of Arrow, but most of my instances do not have arr. Any real arrow (including arr) is a DeepArrow (or almost), as the haddock docs mention. DeepArrow could benefit from suggestions (perhaps refactoring), and I would appreciate such input. In any case, I imagine there's some rich, useful structure between Category & Arrow, and now would be a great time to explore it before settling on a new class hierarchy. Cheers, - Conal [1] http://haskell.org/haskellwiki/DeepArrow [2] http://darcs.haskell.org/packages/DeepArrow/doc/html/Control-Arrow-DeepArrow.html On 10/13/07, Ashley Yakeley wrote: > > http://hackage.haskell.org/trac/ghc/ticket/1773 > (darcs patch attached to ticket) > > The Compositor class has two members: > > class Compositor comp where > identity :: comp a a > (>>>) :: comp a b -> comp b c -> comp a c > > with the obvious monoid. Since all Arrows are Compositors, make > Compositor a superclass of Arrow. > > A number of useful types are Compositors but not Arrows: > > 1. Bijections > > data Bijection a b = MkBijection (a -> b) (b -> a) > > 2. Codecs, i.e. encoder/decoder pairs such as charset converters > > data Codec base derived = MkCodec > { > encode :: derived -> base, > decode :: base -> Maybe derived -- or other Monad > } > > utf8 :: Codec [Word8] String > xml :: Codec String XML > > 3. Lenses > These make updatable sections of data structures. > > data Lens s t = MkLens > { > lensGet :: s -> t, > lensPutback :: t -> s -> s > } > > See http://www.cis.upenn.edu/~bcpierce/papers/lenses-etapsslides.pdf > > 4. Reified proofs of type identity > These are useful if you use GADTs and type-witnesses a lot. > > newtype SameType a a' = MkSameType (forall f. f a -> f a') > > Proposal period: two weeks, until 10-27 > > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071017/fb94bf88/attachment.htm From ashley at semantic.org Thu Oct 18 02:04:52 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Thu Oct 18 02:03:06 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: <4716F784.90509@semantic.org> Conal Elliott wrote: > While we're at it, how about one or more classes in between > Category/Compositor and Arrow? One example is DeepArrow (see wiki page > [1] and haddock docs [2]). Sample instances: functions and transformers > of typed type representations, UIs, code, and pairs of same. I've > currently structured DeepArrow as a subclass of Arrow, but most of my > instances do not have arr. Any real arrow (including arr) is a > DeepArrow (or almost), as the haddock docs mention. It sounds like DeepArrow should be a superclass of Arrow. Could you give me a good example of a type that is DeepArrow but doesn't have arr? > DeepArrow could benefit from suggestions (perhaps refactoring), and I > would appreciate such input. In any case, I imagine there's some rich, > useful structure between Category & Arrow, and now would be a great time > to explore it before settling on a new class hierarchy. The only class that comes to mind is a subclass of Category that has arr but not first. But I don't know any instances that aren't Arrows. A full hierarchy might look something like this: class Category cat where id :: cat a a (.) :: cat b c -> cat a b -> cat a c class (Category arr) => PreArrow arr where arr :: (a -> b) -> arr a b class (PreArrow arr) => Arrow arr where arrAp :: arr a (b -> c) -> arr a b -> arr a c (&&&) :: arr a b -> arr a c -> arr a (b,c) class (PreArrow arr) => CoArrow arr where (|||) :: arr a c -> arr b c -> arr (Either a b) c class (Arrow arr,CoArrow arr) => ArrowChoice arr instance (Arrow arr,CoArrow arr) => ArrowChoice arr But I don't know of any useful types that are PreArrow but not Arrow, or CoArrow but not ArrowChoice. -- Ashley Yakeley From apfelmus at quantentunnel.de Thu Oct 18 04:10:43 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Thu Oct 18 04:08:36 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: Conal Elliott wrote: > DeepArrow could benefit from suggestions (perhaps refactoring), and I would > appreciate such input. In any case, I imagine there's some rich, useful > structure between Category & Arrow, and now would be a great time to explore > it before settling on a new class hierarchy. DeepArrow looks pretty much like a category corresponding to Arrows ("Freyd category" but I don't really know what that is) to me (without a functor arr that embeds the category of Haskell functions). I mean, Arrows are just computations a ~> b that allow you to keep around temporary variables with first and second . Unfortunately, the Arrow class does not mention all the needed morphisms to do that since the arr function automatically carries most of them over from the category of Haskell functions. I have the feeling that DeepArrow wants to list exactly those necessary morphisms. Perhaps there is something more to DeepArrows, due to the normal function arrows in types, but maybe not since perhaps the only thing they can act on are tuples. In any case, I'd recommend rethinking DeepArrows, maybe there's some well-known category corresponding to them. For starters, there are cartesian categories, i.e. categories with products: class Cartesian cat where fst :: cat (a,b) a snd :: cat (a,b) b (&&&) :: cat c a -> cat c b -> cat c (a,b) with the conditions fst . (f &&& g) = f snd . (f &&& g) = g Besides fstA and sndA, this gives the morphisms dupA = id &&& id -- the diagonal swapA f = snd f &&& fst f lAssocA f = (fst f &&& fst (snd f)) &&& snd (snd f) rAssocA f = fst (fst f) &&& (fst (snd f) &&& snd f) Interestingly, we already get first :: Cartesian cat => cat a b -> cat (a,d) (b,d) first f = (f . fst &&& id . snd) and second and that would be everything we need for arrows (besides arr ). But IIRC, (&&&) does impose an "order of side effects" on the arguments, so Arrows are more general (less restrictive) than cartesian categories. So, it's some (pre?)monoidal category with extra stuff (Freyd?), I don't know :) Also, I don't know what to do with the Haskell function arrows in the objects (= arguments to ~>) of DeepArrow. Regards, apfelmus From simonmarhaskell at gmail.com Thu Oct 18 04:59:14 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Thu Oct 18 04:57:24 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <20071017134419.GA3146@soi.city.ac.uk> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016183649.GA5847@soi.city.ac.uk> <4715F7E4.1030002@gmail.com> <20071017134419.GA3146@soi.city.ac.uk> Message-ID: <47172062.9040300@microsoft.com> Ross Paterson wrote: > On Wed, Oct 17, 2007 at 12:54:12PM +0100, Simon Marlow wrote: >> I've written down the proposed policy for versioning here: >> >> http://haskell.org/haskellwiki/Package_versioning_policy >> >> It turned out there was a previous page written by Bulat that contained >> essentially this policy, but it wasn't linked from anywhere which explains >> why it was overlooked. I took the liberty of rewriting the text. > > You wrote: > >> A client that wants to specify that they depend on a particular version >> of the API can specify a particular A.B.C and be sure of getting that >> API only. For example, build-depends: mypkg-2.1.1 > > Are you proposing an extension along the lines of that proposed by > Thomas (and Bulat, and others), i.e. this would be equivalent to > build-depends: mypkg >= 2.1.1 && < 2.1.2 ? Yes, I should have mentioned that, thanks. I'll update the page shortly with this suggestion and others. Cheers, Simon From jon.fairbairn at cl.cam.ac.uk Thu Oct 18 06:03:12 2007 From: jon.fairbairn at cl.cam.ac.uk (Jon Fairbairn) Date: Thu Oct 18 06:01:40 2007 Subject: Proposal: Add &&& and *** to Data.Tuple References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <46EEC677.2020000@cs.nott.ac.uk> <8dde104f0709211015y3269ca9bpea3216f5367ac34@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> <20071015235003.GB2716@soi.city.ac.uk> <8dde104f0710171051jcce93e7j5e44e3ebe7e0d471@mail.gmail.com> Message-ID: "Josef Svenningsson" writes: > On 10/16/07, Ross Paterson wrote: >> On Mon, Oct 15, 2007 at 09:16:38PM +0200, Josef Svenningsson wrote: >> > Despite the fact that we don't have a consensus I interpret the >> > majority as a go for this patch. >> >> In general, I think it's important to try for consensus with the core >> libraries. The discussion it requires is much more likely to explore >> the issues. Voting should be the last resort. > That makes sense. What course of action do you suggest for this > proposal then? I tried to continue the discussion with those who were > against it in order to reach a consensus but I haven't gotten any > replies. Well, I wasn't sure what to say! Let me attempt to clarify my position: I dislike the practice of having more than one name for the same thing (and (***):: (Control.Arrow.Arrow a) => a b c -> a b' c' -> a (b, b') (c, c') is, in this sense the same things as a (***):: (b -> c) -> (b' -> c') -> (b, b') -> (c, c')) because it increases the mental load without increasing usefulness. So if a specialised version of *** is introduced, I'd want it to be called ***. On top of that, I don't like having specialised versions "get in the way" of general versions (by using up the name; it may not matter too much for Data.Tuple, but it does matter for map/fmap and others), hence my proposal of "subsuming"; I'd prefer not to introduce specialised versions of *** and &&& without such a mechanism. At risk of reducing the chances of subsumption getting developed into a workable idea, here's an alternative suggestion (for the general issue, as much as for this specific case): change the rules for the scope of names imported and reexported. If module A imports a name from B and re-exports it at a specialised type, and module C imports both A and B, automatically resolve uses of that name to the general version from B. I don't like this idea so much because it strikes me as ad-hoc, but it might work. For this case, what I'm suggesting is that in Data.Tuple, you'd have module Data.Tuple (***,&&&, ...) where import qualified Control.Arrow as C (***):: (b -> c) -> (b' -> c') -> (b, b') -> (c, c')) (***) = (Control.Arrow.***) ...etc... but if someone did this: module Example where import Control.Arrow import Data.Tuple f a b = a *** b the new rules would mean that f got the type of Control.Arrow.*** The only ill effect would be that the error messages might be less helpful (and a user would always have the option of import Control.Arrow hiding ((***)) and getting the other behaviour), because the rules only apply to re-export at a restricted type. -- J?n Fairbairn Jon.Fairbairn@cl.cam.ac.uk From gale at sefer.org Thu Oct 18 06:23:22 2007 From: gale at sefer.org (Yitzchak Gale) Date: Thu Oct 18 06:21:28 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <46EEC677.2020000@cs.nott.ac.uk> <8dde104f0709211015y3269ca9bpea3216f5367ac34@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> <20071015235003.GB2716@soi.city.ac.uk> <8dde104f0710171051jcce93e7j5e44e3ebe7e0d471@mail.gmail.com> Message-ID: <2608b8a80710180323ked6b468lb4275824cd998bb9@mail.gmail.com> May I suggest an alternative? Write a nice wiki article explaining that you do not need to understand arrows to use these functions. Show what the types of the functions are when used in the naive way, and give some nice examples. Explain anything else that a beginner might need to know when using them in this way - like, how to understand weird error messages you might get in GHC or Hugs. Or when it might be necessary to specify a type signature when otherwise you wouldn't have needed to. Put a link to the wiki article in the Haddock docs for Control.Arrow, and in various tutorials. And we are done. -Yitz From twanvl at gmail.com Thu Oct 18 07:36:24 2007 From: twanvl at gmail.com (Twan van Laarhoven) Date: Thu Oct 18 07:34:10 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: <47174538.6000907@gmail.com> Conal Elliott wrote: > While we're at it, how about one or more classes in between > Category/Compositor and Arrow? While looking into functional references I came up with the heirarchy: > class Category (~>) where > id :: a ~> a > (.) :: (b ~> c) -> (a ~> b) -> (a ~> c) > > class Cagegory (~>) => InvArrow (~>) where > -- | invArr f g may only be used if g . f = id = f. g > invArr :: (a -> b) -> (b -> a) -> (a ~> b) > > class InvArrow (~>) => RefArrow (~>) where > refArr :: (a -> b) -> (b -> a -> a) -> (a ~> b) > > class RefArrow (~>) => Arrow (~>) where > arr :: (a -> b) -> (a ~> b) InvArrow allows invertible functions to be lifted to the arrow type, while RefArrow lifts functional references. I am not too happy about the names, but I like the idea itself. apfelmus wrote: > class Cartesian cat where > fst :: cat (a,b) a > snd :: cat (a,b) b > (&&&) :: cat c a -> cat c b -> cat c (a,b) > > with the conditions > > fst . (f &&& g) = f > snd . (f &&& g) = g That is not correct, fst . (f &&& g) also has the side effects of g. > get first and second and that would be everything we need for arrows > (besides arr ). But IIRC, (&&&) does impose an "order of side effects" > on the arguments, so Arrows are more general For the InvArrow of invertible functions: > data Invertible a b = Invertible { fun :: a -> b, inverse :: b -> a } The functions (***), first and second are definable, while fan out, (&&&) is not. What I came up with was: > class Category (~>) => CategoryPair (~>) where > first :: (a ~> b) -> ((a,d) ~> (b,d)) > second :: (a ~> b) -> ((d,a) ~> (d,b)) > (***) :: (a ~> b) -> (c ~> d) -> ((a,c) ~> (b,d)) > swap :: (a,b) ~> (b,a) > class CategoryPair (~>) => CategoryFanOut (~>) where > (&&&) :: (a ~> b) -> (a ~> c) -> (a ~> (b,c)) Exactly the same problem comes up for ArrowChoice and the fan out operator (|||), again the class can be split in two. I am not sure how this should be combined with Conal's deep arrows, perhaps fst and snd could be added to CategoryPair as well. Twan From johan.tibell at gmail.com Thu Oct 18 08:28:03 2007 From: johan.tibell at gmail.com (Johan Tibell) Date: Thu Oct 18 08:26:09 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: <2608b8a80710180323ked6b468lb4275824cd998bb9@mail.gmail.com> References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <46EEC677.2020000@cs.nott.ac.uk> <8dde104f0709211015y3269ca9bpea3216f5367ac34@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> <20071015235003.GB2716@soi.city.ac.uk> <8dde104f0710171051jcce93e7j5e44e3ebe7e0d471@mail.gmail.com> <2608b8a80710180323ked6b468lb4275824cd998bb9@mail.gmail.com> Message-ID: <90889fe70710180528l343f71cfj2d2c160103ca9946@mail.gmail.com> On 10/18/07, Yitzchak Gale wrote: > May I suggest an alternative? > > Write a nice wiki article explaining that you do not > need to understand arrows to use these functions. > > Show what the types of the functions are when > used in the naive way, and give some nice examples. > > Explain anything else that a beginner might need > to know when using them in this way - like, > how to understand weird error messages you > might get in GHC or Hugs. Or when it might > be necessary to specify a type signature when > otherwise you wouldn't have needed to. > > Put a link to the wiki article in the Haddock docs > for Control.Arrow, and in various tutorials. And we are > done. > > -Yitz Sounds like a better and more light weight solution to me. Yes, the import Control.Arrow is a bit of an eyesore to me sometimes as it looks like I'm doing something complicated when I'm not. -- Johan From cgibbard at gmail.com Thu Oct 18 10:03:40 2007 From: cgibbard at gmail.com (Cale Gibbard) Date: Thu Oct 18 10:01:45 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> Hello, just thought I'd finally weigh in on this thread, having given it a little thought. While there are a few nice examples of instances of Compositor, I think I'd prefer to have (.) be what is currently fmap. Note that it generalises ordinary function composition through the functor ((->) e). Also you get a restricted form of the Arrow case through the inclusion of an instance of Functor for ((~>) e) when (~>) is an Arrow. (Taking (<<<) and (>>>) for Compositor is fine as far as I'm concerned though.) The one fear I initially had about this was the guarantee of associativity for function composition, which at first you might think could fail, but in fact this still holds for any functor, and beautifully so: The law for functors: fmap (f . g) x = fmap f (fmap g x) becomes: (f . g) . x = f . (g . x) where on the LHS, the first (.) is the one from ((->) e), function composition proper, and on the RHS, both are for the general case. So associativity still holds in general, and in fact is exactly one of the two laws Functors are supposed to satisfy! Incidentally, fmap id x = x becomes id . x = x Which is another very reasonable thing. Of course, the examples you gave for Compositor are also Functors, but that's not quite the same thing as their Compositor instance. I've tried this out for a while, and it is actually rather nice to use in many cases. Functor application is common enough that having a one-character representation for it is great. Of course, if we did this, we'd still want to keep around a prefix form for Functor application, since there are places where that seems more readable, especially mapping over a datastructure as part of a composition chain. I'd probably want the prefix form to be called map, like it was in versions of Haskell prior to '98. List map can be called lmap or something, if people really want the non-general version so badly. - Cale On 13/10/2007, Ashley Yakeley wrote: > http://hackage.haskell.org/trac/ghc/ticket/1773 > (darcs patch attached to ticket) > > The Compositor class has two members: > > class Compositor comp where > identity :: comp a a > (>>>) :: comp a b -> comp b c -> comp a c > > with the obvious monoid. Since all Arrows are Compositors, make > Compositor a superclass of Arrow. > > A number of useful types are Compositors but not Arrows: > > 1. Bijections > > data Bijection a b = MkBijection (a -> b) (b -> a) > > 2. Codecs, i.e. encoder/decoder pairs such as charset converters > > data Codec base derived = MkCodec > { > encode :: derived -> base, > decode :: base -> Maybe derived -- or other Monad > } > > utf8 :: Codec [Word8] String > xml :: Codec String XML > > 3. Lenses > These make updatable sections of data structures. > > data Lens s t = MkLens > { > lensGet :: s -> t, > lensPutback :: t -> s -> s > } > > See http://www.cis.upenn.edu/~bcpierce/papers/lenses-etapsslides.pdf > > 4. Reified proofs of type identity > These are useful if you use GADTs and type-witnesses a lot. > > newtype SameType a a' = MkSameType (forall f. f a -> f a') > > Proposal period: two weeks, until 10-27 > > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries > From cgibbard at gmail.com Thu Oct 18 10:08:48 2007 From: cgibbard at gmail.com (Cale Gibbard) Date: Thu Oct 18 10:06:53 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> References: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> Message-ID: <89ca3d1f0710180708k7ffcb18cl56edd3655a4092f7@mail.gmail.com> On 18/10/2007, Cale Gibbard wrote: > Of course, the examples you gave for Compositor are also Functors, but > that's not quite the same thing as their Compositor instance. Oops, disregard that remark, I've been awake too long. ;) - Cale From twanvl at gmail.com Thu Oct 18 11:07:03 2007 From: twanvl at gmail.com (Twan van Laarhoven) Date: Thu Oct 18 11:04:47 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> References: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> Message-ID: <47177697.6010105@gmail.com> Cale Gibbard wrote: > Hello, just thought I'd finally weigh in on this thread, having given > it a little thought. > > While there are a few nice examples of instances of Compositor, I > think I'd prefer to have (.) be what is currently fmap. Note that it > generalises ordinary function composition through the functor ((->) > e). Also you get a restricted form of the Arrow case through the > inclusion of an instance of Functor for ((~>) e) when (~>) is an > Arrow. The only argument for having (.) = fmap that I can think of is that the types happen to work out. Using (.)/(?) like this is, as far as I know, not standard usage in any way. In category theory (.) is composition of morphisms, which is exactly what is proposed for the Category class. You have laws like > id . f = f . id = f Of which only the first halve makes sense for fmap. Function composition forms a monoid, this is still true for composition of morphisms, not for functor application. Your argument for seeing (.) as composition on other functors such as lists is that these functors can all be considered a kind of 'functions'. For instance a list is a partial function from the naturals, a pair is a function from unit, etc. I don't think this holds for all functors. What about, say, State or STM? > I've tried this out for a while, and it is actually rather nice to use > in many cases. Functor application is common enough that having a > one-character representation for it is great. Could you give an example where (.) = fmap actually makes sense for a non-reader functor, and has a clear advantage in readability and understandability over fmap/map/(<$>)? With the Category definition you have for instance functional references: > set (head . fst) :: a -> ([a],c) -> ([a],c) > set (head . fst) 'a' ("dbc",123) == ("abc",123) And bijections: > inverse (f . g) == inverse g . inverse f To summarize: fmap may generalize the type of (.), but that is about all it does. This usage is completely non-standard and, at least to me, unintuitive. Twan From ramsdell at mitre.org Thu Oct 18 13:00:24 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Thu Oct 18 12:58:29 2007 Subject: Linking executables and the library of a Cabal package description In-Reply-To: <4714BA65.6080202@gmail.com> References: <4714BA65.6080202@gmail.com> Message-ID: Simon Marlow writes: > Libraries and executables in the same package are not well supported > by Cabal. I'm starting to believe the situation is not as bad as you suggest. I recently realized a post configuration hook can be used to generate the needed package configuration information, so that it is easy to write packages in which executables are linked to the library in the package. I have enclosed the code that does so. There is one remaining problem, you have to figure out how to force executables to be rebuilt when only the library changes. I use a makefile to delete all the binaries before I run Setup.hs build. John $ make find dist -type f -perm /u+x -delete runghc Setup.hs build Preprocessing library a-1.0... Preprocessing executables for a-1.0... Building a-1.0... [1 of 1] Compiling A ( A.hs, dist/build/A.o ) /usr/bin/ar: creating dist/build/libHSa-1.0.a [1 of 1] Compiling Main ( exec/Main.hs, dist/build/b/b-tmp/Main.o ) Linking dist/build/b/b ... $ make clean runghc Setup.hs clean cleaning... $ rm package.conf $ more `find . -type f ` > ../a.txt $ cat ../a.txt :::::::::::::: ./a.cabal :::::::::::::: Name: a Version: 1.0 Build-Depends: base Exposed-Modules: A Executable: b Main-Is: Main.hs Hs-Source-Dirs: exec ghc-options: -package-conf package.conf -package a :::::::::::::: ./Setup.hs :::::::::::::: -- Provide support for executables that link with the library defined -- within a package. The trick is to generate a package description -- that supports the linking phase. import Distribution.Simple import qualified Distribution.InstalledPackageInfo as I import Distribution.PackageDescription import Distribution.Setup import Distribution.Simple.LocalBuildInfo import System.IO import System.Exit -- The package description is generated using a post configuration hook. main = defaultMainWithHooks userHooks userHooks = defaultUserHooks { postConf = conf } -- The hook always runs the old actions last. old = postConf defaultUserHooks -- If the package defines no library, do nothing. conf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode conf args flags pkg bld = case library pkg of Nothing -> old args flags pkg bld Just lib -> confLib lib args flags pkg bld -- Create package descriptions and then print it. confLib :: Library -> Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode confLib lib args flags pkg bld = do let hsLib = "HS" ++ showPackageId (package pkg) let info0 = I.emptyInstalledPackageInfo let info1 = info0 { I.package = package pkg, I.exposed = True, I.exposedModules = exposedModules lib, I.importDirs = [buildDir bld], I.libraryDirs = [buildDir bld], I.hsLibraries = [hsLib] } writeFile "package.conf" (show [info1]) old args flags pkg bld -- A clean hook should be written that deletes package.conf. :::::::::::::: ./Makefile :::::::::::::: SETUP = runghc Setup.hs CONFIGURE = $(SETUP) configure --ghc all: @if test ! -f .setup-config; \ then echo $(CONFIGURE); $(CONFIGURE); fi find dist -type f -perm /u+x -delete $(SETUP) build Makefile: @echo make $@ %: force $(SETUP) $@ .PHONY: all force :::::::::::::: ./A.hs :::::::::::::: module A where a :: Int a = 3 :::::::::::::: ./exec/Main.hs :::::::::::::: module Main (main) where import A main :: IO () main = print a From flippa at flippac.org Thu Oct 18 15:58:27 2007 From: flippa at flippac.org (Philippa Cowderoy) Date: Thu Oct 18 15:56:40 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <4716F784.90509@semantic.org> References: <4716F784.90509@semantic.org> Message-ID: On Wed, 17 Oct 2007, Ashley Yakeley wrote: > Conal Elliott wrote: > > DeepArrow could benefit from suggestions (perhaps refactoring), and I > > would appreciate such input. In any case, I imagine there's some rich, > > useful structure between Category & Arrow, and now would be a great time > > to explore it before settling on a new class hierarchy. > > The only class that comes to mind is a subclass of Category that has arr > but not first. The other way round (first but not arr) is arguably more useful - it's the class of embedded first-order compositional languages and with a small amount of work we can even define applicative sugar akin to proc or do. There are all kinds of tasks that can be a big win for! -- flippa@flippac.org There is no magic bullet. There are, however, plenty of bullets that magically home in on feet when not used in exactly the right circumstances. From duncan.coutts at worc.ox.ac.uk Thu Oct 18 18:53:46 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Oct 18 18:48:58 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <20071017192807.GA530@matrix.chaos.earth.li> References: <20071014140922.GA25871@matrix.chaos.earth.li> <20071015203802.GA3229@web.de> <47147355.6020109@gmail.com> <200710162354.37812.dm.maillists@gmail.com> <4714A9D1.8070501@microsoft.com> <20071016233543.GA17830@matrix.chaos.earth.li> <1192580925.9844.221.camel@localhost> <20071017192807.GA530@matrix.chaos.earth.li> Message-ID: <1192748026.8926.35.camel@localhost> On Wed, 2007-10-17 at 20:28 +0100, Ian Lynagh wrote: > On Wed, Oct 17, 2007 at 01:28:45AM +0100, Duncan Coutts wrote: > > On Wed, 2007-10-17 at 00:35 +0100, Ian Lynagh wrote: > > > might be a type error if I have multiple versions of foo installed and > > > bar and baz have been compiled against different versions. > > > > Sure, those are not compatible. But we can detect that just by looking > > at the dependencies of each package. > > In general it is possible to have 2 different versions of a package in a > single program, though, e.g. bar and baz could internally use different > versions of a binary-tree package. Right, but only if those packages are used privately, ie such that types from the dependent packages do not leak into their public api, since that would allow the type error you originally pointed out. If we distinguish private use of a dependent package then we know it does not matter if we end up using two versions of it in a single program. Duncan From cgibbard at gmail.com Thu Oct 18 21:41:16 2007 From: cgibbard at gmail.com (Cale Gibbard) Date: Thu Oct 18 21:39:21 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <47177697.6010105@gmail.com> References: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> <47177697.6010105@gmail.com> Message-ID: <89ca3d1f0710181841je0fd088w284a8be3698a760b@mail.gmail.com> On 18/10/2007, Twan van Laarhoven wrote: > Cale Gibbard wrote: > > > Hello, just thought I'd finally weigh in on this thread, having given > > it a little thought. > > > > While there are a few nice examples of instances of Compositor, I > > think I'd prefer to have (.) be what is currently fmap. Note that it > > generalises ordinary function composition through the functor ((->) > > e). Also you get a restricted form of the Arrow case through the > > inclusion of an instance of Functor for ((~>) e) when (~>) is an > > Arrow. > > The only argument for having (.) = fmap that I can think of is that the > types happen to work out. Using (.)/(?) like this is, as far as I know, > not standard usage in any way. We're already not exactly like mathematics in many ways. Having (.) be a symbol for functorial lifting is completely reasonable notationally. > > In category theory (.) is composition of morphisms, which is exactly > what is proposed for the Category class. You have laws like > > id . f = f . id = f > Of which only the first halve makes sense for fmap. > > Function composition forms a monoid, this is still true for composition > of morphisms, not for functor application. Well, functor application is still a kind of monoid action, which is basically what that associativity law says, and of course, you get an analogue to f . id = f whenever your functor has an appropriate analogue to id: the f on the right becomes something akin to pure f, in the applicative or Hughes Arrow sense. > > Your argument for seeing (.) as composition on other functors such as > lists is that these functors can all be considered a kind of > 'functions'. For instance a list is a partial function from the > naturals, a pair is a function from unit, etc. I don't think this holds > for all functors. What about, say, State or STM? Well, that part is slightly beside the point, but yeah, State and STM are easy. It's just application of the function to the eventual result of the computation, which is a kind of generalisation of what composition does in the function case. > > > I've tried this out for a while, and it is actually rather nice to use > > in many cases. Functor application is common enough that having a > > one-character representation for it is great. > > Could you give an example where (.) = fmap actually makes sense for a > non-reader functor, and has a clear advantage in readability and > understandability over fmap/map/(<$>)? Sure, it's useful almost anywhere you might make use of any one of those. It's nice because it's visually quiet while still providing some kind of notice that you're lifting the map in question using the functor. > With the Category definition you have for instance functional references: > > set (head . fst) :: a -> ([a],c) -> ([a],c) > > set (head . fst) 'a' ("dbc",123) == ("abc",123) Clearly head and fst here are not the ones in the Prelude! > And bijections: > > inverse (f . g) == inverse g . inverse f > > > To summarize: fmap may generalize the type of (.), but that is about all > it does. This usage is completely non-standard and, at least to me, > unintuitive. It becomes quite intuitive with a little use. You eventually just regard it as being the same as fmap, but slightly nicer in that the fusion law is made transparent by the notation. It's actually already quite common to define notations in mathematics where application of a function to a structure is functorially lifted. Probably the most common case of this is with the powerset functor. f(S), where S is a subset of the domain of f typically is used to mean the image of S under f: {y : y = f(s), s in S}. Rather than redefining function application polymorphically, this just uses a dot to identify that lifting is taking place. When I first noticed this back several months ago, I was a bit hesitant to propose it. However, functorial application (especially for lists) and function composition being arguably the two most important operations in functional programming, it's rather nice to see that they are really instances of the same thing, and to be able to give them both the nicest possible operator symbol. - Cale From apfelmus at quantentunnel.de Fri Oct 19 04:30:14 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Fri Oct 19 04:28:02 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <47174538.6000907@gmail.com> References: <47174538.6000907@gmail.com> Message-ID: Twan van Laarhoven wrote: > apfelmus wrote: >> class Cartesian cat where >> fst :: cat (a,b) a >> snd :: cat (a,b) b >> (&&&) :: cat c a -> cat c b -> cat c (a,b) >> >> with the conditions >> >> fst . (f &&& g) = f >> snd . (f &&& g) = g > > That is not correct, fst . (f &&& g) also has the side effects of g. Well, your remark indeed shows that it'ss not correct in the sense that Arrows aren't cartesian categories, that's why I mumbled something about Freyd-categories. Scary details here http://cs.ioc.ee/~tarmo/monads-more/monads-more-3.pdf but it can be stated a bit simpler, I guess. Regards, apfelmus From ashley at semantic.org Fri Oct 19 04:48:18 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Fri Oct 19 04:46:21 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: <4716F784.90509@semantic.org> Message-ID: <47186F52.20402@semantic.org> Philippa Cowderoy wrote: > The other way round (first but not arr) is arguably more useful - it's the > class of embedded first-order compositional languages and with a small > amount of work we can even define applicative sugar akin to proc or do. > There are all kinds of tasks that can be a big win for! Could you write out the class? Is it the same as DeepArrow? -- Ashley From apfelmus at quantentunnel.de Fri Oct 19 05:01:42 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Fri Oct 19 04:59:24 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> References: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> Message-ID: Cale Gibbard wrote: > fmap (f . g) x = fmap f (fmap g x) > becomes: > (f . g) . x = f . (g . x) > fmap id x = x > becomes > id . x = x Nice! Can this be done in Category Theory, too? I mean, it would be nice to internalize morphism, functors, natural transformations, ... in one and the same category (like Hask), so there's less fuss. I.e. given a category C , construct an category C\infty that is basically the same as C but also contains the functors, natural transformations etc. of C and has this handy infix (.) operation. > I've tried this out for a while, and it is actually rather nice to use > in many cases. Functor application is common enough that having a > one-character representation for it is great. I can't remember using fmap/liftM very often, but if I use `liftM`, then often in infix notation, so and infix symbol for fmap is indeed a very good idea. However, (.) in that role confuses me because I always think that the right argument should be function. In other words, I'm fine with print . sum . map read . lines . readFile ( with a hypothetical instance Category (a -> IO b) ) while your proposal gives rise to show . sum . map read . lines . readFile "foo.txt" which makes me feel ill. In my opinion, function composition and function application should have separate notations. The new (.) blurs these lines too much for my taste (i.e. (.) :: (a -> b) -> Id a -> Id b) and I prefer <$> (or even plain $) for fmap . In addition, I always longed for categories without an embedding (a -> b) -> c a b , they keep popping up while I program in Haskell and more often than I need infix fmap . Also, I dislike (>>>) or (<<<) and very much prefer (.) for them. But in the end, we can have both worlds of (.) without name clash! Simply annotate functors with the category they operate on :) class Category c => Functor c f where (.) :: c a b -> f a -> f b instance Functor (->) [] where (.) = map instance Category c => Functor c (c d) where (.) = `o` Regards, apfelmus From jon.fairbairn at cl.cam.ac.uk Fri Oct 19 05:43:21 2007 From: jon.fairbairn at cl.cam.ac.uk (Jon Fairbairn) Date: Fri Oct 19 05:41:37 2007 Subject: Proposal: Add &&& and *** to Data.Tuple References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <46EEC677.2020000@cs.nott.ac.uk> <8dde104f0709211015y3269ca9bpea3216f5367ac34@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> <20071015235003.GB2716@soi.city.ac.uk> <8dde104f0710171051jcce93e7j5e44e3ebe7e0d471@mail.gmail.com> <2608b8a80710180323ked6b468lb4275824cd998bb9@mail.gmail.com> Message-ID: "Yitzchak Gale" writes: > May I suggest an alternative? > > Write a nice wiki article explaining that you do not > need to understand arrows to use these functions. > > Show what the types of the functions are when > used in the naive way, and give some nice examples. > > Explain anything else that a beginner might need > to know when using them in this way - like, > how to understand weird error messages you > might get in GHC or Hugs. Or when it might > be necessary to specify a type signature when > otherwise you wouldn't have needed to. > > Put a link to the wiki article in the Haddock docs > for Control.Arrow, and in various tutorials. And we are > done. In a sense, yes. I'd be most happy if fmap was called map and so on and people just learned to cope. But there are educators with strong arguments against that, and this particular topic is an instance of the same thing, so some wider solution is needed. I suppose what I'm saying is that I'd prefer that the thing were not done until we have the wider solution, but if 'twere done 'twere well 'twere done by re-exporting the same names from Data.Tuple /imported from Control.Arrow/ (and requiring sophisticated people to use "hiding ((***),(&&&))" if they ever need to import Data.Tuple as when using Control.Monad). -- J?n Fairbairn Jon.Fairbairn@cl.cam.ac.uk From nhn at Cs.Nott.AC.UK Fri Oct 19 06:09:12 2007 From: nhn at Cs.Nott.AC.UK (Henrik Nilsson) Date: Fri Oct 19 06:08:10 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <20070917175122.GA8398@matrix.chaos.earth.li> <46EEC677.2020000@cs.nott.ac.uk> <8dde104f0709211015y3269ca9bpea3216f5367ac34@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> <20071015235003.GB2716@soi.city.ac.uk> <8dde104f0710171051jcce93e7j5e44e3ebe7e0d471@mail.gmail.com> <2608b8a80710180323ked6b468lb4275824cd998bb9@mail.gmail.com> Message-ID: <47188248.3040309@cs.nott.ac.uk> Hi all, Sorry for my silence. Just too much to do to keep up. So, with the risk of stating what has already been covered, my concerns are that like Jon I find the reuse of names unfortunate, especially if it is done in what appears to be a very central module. Moreover, as functions are perfectly legitimate arrow instances, I don't really see the point of it all, and I remain unconvinced by the argument that importing Control.Arrow somehow is complicated and scary. It may well be, of course, that the current class hierarchy isn't factored the right way, i.e. that operations like &&& and *** should live some place else entirely. (This wouldn't be the first instance of such problems.) That's a somewhat orthogonal discussion, though. But defining &&& and *** in more places certainly isn't going to help. Again, my apologies if my answer is uninformed and/or missing key points of the discussion. Best, /henrik -- Henrik Nilsson School of Computer Science and Information Technology The University of Nottingham nhn@cs.nott.ac.uk 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 bulat.ziganshin at gmail.com Fri Oct 19 15:49:56 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Fri Oct 19 15:48:32 2007 Subject: building and analysing C structs with Storable In-Reply-To: <20071015035113.GJ5340@momenergy.repetae.net> References: <396556a20710131034s662ecd15he56c6c9570938558@mail.gmail.com> <20071014192300.GA4089@localhost.localdomain> <20071015035113.GJ5340@momenergy.repetae.net> Message-ID: <225226669.20071019234956@gmail.com> Hello John, Monday, October 15, 2007, 7:51:13 AM, you wrote: >> >You say "the system's C compiler" as if there was only one. It's quite >> >common for UNIXoid systems to have several C compilers installed >> >simultaneously; and if you use the module corresponding to the wrong >> >compiler, you get silent data loss. I wouldn't risk it. >> > Not in general, the exact layout of C structs and whatnot is set forth > in the ABI spec developed by the chip manufacturer. All compilers must > follow it or they cannot even use the same libraries. that said, some > compilers out there do sometimes deviate from the ABI, or allow it as an > option, but there is generally an accepted ABI for a OS-platform pair. > Otherwise things like 'libc' would not be abled to be linked against. > for instance the ABI for x86-64 is here > http://www.x86-64.org/documentation/abi-0.98.pdf i bet that this document was written exactly because "old systems" (read: i386) had so much confusion :)) i definitely know that it was a great problem in win32 compilers -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From cgibbard at gmail.com Fri Oct 19 18:03:15 2007 From: cgibbard at gmail.com (Cale Gibbard) Date: Fri Oct 19 18:01:17 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> Message-ID: <89ca3d1f0710191503u3b63c41amf46ba55625f26a68@mail.gmail.com> On 19/10/2007, apfelmus wrote: > Cale Gibbard wrote: > > fmap (f . g) x = fmap f (fmap g x) > > becomes: > > (f . g) . x = f . (g . x) > > fmap id x = x > > becomes > > id . x = x > > Nice! Can this be done in Category Theory, too? I mean, it would be nice > to internalize morphism, functors, natural transformations, ... in one > and the same category (like Hask), so there's less fuss. I.e. given a > category C , construct an category C\infty that is basically the same > as C but also contains the functors, natural transformations etc. of > C and has this handy infix (.) operation. Well, sort of, though they typically don't use quite that notation for it. There is work on generalising to higher-dimensional categories, where, for example, treating Cat as a 2-category, you have 0-cells which are categories, 1-cells, which are functors, and 2-cells, which are natural transformations between parallel functors. Natural transformations support two kinds of composition, called vertical (which is the usual one) and horizontal composition, so typically some separate notation, like an asterisk, is chosen for horizontal composition. > > > I've tried this out for a while, and it is actually rather nice to use > > in many cases. Functor application is common enough that having a > > one-character representation for it is great. > > I can't remember using fmap/liftM very often, but if I use `liftM`, then > often in infix notation, so and infix symbol for fmap is indeed a very > good idea. > > However, (.) in that role confuses me because I always think that the > right argument should be function. In other words, I'm fine with > > print . sum . map read . lines . readFile > > ( with a hypothetical instance Category (a -> IO b) ) while your > proposal gives rise to > > show . sum . map read . lines . readFile "foo.txt" > > which makes me feel ill. Hmm, it doesn't really bother me so much. There are a number of ways to read that. At the two extremes, you can read it as the composition (show . sum . map read . lines) being functorially applied to (readFile "foo.txt), or as a chain of functor applications with IO as the functor at the other extreme. Of course, these are equal. > In my opinion, function composition and > function application should have separate notations. The new (.) blurs > these lines too much for my taste (i.e. (.) :: (a -> b) -> Id a -> Id b) > and I prefer <$> (or even plain $) for fmap . > > > In addition, I always longed for categories without an embedding (a -> > b) -> c a b , they keep popping up while I program in Haskell and more > often than I need infix fmap . Also, I dislike (>>>) or (<<<) and very > much prefer (.) for them. > > > But in the end, we can have both worlds of (.) without name clash! > Simply annotate functors with the category they operate on :) > > class Category c => Functor c f where > (.) :: c a b -> f a -> f b > > instance Functor (->) [] where > (.) = map > > instance Category c => Functor c (c d) where > (.) = `o` > > > Regards, > apfelmus Of course! That's quite a nice idea. Then we can have monads over an arbitrary category on the objects of Hask as well, though I'm not sure of too many examples yet, apart from the obvious one for Arrows. class Functor c m => Monad c m where return :: a -> m a join :: m (m a) -> m a (>>=) :: m a -> (a -> m b) -> m b x >>= f = join (f . x) join x = x >>= id - Cale From cgibbard at gmail.com Fri Oct 19 18:05:46 2007 From: cgibbard at gmail.com (Cale Gibbard) Date: Fri Oct 19 18:03:49 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <89ca3d1f0710191503u3b63c41amf46ba55625f26a68@mail.gmail.com> References: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> <89ca3d1f0710191503u3b63c41amf46ba55625f26a68@mail.gmail.com> Message-ID: <89ca3d1f0710191505w14e787dbh5faac9f59e9544a2@mail.gmail.com> On 19/10/2007, Cale Gibbard wrote: Er, or should that be: class Functor c m => Monad c m where return :: a -> m a join :: m (m a) -> m a (>>=) :: m a -> (c a (m b)) -> m b x >>= f = join (f . x) join x = x >>= id - Cale From apfelmus at quantentunnel.de Sat Oct 20 03:27:18 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Sat Oct 20 03:25:04 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <89ca3d1f0710191505w14e787dbh5faac9f59e9544a2@mail.gmail.com> References: <89ca3d1f0710180703m3e274380j26d1c27bafc523b3@mail.gmail.com> <89ca3d1f0710191503u3b63c41amf46ba55625f26a68@mail.gmail.com> <89ca3d1f0710191505w14e787dbh5faac9f59e9544a2@mail.gmail.com> Message-ID: Cale Gibbard wrote: > > class Functor c m => Monad c m where > return :: a -> m a > join :: m (m a) -> m a > (>>=) :: m a -> (c a (m b)) -> m b > x >>= f = join (f . x) > join x = x >>= id We may even want return :: c () a -> m a since there doesn't need to be an embedding from (all of) Hask to c , i.e. the domain and image types may well be phantoms. Regards, apfelmus From magnus at therning.org Sat Oct 20 08:46:23 2007 From: magnus at therning.org (Magnus Therning) Date: Sat Oct 20 08:44:23 2007 Subject: Data encoding library In-Reply-To: References: <20071013182645.GA3418@die.therning.org> <20071014165059.GA3438@die.therning.org> Message-ID: <20071020124623.GC3419@die.therning.org> I've updated the Wiki page. I think I've decided on the API I want. Basically the old one remains and one similar to Ashley's has been added. Phantom types are cute and can easily be added in the future if needed. Once I've changed the type for decode to allow for failure I'll upload the code to code.haskell.org/dataenc. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus?therning?org Jabber: magnus?therning?gmail?com http://therning.org/magnus -------------- 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/libraries/attachments/20071020/507bbc7f/attachment.bin From conal at conal.net Sat Oct 20 21:42:46 2007 From: conal at conal.net (Conal Elliott) Date: Sat Oct 20 21:40:46 2007 Subject: Data.Stream conflict Message-ID: The "arrows" and "Stream" package both provide a Data.Stream module. I'd like to use the latter, which is much more filled out, but ghc is finding and choosing the former. Are there mechanisms for resolving this kind of conflict? - Conal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071020/ab90785a/attachment.htm From ross at soi.city.ac.uk Sat Oct 20 22:23:45 2007 From: ross at soi.city.ac.uk (Ross Paterson) Date: Sat Oct 20 22:21:44 2007 Subject: Data.Stream conflict In-Reply-To: References: Message-ID: <20071021022345.GA10432@soi.city.ac.uk> On Sat, Oct 20, 2007 at 06:42:46PM -0700, Conal Elliott wrote: > The "arrows" and "Stream" package both provide a Data.Stream module. I'd > like to use the latter, which is much more filled out, but ghc is finding > and choosing the former. Are there mechanisms for resolving this kind of > conflict? - Conal There's now a new version of the arrows package that gets Data.Stream from the Stream package. From ashley at semantic.org Sun Oct 21 05:05:20 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Sun Oct 21 05:03:28 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: > http://hackage.haskell.org/trac/ghc/ticket/1773 So far it looks like: 1. The class should be named "Category" rather than "Compositor". 2. The members should either be identity :: cat a a (<<<) :: cat b c -> cat a b -> cat a c or id :: cat a a (.) :: cat b c -> cat a b -> cat a c Since a preference has been expressed, I'll go with id and (.) unless there are objections. These will not replace the specialised id and (.) in the Prelude. 3. There might be another useful class that's a subclass of Category and a superclass of Arrow, that essentially includes first but not arr. If someone wants to name it and define it, we can put it in the class hierarchy. 4. Redefining Functor, Applicative, and Monad to have two type arguments is out of scope of this proposal. -- Ashley Yakeley From twanvl at gmail.com Sun Oct 21 15:06:32 2007 From: twanvl at gmail.com (Twan van Laarhoven) Date: Sun Oct 21 15:04:23 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: <471BA338.9080805@gmail.com> Ashley Yakeley wrote: > 3. There might be another useful class that's a subclass of Category and > a superclass of Arrow, that essentially includes first but not arr. If > someone wants to name it and define it, we can put it in the class > hierarchy. My proposal would be the following. The important things are that: 1. It incorporates Conal's deep arrow, 2. as well as everything that is needed for functional references/lenses and bijective/invertible functions. I have chosen to reuse prelude names where possible. class Category cat where id :: cat a a (.) :: cat b c -> cat a b -> cat a c -- | 'cat' can work with pairs class Category cat => CategoryPair cat where fst :: cat (a,b) a snd :: cat (a,b) b swap :: cat (a,b) (b,a) first :: cat a b -> cat (a,c) (b,c) second :: cat a b -> cat (c,a) (c,b) (***) :: cat a b -> cat c d -> cat (a,c) (b,d) snd = fst . swap second f = swap . first f . swap f *** g = second g . first f class CategoryPair cat => CategoryFanOut cat where (&&&) :: cat a b -> cat a c -> cat a (b,c) dup :: cat a (a,a) f &&& g = f *** g . dup -- | 'cat' can work with eithers -- Dual to CategoryPair class Category cat => CategoryChoice cat where inl :: cat a (Either a b) inr :: cat b (Either a b) mirror :: cat (Either a b) (Either b a) left :: cat a b -> cat (Either a c) (Either b c) right :: cat a b -> cat (Either c a) (Either c b) (+++) :: cat a b -> cat c d -> cat (a,c) (b,d) inr = mirror . inl right f = mirror . left f . mirror f +++ g = right g . left f class CategoryChoice cat => CategoryFanIn cat where (|||) :: cat a c -> cat b c -> cat (Either a b) c untag :: cat (Either a a) a f ||| g = untag . f +++ g class Category cat => CategoryZero cat where zeroCat :: cat a b class CategoryZero cat => CategoryPlus cat where (<+>) :: cat a b -> cat a b -> cat a b -- this is what ArrowPlus uses, but perhaps -- (///) is a better choice, because it looks more like the others. class CategoryPair cat => CategoryApply cat where app :: cat (cat a b, a) b class CategoryPair cat => CategoryLoop cat where loop :: cat (a,c) (b,c) -> cat a b -- no idea how useful this is, but it is nice for symmetry class CategoryChoice cat => CategoryCoLoop cat where coloop :: cat (Either a c) (Either b c) -> cat a b -- | Categories that can manipulate functions. -- This is most of 'DeepArrow'. class Category cat => CategoryFun cat where result :: cat b c -> cat (a -> b) (a -> c) curry :: cat ((a, b) -> c) (a -> b -> c) uncurry :: cat (a -> b -> c) ((a, b) -> c) funF :: cat (c -> a, b) (c -> (a, b)) funS :: cat (a, c -> b) (c -> (a, b)) funR :: cat (a -> c -> b) (c -> a -> b) -- instances for t = Either and/or t = (,) -- If h98 compatability is important, it could be split into two classes -- or the functions lrAssocP and lrAssocE (specialized to pair/either) -- could be put into CategoryPair and CategoryChoice respectively. -- Maybe this should be a super class of those two classes: -- class CategoryAssoc cat (,) => CategoryPair cat -- class CategoryAssoc cat Either => CategoryChoice cat -- Then we also have that rAssocP = swap . lAssocP . swap class Category cat => CategoryAssoc cat t where lAssoc :: cat (t a (t b c)) (t (t a b) c) rAssoc :: cat (t (t a b) c) (t a (t b c)) -- | 'cat' contains all invertible functions (bijections) class Category cat => InvArrow cat where arrInv :: (a -> b) -> (b -> a) -> cat a b -- | 'cat' contains all functional references class InvArrow cat => RefArrow cat where arrRef :: (a -> b) -> (b -> a -> a) -> cat a b -- | 'cat' contains all Haskell functions class RefArrow cat => FunArrow cat where arr :: (a -> b) -> cat a b -- For backwards compatability: -- These should be class aliases class (FunArrow cat, CategoryPair cat) => Arrow cat class (Arrow cat, CategoryChoice cat) => ArrowChoice cat class (Arrow cat, CategoryZero cat) => ArrowZero cat class (Arrow cat, CategoryPlus cat) => ArrowPlus cat class (Arrow cat, CategoryApply cat) => ArrowApply cat class (Arrow cat, CategoryLoop cat) => ArrowLoop cat I would further propose that all classes named Category* go into Control.Category, while Arrow* goes into Control.Arrow. The latter can re-export the Control.Category module. And while we are busy messing with the arrows, I think the Kleisli type should change, it can be an instance of most of Category* with just Functor or Applicative instead of requiring the type to be a Monad. Twan From flippa at flippac.org Sun Oct 21 15:30:31 2007 From: flippa at flippac.org (Philippa Cowderoy) Date: Sun Oct 21 15:28:29 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <471BA338.9080805@gmail.com> References: <471BA338.9080805@gmail.com> Message-ID: On Sun, 21 Oct 2007, Twan van Laarhoven wrote: > Ashley Yakeley wrote: > > 3. There might be another useful class that's a subclass of Category and > > a superclass of Arrow, that essentially includes first but not arr. If > > someone wants to name it and define it, we can put it in the class > > hierarchy. > > > My proposal would be the following. The important things are that: > 1. It incorporates Conal's deep arrow, > 2. as well as everything that is needed for functional references/lenses > and bijective/invertible functions. > I have chosen to reuse prelude names where possible. > Looks good to me. CategoryPair is what I had in mind. -- flippa@flippac.org "I think you mean Philippa. I believe Phillipa is the one from an alternate universe, who has a beard and programs in BASIC, using only gotos for control flow." -- Anton van Straaten on Lambda the Ultimate From apfelmus at quantentunnel.de Sun Oct 21 16:04:38 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Sun Oct 21 16:02:12 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <471BA338.9080805@gmail.com> References: <471BA338.9080805@gmail.com> Message-ID: Twan van Laarhoven wrote: > My proposal would be the following. The important things are that: > 1. It incorporates Conal's deep arrow, > 2. as well as everything that is needed for functional > references/lenses and bijective/invertible functions. I'd opt for more research for that proposal to answer the following essential questions: - Do the classes correspond to already-known categories, i.e. are the class names optimal? - What laws do we expect to hold? - Are the signatures minimal, i.e. does there exist a smaller set of combinators that still achieves the intended effect? Are the signatures complete, i.e. can the intended effect always expressed with the given combinators? - Plenty and useful examples? At least enough examples that fit in the fine grained hierarchy but cannot be fit into a coarser grained one so as to demonstrate the necessity of a fine grained hierarchy. These questions likely have nice answers for many of the classes, but CategoryZero, CategoryPlus, CategoryChoice and in particular CategoryFun may be hard nuts. Also, the proposed subclass chain InvArrow => RefArrow => FunArrow may be cumbersome in practice since it would mean to define three functions instead of just arr when declaring an Arrow. Btw, a better implementation type for functional references / lenses is Lens s a = Lens { focus :: s -> (a, a -> s) } since that allows a more efficient implementation of modify than modify f s = put (f (get s)) s The latter deconstructs s twice whereas the focus primitive works like a zipper. Regards, apfelmus From flippa at flippac.org Sun Oct 21 16:10:27 2007 From: flippa at flippac.org (Philippa Cowderoy) Date: Sun Oct 21 16:08:22 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: <471BA338.9080805@gmail.com> Message-ID: On Sun, 21 Oct 2007, apfelmus wrote: > Twan van Laarhoven wrote: > > My proposal would be the following. The important things are that: > > 1. It incorporates Conal's deep arrow, > > 2. as well as everything that is needed for functional references/lenses > > and bijective/invertible functions. > > I'd opt for more research for that proposal to answer the following > essential questions: > - Do the classes correspond to already-known categories, i.e. are the class > names optimal? I suspect the correspondance with the existing Arrow classes is probably more important from the average Haskeller's point of view anyway. > These questions likely have nice answers for many of the classes, but > CategoryZero, CategoryPlus, CategoryChoice and in particular CategoryFun > may be hard nuts. > I think CategoryChoice is fairly natural if we've already got CategoryPair. Variants on a parsing lib that goes straight to a concrete syntax tree would be an obvious instance - such a lib should be trivially invertible to give a prettyprinter as well. -- flippa@flippac.org Society does not owe people jobs. Society owes it to itself to find people jobs. From isaacdupree at charter.net Sun Oct 21 19:14:03 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Sun Oct 21 19:16:29 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <471BA338.9080805@gmail.com> References: <471BA338.9080805@gmail.com> Message-ID: <471BDD3B.7000905@charter.net> Twan van Laarhoven wrote: > -- | 'cat' can work with eithers > -- Dual to CategoryPair > class Category cat => CategoryChoice cat where > inl :: cat a (Either a b) > inr :: cat b (Either a b) > mirror :: cat (Either a b) (Either b a) > left :: cat a b -> cat (Either a c) (Either b c) > right :: cat a b -> cat (Either c a) (Either c b) > (+++) :: cat a b -> cat c d -> cat (a,c) (b,d) I think this was meant: (+++) :: cat a b -> cat c d -> cat (Either a c) (Either b d) Isaac From duncan.coutts at worc.ox.ac.uk Mon Oct 22 07:43:05 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Mon Oct 22 07:38:16 2007 Subject: Bumping "extralib" library versions Message-ID: <1193053385.16641.55.camel@localhost> All, There is unfortunately some synchronisation between ghc releases and the releases of various common libraries, the so-called "extralibs" collection. So I'd like to look briefly at what the version numbers of theses packages should be. It is important that we do increase the version numbers if there are changes since the last releases. In cases where the package's HEAD repo is maintained somewhere other than darcs.haskell.org/packages/$pkg that we do not break the version scheme used by the package maintainer. The current set of "extralibs" packages is: ALUT arrows cgi fgl GLUT haskell-src HGL html HUnit mtl network ObjectIO OpenAL OpenGL parallel parsec QuickCheck regex-base regex-compat regex-posix stm time X11 xhtml For each one I'd like to identify where the HEAD repo is, what the last released version was, what the current version number in the darcs version is, if there are any changes since that release and if so what the new release number ought to be. These version number bumps are based on existing versioning practise for these libraries rather than the proposed package versioning policy. http://haskell.org/haskellwiki/Package_versioning_policy#Version_numbers I have also listed for each package what the next version number would be under the proposed package versioning policy.They are marked as "PVP next version". If you think I've got any of these details wrong, please say so. ========== ALUT HEAD repo: http://darcs.haskell.org/packages/ALUT Released version: 2.0.1 (in ghc-6.6.1 extralibs tarball) Current version: 2.0.1 Changes since release: minor build system changes Suggested next version: 2.0.2 PVP next version: 2.0.1.1 ========== arrows HEAD repo: http://darcs.haskell.org/packages/arrows Released version: 0.3 (on hackage) Current version: 0.3 Changes since release: none Suggested next version: not needed PVP next version: not needed Notes: The latest version of this package depends on Stream which is not currently in the extralibs collection. This anomaly will need to be sorted out. ========== cgi HEAD repo: http://darcs.haskell.org/packages/cgi Released version: 3001.1.5 (on hackage) Current version: 3001.1.5 Changes since release: comments and build system changes Suggested next version: 3001.1.6 PVP next version: 3001.1.5.1 Notes: requires .cabal changes to build with older base versions ========== fgl HEAD repo: http://darcs.haskell.org/packages/fgl Released version: 5.4.1 (in ghc-6.6.1 extralibs tarball) Current version: 5.4.1 Changes since release: build system changes Suggested next version: 5.4.2 PVP next version: 5.4.1.1 Notes: requires .cabal changes to build with older base versions ========== GLUT HEAD repo: http://darcs.haskell.org/packages/GLUT Released version: 2.1.1 (in ghc-6.6.1 extralibs tarball) Current version: 2.1.1 Changes since release: build system changes Suggested next version: 2.1.2 PVP next version: 2.1.1.1 ========== haskell-src HEAD repo: http://darcs.haskell.org/packages/haskell-src Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) Current version: 1.0.1 Changes since release: build system and portability changes (same api) Suggested next version: 1.0.2 PVP next version: 1.0.1.1 Notes: requires .cabal changes to build with older base versions ========== HGL HEAD repo: http://darcs.haskell.org/packages/HGL Released version: 3.1.1 (in ghc-6.6.1 extralibs tarball) Current version: 3.1.1 Changes since: build system changes Suggested next version: 3.1.2 PVP next version: 3.1.1.1 Notes: requires .cabal changes to build with older base versions ========== html HEAD repo: http://darcs.haskell.org/packages/html Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) Current version: 1.0.1 Changes since: build system changes Suggested next version: 1.0.2 PVP next version: 1.0.1.1 ========== HUnit HEAD repo: http://darcs.haskell.org/packages/HUnit Released version: 1.1.1 (in ghc-6.6.1 extralibs tarball) Current version: 1.1.1 Changes since: some code changes, not obvious if api changed Suggested next version: 1.1.2 PVP next version: 1.1.2 ========== mtl HEAD repo: http://darcs.haskell.org/packages/mtl Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) Current version: 1.0.1 Changes since: added more module re-exports and docs Suggested next version: 1.0.2 PVP next version: 1.0.2 Note: does not build with ghc-6.4.x as base-1.0 ========== network HEAD repo: http://darcs.haskell.org/packages/network Released version: 2.0.1 (in ghc-6.6.1 extralibs tarball) Current version: 2.0.1 Changes since: IPV6 support added, api extended not changed Suggested next version: 2.0.2 PVP next version: 2.0.2 Note: needs a patch to build with ghc-6.4.x and base-1.0 ========== ObjectIO HEAD repo: http://darcs.haskell.org/packages/ObjectIO Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) Current version: 1.0.1 Changes since: Setup.hs changes only Suggested next version: 1.0.2 PVP next version: 1.0.1.1 ========== OpenAL HEAD repo: http://darcs.haskell.org/packages/OpenAL Released version: 1.3.1 (in ghc-6.6.1 extralibs tarball) Current version: 1.3.1 Changes since: build system changes Suggested next version: 1.3.2 PVP next version: 1.3.1.1 ========== OpenGL HEAD repo: http://darcs.haskell.org/packages/OpenGL Released version: 2.2.1 (in ghc-6.6.1 extralibs tarball) Current version: 2.2.1 Changes since: build system changes Suggested next version: 2.2.2 PVP next version: 2.2.1.1 ========== parallel HEAD repo: http://darcs.haskell.org/packages/parallel Released version: none Current version: 1.0 Changes since: n/a Suggested next version: 1.0 PVP next version: 1.0 Note: cannot build with older ghc/base versions as it exposes modules provided by base-2.x. ========== parsec HEAD repo: http://darcs.haskell.org/packages/parsec Released version: 2.0 (hackage and ghc-6.6.1 extralibs tarball) Current version: 2.0 Changes since: api additions (extended, not changed) Suggested next version: 2.0.1 PVP next version: 2.0.1 ========== QuickCheck HEAD repo: http://darcs.haskell.org/QuickCheck 1.x repo: http://darcs.haskell.org/packages/QuickCheck Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) Current version: 1.0.1 Changes since: build system Suggested next version: 1.0.2 PVP next version: 1.0.1.1 Note: we seem to be including QuickCheck 1.x rather than 2.x. ========== regex-base HEAD repo: http://darcs.haskell.org/packages/regex-unstable/regex-base 0.72 repo: http://darcs.haskell.org/packages/regex-base Released version: 0.72 (in ghc-6.6.1 extralibs tarball) 0.92 (on hackage) Current version: 0.72 (in ghc-6.8 extralibs) 0.92 (upstream) Changes since: build system changes Suggested next version: 0.72.1 PVP next version: 0.72.0.1 Note: we seem to be including regex-base 0.72 when the latest upstream version is 0.92. ========== regex-compat HEAD repo: http://darcs.haskell.org/packages/regex-unstable/regex-compat 0.71 repo: http://darcs.haskell.org/packages/regex-compat Released version: 0.71 (hackage and ghc-6.6.1 extralibs tarball) 0.90 (on hackage) Current version: 0.71 (in ghc-6.8 extralibs) 0.90 (upstream) Changes since: trivial code change and build system changes Suggested next version: 0.71.1 PVP next version: 0.71.0.1 Note: Setup.lhs needs fixing to be trivial. Again, we seem to be including regex-base 0.71 when the latest upstream version is 0.90. ========== regex-posix HEAD repo: http://darcs.haskell.org/packages/regex-unstable/regex-posix 0.72 repo: http://darcs.haskell.org/packages/regex-posix Released version: 0.71 (hackage and ghc-6.6.1 extralibs tarball) 0.91 (on hackage) Current version: 0.72 (in ghc-6.8 extralibs) 0.91 (upstream) Changes since: compatible code changes and build system changes Suggested next version: 0.72.1 PVP next version: 0.72.0.1 Note: will need patching to build with base-2.0. Again, we seem to be including regex-base 0.72 when the latest upstream version is 0.91. ========== stm HEAD repo: http://darcs.haskell.org/packages/stm Released version: 2.1 (hackage and ghc-6.6.1 extralibs tarball) Current version: 2.1 Changes since: two new new functions and build system changes Suggested next version: 2.1.1 PVP next version: 2.1.1 Note: will not currently build with base-2.0. It's not clear if this is a problem, or if stm is tightly tied to the base/ghc version anyway. ========== time HEAD repo: http://darcs.haskell.org/packages/time Released version: 1.1.1 (in ghc-6.6.1 extralibs tarball) Current version: 1.1.1 Changes since: minor behaviour changes (bug fixes) Suggested next version: 1.1.2 PVP next version: 1.1.2 ========== X11 HEAD repo: http://darcs.haskell.org/packages/X11 Released version: 1.2.3 (on hackage) Current version: 1.2.3 Changes since: none Suggested next version: not needed PVP next version: not needed ========== xhtml HEAD repo: http://darcs.haskell.org/packages/xhtml Released version: 3000.0.2 (in ghc-6.6.1 extralibs tarball) Current version: 3000.0.2 Changes since: minor build system changes Suggested next version: 3000.0.3 PVP next version: 3000.0.2.1 Additionally, there are some core libs that could be usable with older versions of other libs, like base and so could be used with older releases of ghc or other implementations: bytestring Cabal filepath haskell98 readline unix Win32 ========== bytestring HEAD repo: http://darcs.haskell.org/bytestring Released version: 0.9 (on hackage) Current version: 0.9 Changes since: none Suggested next version: not needed PVP next version: not needed ========== Cabal HEAD repo: http://darcs.haskell.org/cabal Released version: 1.2.1 (on hackage) Current version: 1.2.1 Changes since: some minor changes Suggested next version: 1.2.2 PVP next version: 1.2.2 ========== filepath HEAD repo: http://darcs.haskell.org/packages/filepath 1.1 repo: http://darcs.haskell.org/ghc-6.8/packages/filepath Released version: 1.0 (on hackage) Current version: 1.1 Changes since: api additions, bug fixes Suggested next version: 1.1 PVP next version: 1.0.1 Note: filepath head branch is marked as version 1.0 while the version included with ghc-6.8 is marked as 1.1. ========== haskell98 HEAD repo: http://darcs.haskell.org/packages/haskell98 Released version: 1.0 (hackage and ghc-6.6.1 extralibs tarball) Current version: 1.0.1 Changes since: build system changes Suggested next version: ??? PVP next version: 1.0.0.1 Note: If the version number identifies the api to some degree, then the H98 api never changes so it's version number should never increment, except in the micro revision for build system changes. ========== readline HEAD repo: http://darcs.haskell.org/packages/readline Released version: 1.0 (ghc-6.6.1 extralibs tarball) Current version: 1.0.1 Changes since: api additions, build system changes Suggested next version: 1.0.1 PVP next version: 1.0.1 ========== unix HEAD repo: http://darcs.haskell.org/packages/unix Released version: 2.1 (ghc-6.6.1 extralibs tarball) Current version: 2.2 Changes since: many api additions Suggested next version: 2.2 PVP next version: 2.1.1 Note: will not currently build with base-2.0. ========== Win32 HEAD repo: http://darcs.haskell.org/packages/Win32 Released version: 2.1 (hackage and ghc-6.6.1 extralibs tarball) Current version: 2.1.1 Changes since: api additions Suggested next version: 2.1.1 PVP next version: 2.1.1 Note: will not currently build with base-2.0. Duncan From duncan.coutts at worc.ox.ac.uk Mon Oct 22 09:03:49 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Mon Oct 22 08:58:53 2007 Subject: Bumping "extralib" library versions In-Reply-To: <1193053385.16641.55.camel@localhost> References: <1193053385.16641.55.camel@localhost> Message-ID: <1193058229.16641.61.camel@localhost> Ian pointed out that most of these extralibs already have had releases via hugs with greater version numbers than those we were proposing. http://cvs.haskell.org/Hugs/downloads/2006-09/packages/ For example ALUT-2.0.20060921 which means we cannot use ALUT-2.0.2 as we had been thinking. We'll have to use at least 2.1, and to prevent similar future problems we should really use 2.1.0.0. Then if anyone makes snapshots they will not be higher than the next minor release 2.1.0.1 that preserves the same api. Again, these are the numbers suggested by the proposed package versioning policy: http://haskell.org/haskellwiki/Package_versioning_policy Duncan From igloo at earth.li Mon Oct 22 09:11:03 2007 From: igloo at earth.li (Ian Lynagh) Date: Mon Oct 22 09:14:53 2007 Subject: Bumping "extralib" library versions In-Reply-To: <1193053385.16641.55.camel@localhost> References: <1193053385.16641.55.camel@localhost> Message-ID: <20071022131103.GA9292@matrix.chaos.earth.li> On Mon, Oct 22, 2007 at 12:43:05PM +0100, Duncan Coutts wrote: > > For each one I'd like to identify where the HEAD repo is, what the last > released version was, what the current version number in the darcs > version is, if there are any changes since that release and if so what > the new release number ought to be. > > These version number bumps are based on existing versioning practise for > these libraries rather than the proposed package versioning policy. > http://haskell.org/haskellwiki/Package_versioning_policy#Version_numbers > I have also listed for each package what the next version number would > be under the proposed package versioning policy.They are marked as "PVP > next version". > > If you think I've got any of these details wrong, please say so. We've discussed this in #ghc, and we think it's best to use 4 component version numbers so Cabal's snapshot (== append $date) version numbers do what we want and fit in with us following the proposed policy. If anyone sees any problems with my suggested version numbers below, please shout. I've CCed all addresses listed as Cabal maintainers of extralibs; please let us know if you disagree with the versions we propose to use for your packages. > ========== > ALUT > > HEAD repo: http://darcs.haskell.org/packages/ALUT > Released version: 2.0.1 (in ghc-6.6.1 extralibs tarball) > Current version: 2.0.1 > Changes since release: minor build system changes > Suggested next version: 2.0.2 > PVP next version: 2.0.1.1 Latest version I can find is 2.0.20060921 http://cvs.haskell.org/Hugs/downloads/2006-09/packages/ALUT-2.0.20060921.tar.gz so I think 2.1.0.0 should be the next release. > ========== > arrows > > HEAD repo: http://darcs.haskell.org/packages/arrows > Released version: 0.3 (on hackage) > Current version: 0.3 > Changes since release: none > Suggested next version: not needed > PVP next version: not needed There have been some patches to the repo, so I think it would be nice to make a new tarball, and it's not that expensive, so I'd suggest 0.3.0.1. > ========== > cgi > > HEAD repo: http://darcs.haskell.org/packages/cgi > Released version: 3001.1.5 (on hackage) > Current version: 3001.1.5 > Changes since release: comments and build system changes > Suggested next version: 3001.1.6 > PVP next version: 3001.1.5.1 3001.1.5.1 looks good to me. > ========== > fgl > > HEAD repo: http://darcs.haskell.org/packages/fgl > Released version: 5.4.1 (in ghc-6.6.1 extralibs tarball) > Current version: 5.4.1 > Changes since release: build system changes > Suggested next version: 5.4.2 > PVP next version: 5.4.1.1 5.4.1.1 looks good to me. > ========== > GLUT > > HEAD repo: http://darcs.haskell.org/packages/GLUT > Released version: 2.1.1 (in ghc-6.6.1 extralibs tarball) > Current version: 2.1.1 > Changes since release: build system changes > Suggested next version: 2.1.2 > PVP next version: 2.1.1.1 2.1.1.1 looks good to me. > ========== > haskell-src > > HEAD repo: http://darcs.haskell.org/packages/haskell-src > Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) > Current version: 1.0.1 > Changes since release: build system and portability changes (same api) > Suggested next version: 1.0.2 > PVP next version: 1.0.1.1 1.0.1.1 looks good to me. > ========== > HGL > > HEAD repo: http://darcs.haskell.org/packages/HGL > Released version: 3.1.1 (in ghc-6.6.1 extralibs tarball) > Current version: 3.1.1 > Changes since: build system changes > Suggested next version: 3.1.2 > PVP next version: 3.1.1.1 Largest known is 3.1.20060921: http://cvs.haskell.org/Hugs/downloads/2006-09/packages/HGL-3.1.20060921.tar.gz so I think 3.2.0.0 should be the next release. > ========== > html > > HEAD repo: http://darcs.haskell.org/packages/html > Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) > Current version: 1.0.1 > Changes since: build system changes > Suggested next version: 1.0.2 > PVP next version: 1.0.1.1 1.0.1.1 looks good to me. > ========== > HUnit > > HEAD repo: http://darcs.haskell.org/packages/HUnit > Released version: 1.1.1 (in ghc-6.6.1 extralibs tarball) > Current version: 1.1.1 > Changes since: some code changes, not obvious if api changed > Suggested next version: 1.1.2 > PVP next version: 1.1.2 Largest known is 1.1.20060921: http://cvs.haskell.org/Hugs/downloads/2006-09/packages/HUnit-1.1.20060921.tar.gz so I think 1.2.0.0 should be the next release. > ========== > mtl > > HEAD repo: http://darcs.haskell.org/packages/mtl > Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) > Current version: 1.0.1 > Changes since: added more module re-exports and docs > Suggested next version: 1.0.2 > PVP next version: 1.0.2 Largest known is 1.0.20060921: http://cvs.haskell.org/Hugs/downloads/2006-09/packages/mtl-1.0.20060921.tar.gz so I think 1.1.0.0 should be the next release. > ========== > network > > HEAD repo: http://darcs.haskell.org/packages/network > Released version: 2.0.1 (in ghc-6.6.1 extralibs tarball) > Current version: 2.0.1 > Changes since: IPV6 support added, api extended not changed > Suggested next version: 2.0.2 > PVP next version: 2.0.2 Largest known is 2.0.20060921: http://cvs.haskell.org/Hugs/downloads/2006-09/packages/network-2.0.20060921.tar.gz so I think 2.1.0.0 should be the next release. > ========== > ObjectIO > > HEAD repo: http://darcs.haskell.org/packages/ObjectIO > Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) > Current version: 1.0.1 > Changes since: Setup.hs changes only > Suggested next version: 1.0.2 > PVP next version: 1.0.1.1 1.0.1.1 looks good to me. > ========== > OpenAL > > HEAD repo: http://darcs.haskell.org/packages/OpenAL > Released version: 1.3.1 (in ghc-6.6.1 extralibs tarball) > Current version: 1.3.1 > Changes since: build system changes > Suggested next version: 1.3.2 > PVP next version: 1.3.1.1 1.3.1.1 looks good to me. > ========== > OpenGL > > HEAD repo: http://darcs.haskell.org/packages/OpenGL > Released version: 2.2.1 (in ghc-6.6.1 extralibs tarball) > Current version: 2.2.1 > Changes since: build system changes > Suggested next version: 2.2.2 > PVP next version: 2.2.1.1 2.2.1.1 looks good to me. > ========== > parallel > > HEAD repo: http://darcs.haskell.org/packages/parallel > Released version: none > Current version: 1.0 > Changes since: n/a > Suggested next version: 1.0 > PVP next version: 1.0 1.0.0.0 > ========== > parsec > > HEAD repo: http://darcs.haskell.org/packages/parsec > Released version: 2.0 (hackage and ghc-6.6.1 extralibs tarball) > Current version: 2.0 > Changes since: api additions (extended, not changed) > Suggested next version: 2.0.1 > PVP next version: 2.0.1 Largest known is 2.0.20060921: http://cvs.haskell.org/Hugs/downloads/2006-09/packages/parsec-2.0.20060921.tar.gz so I think 2.1.0.0 should be the next release. > ========== > QuickCheck > > HEAD repo: http://darcs.haskell.org/QuickCheck > 1.x repo: http://darcs.haskell.org/packages/QuickCheck > Released version: 1.0.1 (in ghc-6.6.1 extralibs tarball) > Current version: 1.0.1 > Changes since: build system > Suggested next version: 1.0.2 > PVP next version: 1.0.1.1 Largest known is 1.0.20060921: http://cvs.haskell.org/Hugs/downloads/2006-09/packages/QuickCheck-1.0.20060921.tar.gz so I think 1.1.0.0 should be the next release. > Note: we seem to be including QuickCheck 1.x rather than 2.x. I don't know why this is. I don't understand the status of the various QuickChecks. > ========== > regex-base > > HEAD repo: http://darcs.haskell.org/packages/regex-unstable/regex-base > 0.72 repo: http://darcs.haskell.org/packages/regex-base > Released version: 0.72 (in ghc-6.6.1 extralibs tarball) > 0.92 (on hackage) > Current version: 0.72 (in ghc-6.8 extralibs) > 0.92 (upstream) > Changes since: build system changes > Suggested next version: 0.72.1 > PVP next version: 0.72.0.1 0.72.0.1 looks good to me. > ========== > regex-compat > > HEAD repo: http://darcs.haskell.org/packages/regex-unstable/regex-compat > 0.71 repo: http://darcs.haskell.org/packages/regex-compat > Released version: 0.71 (hackage and ghc-6.6.1 extralibs tarball) > 0.90 (on hackage) > Current version: 0.71 (in ghc-6.8 extralibs) > 0.90 (upstream) > Changes since: trivial code change and build system changes > Suggested next version: 0.71.1 > PVP next version: 0.71.0.1 0.71.0.1 looks good to me. > ========== > regex-posix > > HEAD repo: http://darcs.haskell.org/packages/regex-unstable/regex-posix > 0.72 repo: http://darcs.haskell.org/packages/regex-posix > Released version: 0.71 (hackage and ghc-6.6.1 extralibs tarball) > 0.91 (on hackage) > Current version: 0.72 (in ghc-6.8 extralibs) > 0.91 (upstream) > Changes since: compatible code changes and build system changes > Suggested next version: 0.72.1 > PVP next version: 0.72.0.1 0.72.0.1 looks good to me. > ========== > stm > > HEAD repo: http://darcs.haskell.org/packages/stm > Released version: 2.1 (hackage and ghc-6.6.1 extralibs tarball) > Current version: 2.1 > Changes since: two new new functions and build system changes > Suggested next version: 2.1.1 > PVP next version: 2.1.1 2.1.1.0 > ========== > time > > HEAD repo: http://darcs.haskell.org/packages/time > Released version: 1.1.1 (in ghc-6.6.1 extralibs tarball) > Current version: 1.1.1 > Changes since: minor behaviour changes (bug fixes) > Suggested next version: 1.1.2 > PVP next version: 1.1.2 1.1.2.0 > ========== > X11 > > HEAD repo: http://darcs.haskell.org/packages/X11 > Released version: 1.2.3 (on hackage) > Current version: 1.2.3 > Changes since: none > Suggested next version: not needed > PVP next version: not needed 1.2.3.1 > ========== > xhtml > > HEAD repo: http://darcs.haskell.org/packages/xhtml > Released version: 3000.0.2 (in ghc-6.6.1 extralibs tarball) > Current version: 3000.0.2 > Changes since: minor build system changes > Suggested next version: 3000.0.3 > PVP next version: 3000.0.2.1 3000.0.2.1 looks good to me. I believe all the core library version numbers are OK, except I will append .0's until they become 4-component. Thanks Ian From duncan.coutts at worc.ox.ac.uk Mon Oct 22 10:00:42 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Mon Oct 22 09:55:42 2007 Subject: Bumping "extralib" library versions In-Reply-To: <20071022131103.GA9292@matrix.chaos.earth.li> References: <1193053385.16641.55.camel@localhost> <20071022131103.GA9292@matrix.chaos.earth.li> Message-ID: <1193061642.16641.76.camel@localhost> On Mon, 2007-10-22 at 14:11 +0100, Ian Lynagh wrote: > If anyone sees any problems with my suggested version numbers below, > please shout. > > I've CCed all addresses listed as Cabal maintainers of extralibs; please > let us know if you disagree with the versions we propose to use for your > packages. Only two minor points... > > ========== > > arrows > > > > HEAD repo: http://darcs.haskell.org/packages/arrows > > Released version: 0.3 (on hackage) > > Current version: 0.3 > > Changes since release: none > > Suggested next version: not needed > > PVP next version: not needed > > There have been some patches to the repo, so I think it would be nice to > make a new tarball, and it's not that expensive, so I'd suggest 0.3.0.1. There are no patches since the one that increased the version number from 0.2.1 to 0.3. No new release is needed at the moment. cc'ing Ross who is maintainer of this package. > > ========== > > X11 > > > > HEAD repo: http://darcs.haskell.org/packages/X11 > > Released version: 1.2.3 (on hackage) > > Current version: 1.2.3 > > Changes since: none > > Suggested next version: not needed > > PVP next version: not needed > > 1.2.3.1 Again, there are no patches since the patch that tagged version 1.2.3, so no new release is needed. cc'ing Don who is maintainer of this package. All your other version suggestions look fine to me. Since we're moving to a model where extralibs is just a bundling of existing releases rather than necessarily fresh releases itself, then we do not need to re-release existing packages where there have been no changes, we can just use the existing packages as is. Indeed, as I've said I'd like to see all these packages go up on hackage soon and not necessarily synchronised with the release of ghc. For example, I've already released Cabal-1.2.1 and binary-0.9. Ross and Don have already released arrows-0.3 and X11-1.2.3. I expect ghc-6.8.1 will come with a later minor revision of Cabal (Solaris fixes etc) but it'll most probably use exactly the bytestring-0.9 that I've already released. Not that there is anything stopping us from doing a 0.9.0.1 release if we do need to make more changes, just that it's not essential that we do so if we make no changes. > I believe all the core library version numbers are OK, except I will > append .0's until they become 4-component. Right. Duncan From ross at soi.city.ac.uk Mon Oct 22 10:04:15 2007 From: ross at soi.city.ac.uk (Ross Paterson) Date: Mon Oct 22 10:02:14 2007 Subject: Bumping "extralib" library versions In-Reply-To: <20071022131103.GA9292@matrix.chaos.earth.li> References: <1193053385.16641.55.camel@localhost> <20071022131103.GA9292@matrix.chaos.earth.li> Message-ID: <20071022140415.GA5864@soi.city.ac.uk> On Mon, Oct 22, 2007 at 02:11:03PM +0100, Ian Lynagh wrote: > On Mon, Oct 22, 2007 at 12:43:05PM +0100, Duncan Coutts wrote: > > ========== > > arrows > > > > HEAD repo: http://darcs.haskell.org/packages/arrows > > Released version: 0.3 (on hackage) > > Current version: 0.3 > > Changes since release: none > > Suggested next version: not needed > > PVP next version: not needed > > There have been some patches to the repo, so I think it would be nice to > make a new tarball, and it's not that expensive, so I'd suggest 0.3.0.1. There have been no changes to the repo since that release, but as Duncan pointed out it now depends on a package outside extralibs (Stream), so I guess it should be dropped. From igloo at earth.li Mon Oct 22 10:42:27 2007 From: igloo at earth.li (Ian Lynagh) Date: Mon Oct 22 10:40:20 2007 Subject: Bumping "extralib" library versions In-Reply-To: <1193061642.16641.76.camel@localhost> References: <1193053385.16641.55.camel@localhost> <20071022131103.GA9292@matrix.chaos.earth.li> <1193061642.16641.76.camel@localhost> Message-ID: <20071022144227.GA12149@matrix.chaos.earth.li> On Mon, Oct 22, 2007 at 03:00:42PM +0100, Duncan Coutts wrote: > On Mon, 2007-10-22 at 14:11 +0100, Ian Lynagh wrote: > > > If anyone sees any problems with my suggested version numbers below, > > please shout. > > > > I've CCed all addresses listed as Cabal maintainers of extralibs; please > > let us know if you disagree with the versions we propose to use for your > > packages. > > Only two minor points... > > > > ========== > > > arrows > > > > > > HEAD repo: http://darcs.haskell.org/packages/arrows > > > Released version: 0.3 (on hackage) > > > Current version: 0.3 > > > Changes since release: none > > > Suggested next version: not needed > > > PVP next version: not needed > > > > There have been some patches to the repo, so I think it would be nice to > > make a new tarball, and it's not that expensive, so I'd suggest 0.3.0.1. > > There are no patches since the one that increased the version number > from 0.2.1 to 0.3. No new release is needed at the moment. Ah, sorry, my mistake, I hadn't pulled the latest patch. OK, so in principle I'd be fine with 0.3, except if we want to move to 4-component version numbers then we need to use 0.3.0.1 anyway (I don't think having both 0.3 and 0.3.0.0 which don't compare equal is a good idea. We'll just get confused). > > > ========== > > > X11 > > > > > > HEAD repo: http://darcs.haskell.org/packages/X11 > > > Released version: 1.2.3 (on hackage) > > > Current version: 1.2.3 > > > Changes since: none > > > Suggested next version: not needed > > > PVP next version: not needed > > > > 1.2.3.1 > > Again, there are no patches since the patch that tagged version 1.2.3, > so no new release is needed. Again, this is just for the version number length. Thanks Ian From igloo at earth.li Mon Oct 22 10:43:38 2007 From: igloo at earth.li (Ian Lynagh) Date: Mon Oct 22 10:41:30 2007 Subject: Bumping "extralib" library versions In-Reply-To: <20071022140415.GA5864@soi.city.ac.uk> References: <1193053385.16641.55.camel@localhost> <20071022131103.GA9292@matrix.chaos.earth.li> <20071022140415.GA5864@soi.city.ac.uk> Message-ID: <20071022144338.GB12149@matrix.chaos.earth.li> On Mon, Oct 22, 2007 at 03:04:15PM +0100, Ross Paterson wrote: > On Mon, Oct 22, 2007 at 02:11:03PM +0100, Ian Lynagh wrote: > > On Mon, Oct 22, 2007 at 12:43:05PM +0100, Duncan Coutts wrote: > > > ========== > > > arrows > > There have been no changes to the repo since that release, but as Duncan > pointed out it now depends on a package outside extralibs (Stream), so I > guess it should be dropped. Do you mean you think arrows should be dropped from extralibs? Thanks Ian From ross at soi.city.ac.uk Mon Oct 22 10:53:21 2007 From: ross at soi.city.ac.uk (Ross Paterson) Date: Mon Oct 22 10:51:22 2007 Subject: Bumping "extralib" library versions In-Reply-To: <20071022144338.GB12149@matrix.chaos.earth.li> References: <1193053385.16641.55.camel@localhost> <20071022131103.GA9292@matrix.chaos.earth.li> <20071022140415.GA5864@soi.city.ac.uk> <20071022144338.GB12149@matrix.chaos.earth.li> Message-ID: <20071022145320.GA6378@soi.city.ac.uk> On Mon, Oct 22, 2007 at 03:43:38PM +0100, Ian Lynagh wrote: > On Mon, Oct 22, 2007 at 03:04:15PM +0100, Ross Paterson wrote: > > On Mon, Oct 22, 2007 at 02:11:03PM +0100, Ian Lynagh wrote: > > > On Mon, Oct 22, 2007 at 12:43:05PM +0100, Duncan Coutts wrote: > > > > ========== > > > > arrows > > > > There have been no changes to the repo since that release, but as Duncan > > pointed out it now depends on a package outside extralibs (Stream), so I > > guess it should be dropped. > > Do you mean you think arrows should be dropped from extralibs? Yes (unless Stream is added). From fmartini at gmail.com Mon Oct 22 13:52:35 2007 From: fmartini at gmail.com (Felix Martini) Date: Mon Oct 22 13:50:28 2007 Subject: System.Win32.Types to base library? Message-ID: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> I am working on some Windows specific code for GHC in the base library. System.Win32.Types contains basic Win32 types and error handling functions. Using them would mean a dependency on the Win32 library. I could duplicate parts of System.Win32.Types that i need, but is it not preferable to relocate System.Win32.Types to the base library? Regards, Felix From dons at galois.com Mon Oct 22 14:31:15 2007 From: dons at galois.com (Don Stewart) Date: Mon Oct 22 14:29:51 2007 Subject: Bumping "extralib" library versions In-Reply-To: <1193061642.16641.76.camel@localhost> References: <1193053385.16641.55.camel@localhost> <20071022131103.GA9292@matrix.chaos.earth.li> <1193061642.16641.76.camel@localhost> Message-ID: <20071022183115.GC4437@scytale.galois.com> duncan.coutts: > On Mon, 2007-10-22 at 14:11 +0100, Ian Lynagh wrote: > > > If anyone sees any problems with my suggested version numbers below, > > please shout. > > > > I've CCed all addresses listed as Cabal maintainers of extralibs; please > > let us know if you disagree with the versions we propose to use for your > > packages. > > Only two minor points... > > > > ========== > > > arrows > > > > > > HEAD repo: http://darcs.haskell.org/packages/arrows > > > Released version: 0.3 (on hackage) > > > Current version: 0.3 > > > Changes since release: none > > > Suggested next version: not needed > > > PVP next version: not needed > > > > There have been some patches to the repo, so I think it would be nice to > > make a new tarball, and it's not that expensive, so I'd suggest 0.3.0.1. > > There are no patches since the one that increased the version number > from 0.2.1 to 0.3. No new release is needed at the moment. > > cc'ing Ross who is maintainer of this package. > > > > ========== > > > X11 > > > > > > HEAD repo: http://darcs.haskell.org/packages/X11 > > > Released version: 1.2.3 (on hackage) > > > Current version: 1.2.3 > > > Changes since: none > > > Suggested next version: not needed > > > PVP next version: not needed > > > > 1.2.3.1 > > Again, there are no patches since the patch that tagged version 1.2.3, > so no new release is needed. > > cc'ing Don who is maintainer of this package. Yes, it seems unnecessary to update this. Consider the X11 package the first that has been updated for ghc 6.8 on hackage :) > Since we're moving to a model where extralibs is just a bundling of > existing releases rather than necessarily fresh releases itself, then we > do not need to re-release existing packages where there have been no > changes, we can just use the existing packages as is. Indeed, as I've > said I'd like to see all these packages go up on hackage soon and not > necessarily synchronised with the release of ghc. Right, exactly the model we want, I think. > For example, I've already released Cabal-1.2.1 and binary-0.9. Ross and > Don have already released arrows-0.3 and X11-1.2.3. I expect ghc-6.8.1 > will come with a later minor revision of Cabal (Solaris fixes etc) but > it'll most probably use exactly the bytestring-0.9 that I've already > released. Not that there is anything stopping us from doing a 0.9.0.1 > release if we do need to make more changes, just that it's not essential > that we do so if we make no changes. > -- Don From conal at conal.net Mon Oct 22 15:05:36 2007 From: conal at conal.net (Conal Elliott) Date: Mon Oct 22 15:03:29 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: I like the simplicity of th Cartesian class, including definability of dup, swap, lAssoc, rAssoc, first, and second. I'm missing the significance of > But IIRC, (&&&) does impose an "order of side effects" on the arguments, so Arrows are more general (less restrictive) than cartesian categories. Is it just that you're wondering with what class to associate the fst/&&& and snd/&&& laws? fst . (f &&& g) = f snd . (f &&& g) = g - Conal On 10/18/07, apfelmus wrote: > > Conal Elliott wrote: > > DeepArrow could benefit from suggestions (perhaps refactoring), and I > would > > appreciate such input. In any case, I imagine there's some rich, useful > > structure between Category & Arrow, and now would be a great time to > explore > > it before settling on a new class hierarchy. > > DeepArrow looks pretty much like a category corresponding to Arrows > ("Freyd category" but I don't really know what that is) to me (without a > functor arr that embeds the category of Haskell functions). > > I mean, Arrows are just computations a ~> b that allow you to keep > around temporary variables with first and second . Unfortunately, the > Arrow class does not mention all the needed morphisms to do that since > the arr function automatically carries most of them over from the > category of Haskell functions. I have the feeling that DeepArrow wants > to list exactly those necessary morphisms. Perhaps there is something > more to DeepArrows, due to the normal function arrows in types, but > maybe not since perhaps the only thing they can act on are tuples. > > In any case, I'd recommend rethinking DeepArrows, maybe there's some > well-known category corresponding to them. For starters, there are > cartesian categories, i.e. categories with products: > > class Cartesian cat where > fst :: cat (a,b) a > snd :: cat (a,b) b > (&&&) :: cat c a -> cat c b -> cat c (a,b) > > with the conditions > > fst . (f &&& g) = f > snd . (f &&& g) = g > > Besides fstA and sndA, this gives the morphisms > > dupA = id &&& id -- the diagonal > swapA f = snd f &&& fst f > lAssocA f = (fst f &&& fst (snd f)) &&& snd (snd f) > rAssocA f = fst (fst f) &&& (fst (snd f) &&& snd f) > > Interestingly, we already get > > first :: Cartesian cat => cat a b -> cat (a,d) (b,d) > first f = (f . fst &&& id . snd) > > and second and that would be everything we need for arrows (besides > arr ). But IIRC, (&&&) does impose an "order of side effects" on the > arguments, so Arrows are more general (less restrictive) than cartesian > categories. So, it's some (pre?)monoidal category with extra stuff > (Freyd?), I don't know :) > > Also, I don't know what to do with the Haskell function arrows in the > objects (= arguments to ~>) of DeepArrow. > > Regards, > apfelmus > > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071022/30dbbb2c/attachment-0001.htm From conal at conal.net Mon Oct 22 15:18:03 2007 From: conal at conal.net (Conal Elliott) Date: Mon Oct 22 15:15:55 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <471BA338.9080805@gmail.com> References: <471BA338.9080805@gmail.com> Message-ID: I'm delighted to see these interfaces being explored. Question: why separate fan-out (&&&) from pair? Do you know of type constructors that have fst & snd but not &&&? Similarly for CategoryAssoc. - Conal On 10/21/07, Twan van Laarhoven wrote: > > Ashley Yakeley wrote: > > 3. There might be another useful class that's a subclass of Category and > > a superclass of Arrow, that essentially includes first but not arr. If > > someone wants to name it and define it, we can put it in the class > > hierarchy. > > > My proposal would be the following. The important things are that: > 1. It incorporates Conal's deep arrow, > 2. as well as everything that is needed for functional > references/lenses and bijective/invertible functions. > I have chosen to reuse prelude names where possible. > > > class Category cat where > id :: cat a a > (.) :: cat b c -> cat a b -> cat a c > > > -- | 'cat' can work with pairs > class Category cat => CategoryPair cat where > fst :: cat (a,b) a > snd :: cat (a,b) b > swap :: cat (a,b) (b,a) > first :: cat a b -> cat (a,c) (b,c) > second :: cat a b -> cat (c,a) (c,b) > (***) :: cat a b -> cat c d -> cat (a,c) (b,d) > > snd = fst . swap > second f = swap . first f . swap > f *** g = second g . first f > > class CategoryPair cat => CategoryFanOut cat where > (&&&) :: cat a b -> cat a c -> cat a (b,c) > dup :: cat a (a,a) > > f &&& g = f *** g . dup > > > -- | 'cat' can work with eithers > -- Dual to CategoryPair > class Category cat => CategoryChoice cat where > inl :: cat a (Either a b) > inr :: cat b (Either a b) > mirror :: cat (Either a b) (Either b a) > left :: cat a b -> cat (Either a c) (Either b c) > right :: cat a b -> cat (Either c a) (Either c b) > (+++) :: cat a b -> cat c d -> cat (a,c) (b,d) > > inr = mirror . inl > right f = mirror . left f . mirror > f +++ g = right g . left f > > class CategoryChoice cat => CategoryFanIn cat where > (|||) :: cat a c -> cat b c -> cat (Either a b) c > untag :: cat (Either a a) a > > f ||| g = untag . f +++ g > > > class Category cat => CategoryZero cat where > zeroCat :: cat a b > > class CategoryZero cat => CategoryPlus cat where > (<+>) :: cat a b -> cat a b -> cat a b > -- this is what ArrowPlus uses, but perhaps > -- (///) is a better choice, because it looks more like the others. > > > class CategoryPair cat => CategoryApply cat where > app :: cat (cat a b, a) b > > > class CategoryPair cat => CategoryLoop cat where > loop :: cat (a,c) (b,c) -> cat a b > > -- no idea how useful this is, but it is nice for symmetry > class CategoryChoice cat => CategoryCoLoop cat where > coloop :: cat (Either a c) (Either b c) -> cat a b > > > -- | Categories that can manipulate functions. > -- This is most of 'DeepArrow'. > class Category cat => CategoryFun cat where > result :: cat b c -> cat (a -> b) (a -> c) > curry :: cat ((a, b) -> c) (a -> b -> c) > uncurry :: cat (a -> b -> c) ((a, b) -> c) > funF :: cat (c -> a, b) (c -> (a, b)) > funS :: cat (a, c -> b) (c -> (a, b)) > funR :: cat (a -> c -> b) (c -> a -> b) > > -- instances for t = Either and/or t = (,) > -- If h98 compatability is important, it could be split into two classes > -- or the functions lrAssocP and lrAssocE (specialized to pair/either) > -- could be put into CategoryPair and CategoryChoice respectively. > -- Maybe this should be a super class of those two classes: > -- class CategoryAssoc cat (,) => CategoryPair cat > -- class CategoryAssoc cat Either => CategoryChoice cat > -- Then we also have that rAssocP = swap . lAssocP . swap > class Category cat => CategoryAssoc cat t where > lAssoc :: cat (t a (t b c)) (t (t a b) c) > rAssoc :: cat (t (t a b) c) (t a (t b c)) > > > -- | 'cat' contains all invertible functions (bijections) > class Category cat => InvArrow cat where > arrInv :: (a -> b) -> (b -> a) -> cat a b > > -- | 'cat' contains all functional references > class InvArrow cat => RefArrow cat where > arrRef :: (a -> b) -> (b -> a -> a) -> cat a b > > -- | 'cat' contains all Haskell functions > class RefArrow cat => FunArrow cat where > arr :: (a -> b) -> cat a b > > > -- For backwards compatability: > -- These should be class aliases > class (FunArrow cat, CategoryPair cat) => Arrow cat > class (Arrow cat, CategoryChoice cat) => ArrowChoice cat > class (Arrow cat, CategoryZero cat) => ArrowZero cat > class (Arrow cat, CategoryPlus cat) => ArrowPlus cat > class (Arrow cat, CategoryApply cat) => ArrowApply cat > class (Arrow cat, CategoryLoop cat) => ArrowLoop cat > > > I would further propose that all classes named Category* go into > Control.Category, while Arrow* goes into Control.Arrow. The latter can > re-export the Control.Category module. > > And while we are busy messing with the arrows, I think the Kleisli type > should change, it can be an instance of most of Category* with just > Functor or Applicative instead of requiring the type to be a Monad. > > Twan > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071022/d42d75da/attachment.htm From apfelmus at quantentunnel.de Mon Oct 22 16:02:47 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Mon Oct 22 16:00:13 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: Conal Elliott wrote: > I like the simplicity of th Cartesian class, including definability of dup, > swap, lAssoc, rAssoc, first, and second. > > I'm missing the significance of > >> But IIRC, (&&&) does impose an "order of side effects" on the arguments, > so Arrows are more general (less restrictive) than cartesian categories. > > Is it just that you're wondering with what class to associate the fst/&&& > and snd/&&& laws? > > fst . (f &&& g) = f > snd . (f &&& g) = g Exactly. They often don't hold for Arrows but are taken granted for Cartesian categories. So, using (&&&) as primitive is - despite its elegance - not the right thing to do. (That's also why Arrows have first and second as primitives even when (&&&) makes them superfluous.). Regards, apfelmus From bertram.felgenhauer at googlemail.com Mon Oct 22 16:07:02 2007 From: bertram.felgenhauer at googlemail.com (Bertram Felgenhauer) Date: Mon Oct 22 16:05:01 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <471BA338.9080805@gmail.com> References: <471BA338.9080805@gmail.com> Message-ID: <20071022200702.GA5712@zombie.inf.tu-dresden.de> Twan van Laarhoven wrote: > My proposal would be the following. The important things are that: > 1. It incorporates Conal's deep arrow, > 2. as well as everything that is needed for functional references/lenses > and bijective/invertible functions. > I have chosen to reuse prelude names where possible. This is a rather finely grained hierarchy, but it's still too coarse to define a category of invertible functions. That category has pairs: it supports first, second and (***), but not fst and snd. > -- | 'cat' can work with pairs > class Category cat => CategoryPair cat where > fst :: cat (a,b) a > snd :: cat (a,b) b > swap :: cat (a,b) (b,a) > first :: cat a b -> cat (a,c) (b,c) > second :: cat a b -> cat (c,a) (c,b) > (***) :: cat a b -> cat c d -> cat (a,c) (b,d) A similar problem exists with inl and inr of CategoryChoice. [snip] > class Category cat => CategoryAssoc cat t where > lAssoc :: cat (t a (t b c)) (t (t a b) c) > rAssoc :: cat (t (t a b) c) (t a (t b c)) This one is nice. Have you thought about other laws, in particular the distributive laws of sums and products (Either and (,))? > I would further propose that all classes named Category* go into > Control.Category, while Arrow* goes into Control.Arrow. The latter can > re-export the Control.Category module. For compatibility reasons, I don't like reusing the Control.Arrow module name. Bertram From bulat.ziganshin at gmail.com Mon Oct 22 16:14:16 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Mon Oct 22 16:37:54 2007 Subject: System.Win32.Types to base library? In-Reply-To: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> Message-ID: <1719363161.20071023001416@gmail.com> Hello Felix, Monday, October 22, 2007, 9:52:35 PM, you wrote: > I am working on some Windows specific code for GHC in the base > library. System.Win32.Types contains basic Win32 types and error > handling functions. Using them would mean a dependency on the Win32 > library. I could duplicate parts of System.Win32.Types that i need, > but is it not preferable to relocate System.Win32.Types to the base > library? NO, because this will lead again to non-upgradability hell. other libraries will need to import these types from different places depending on GHC version where they are runned -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From fmartini at gmail.com Mon Oct 22 17:27:16 2007 From: fmartini at gmail.com (Felix Martini) Date: Mon Oct 22 17:25:06 2007 Subject: System.Win32.Types to base library? In-Reply-To: <1719363161.20071023001416@gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <1719363161.20071023001416@gmail.com> Message-ID: <6c0416190710221427x150a4629uf3da78331f35a3fb@mail.gmail.com> > NO, because this will lead again to non-upgradability hell. other > libraries will need to import these types from different places > depending on GHC version where they are runned Ok, so how about a new module in base for Windows API error handling? E.g. a Foreign.C.Error.Win32 module which resembles Foreign.C.Error. From conal at conal.net Mon Oct 22 17:42:40 2007 From: conal at conal.net (Conal Elliott) Date: Mon Oct 22 17:40:31 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: i'm missing a piece of reasoning. how about having &&& as primitive as in your Cartesian proposal, but without the fst/&&& and snd/&&& laws? you could still introduce those laws in a subclass that does not include Arrow. - Conal On 10/22/07, apfelmus wrote: > > Conal Elliott wrote: > > I like the simplicity of th Cartesian class, including definability of > dup, > > swap, lAssoc, rAssoc, first, and second. > > > > I'm missing the significance of > > > >> But IIRC, (&&&) does impose an "order of side effects" on the > arguments, > > so Arrows are more general (less restrictive) than cartesian categories. > > > > Is it just that you're wondering with what class to associate the > fst/&&& > > and snd/&&& laws? > > > > fst . (f &&& g) = f > > snd . (f &&& g) = g > > Exactly. They often don't hold for Arrows but are taken granted for > Cartesian categories. So, using (&&&) as primitive is - despite its > elegance - not the right thing to do. (That's also why Arrows have first > and second as primitives even when (&&&) makes them superfluous.). > > Regards, > apfelmus > > _______________________________________________ > Libraries mailing list > Libraries@haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071022/745909b6/attachment-0001.htm From duncan.coutts at worc.ox.ac.uk Mon Oct 22 18:57:27 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Mon Oct 22 18:52:28 2007 Subject: Bumping "extralib" library versions In-Reply-To: <20071022144227.GA12149@matrix.chaos.earth.li> References: <1193053385.16641.55.camel@localhost> <20071022131103.GA9292@matrix.chaos.earth.li> <1193061642.16641.76.camel@localhost> <20071022144227.GA12149@matrix.chaos.earth.li> Message-ID: <1193093847.16641.81.camel@localhost> On Mon, 2007-10-22 at 15:42 +0100, Ian Lynagh wrote: > Ah, sorry, my mistake, I hadn't pulled the latest patch. OK, so in > principle I'd be fine with 0.3, except if we want to move to 4-component > version numbers then we need to use 0.3.0.1 anyway (I don't think having > both 0.3 and 0.3.0.0 which don't compare equal is a good idea. We'll > just get confused). > > > > > ========== > > > > X11 > > > > > > > > HEAD repo: http://darcs.haskell.org/packages/X11 > > > > Released version: 1.2.3 (on hackage) > > > > Current version: 1.2.3 > > > > Changes since: none > > > > Suggested next version: not needed > > > > PVP next version: not needed > > > > > > 1.2.3.1 > > > > Again, there are no patches since the patch that tagged version 1.2.3, > > so no new release is needed. > > Again, this is just for the version number length. Ah yes. Fair enough. If we agree in the end that we are going with the package versioning policy then we should do it consistently for the core libs and those included in the extralibs distribution. I agree with the package versioning policy but I don't think we've heard enough of a consensus yet to be confident that people agree that it is the right thing to do. Duncan From twanvl at gmail.com Mon Oct 22 19:27:14 2007 From: twanvl at gmail.com (Twan van Laarhoven) Date: Mon Oct 22 19:25:03 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <20071022200702.GA5712@zombie.inf.tu-dresden.de> References: <471BA338.9080805@gmail.com> <20071022200702.GA5712@zombie.inf.tu-dresden.de> Message-ID: <471D31D2.6030804@gmail.com> Bertram Felgenhauer wrote: > This is a rather finely grained hierarchy, but it's still too coarse > to define a category of invertible functions. That category has pairs: > it supports first, second and (***), but not fst and snd. You are right, That would suggest class Category cat => CategoryPair cat where swap :: cat (a,b) (b,a) first :: cat a b -> cat (a,c) (b,c) second :: cat a b -> cat (c,a) (c,b) (***) :: cat a b -> cat c d -> cat (a,c) (b,d) class CategoryPair cat => CategorySelect cat where fst :: cat (a,b) a snd :: cat (a,b) b And dually class Category cat => CategoryChoice cat where mirror :: cat (Either a b) (Either b a) left :: cat a b -> cat (Either a c) (Either b c) right :: cat a b -> cat (Either c a) (Either c b) (+++) :: cat a b -> cat c d -> cat (Either a c) (Either b d) class CategoryChoice cat => CategoryInject cat where inl :: cat a (Either a b) inr :: cat b (Either a b) Twan From igloo at earth.li Mon Oct 22 20:57:40 2007 From: igloo at earth.li (Ian Lynagh) Date: Mon Oct 22 20:55:33 2007 Subject: Bumping "extralib" library versions In-Reply-To: <20071022131103.GA9292@matrix.chaos.earth.li> References: <1193053385.16641.55.camel@localhost> <20071022131103.GA9292@matrix.chaos.earth.li> Message-ID: <20071023005740.GA29251@matrix.chaos.earth.li> On Mon, Oct 22, 2007 at 02:11:03PM +0100, Ian Lynagh wrote: > > We've discussed this in #ghc, and we think it's best to use 4 component > version numbers so Cabal's snapshot (== append $date) version numbers do > what we want and fit in with us following the proposed policy. Just to clarify, what I meant by this is: Given we are going to use the a.b.c.d scheme where a.b is the major API, we should use version numbers like 2.1.0.0 rather than 2.1 (I wasn't aware of anyone being against the a.b.c.d scheme when I wrote the original mail). If instead we decide to use a.b.c where a is the major API, then we should use 2.1.0 instead rather than 2.1. We do actually need to pick one or the other really quite quickly for the GHC 6.8.1 release, although I don't think getting it wrong and changing our minds later will cause any major problems. My impression from those opinions I've read is that 4-component is more likely to be the concensus. Thanks Ian From ashley at semantic.org Mon Oct 22 22:23:29 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Mon Oct 22 22:21:20 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: <471BA338.9080805@gmail.com> Message-ID: <1193106209.6051.7.camel@sherborne> On Sun, 2007-10-21 at 22:04 +0200, apfelmus wrote: > Twan van Laarhoven wrote: > > My proposal would be the following. The important things are that: > > 1. It incorporates Conal's deep arrow, > > 2. as well as everything that is needed for functional > > references/lenses and bijective/invertible functions. > > I'd opt for more research for that proposal to answer the following > essential questions: > - Do the classes correspond to already-known categories, i.e. are the > class names optimal? > - What laws do we expect to hold? > - Are the signatures minimal, i.e. does there exist a smaller set of > combinators that still achieves the intended effect? Are the signatures > complete, i.e. can the intended effect always expressed with the given > combinators? > - Plenty and useful examples? At least enough examples that fit in the > fine grained hierarchy but cannot be fit into a coarser grained one so > as to demonstrate the necessity of a fine grained hierarchy. I tend to agree. Rather than being part of this change, it might be better for someone to work on this as a separate library, and then make a proposal to redefine the Arrow classes once it's well-understood and settled. -- Ashley Yakeley From haskell at list.mightyreason.com Tue Oct 23 05:05:09 2007 From: haskell at list.mightyreason.com (haskell@list.mightyreason.com) Date: Tue Oct 23 05:03:11 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: <471BA338.9080805@gmail.com> Message-ID: <471DB945.3020407@list.mightyreason.com> Conal Elliott wrote: > I'm delighted to see these interfaces being explored. Question: why > separate fan-out (&&&) from pair? Do you know of type constructors that > have fst & snd but not &&&? Similarly for CategoryAssoc. - Conal > Naively, I would venture that one might not want to be able to consume the input more than once. There were papers that modeled quantum mechanics/computation using arrows, but required care care not to have any fan out. Practically, I have no idea if this is a good example of such a category. -- Chris From bulat.ziganshin at gmail.com Tue Oct 23 06:27:08 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Tue Oct 23 06:26:21 2007 Subject: System.Win32.Types to base library? In-Reply-To: <6c0416190710221424x42364a39v1c5e69152450fa6b@mail.gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <1719363161.20071023001416@gmail.com> <6c0416190710221424x42364a39v1c5e69152450fa6b@mail.gmail.com> Message-ID: <1379196730.20071023142708@gmail.com> Hello Felix, Tuesday, October 23, 2007, 1:24:08 AM, you wrote: >> NO, because this will lead again to non-upgradability hell. other >> libraries will need to import these types from different places >> depending on GHC version where they are runned > Ok, so how about a new module in base for Windows API error handling? > E.g. a Foreign.C.Error.Win32 module which resembles Foreign.C.Error. it will raise the same problem. imho, it's better to redefine as much as possible in other libs, or just reexport `base` types/functions via additional libs -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From simonmarhaskell at gmail.com Tue Oct 23 06:58:22 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Tue Oct 23 06:56:15 2007 Subject: System.Win32.Types to base library? In-Reply-To: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> Message-ID: <471DD3CE.6060904@gmail.com> Felix Martini wrote: > I am working on some Windows specific code for GHC in the base > library. System.Win32.Types contains basic Win32 types and error > handling functions. Using them would mean a dependency on the Win32 > library. I could duplicate parts of System.Win32.Types that i need, > but is it not preferable to relocate System.Win32.Types to the base > library? You don't say what you're working on specifically, but in general the direction we want to move in is to develop new stuff outside of the base package, where you have full access to the Win32 or unix APIs. In the upcoming GHC release we've separated out various parts of base for this reason. Cheers, Simon From josef.svenningsson at gmail.com Tue Oct 23 07:02:41 2007 From: josef.svenningsson at gmail.com (Josef Svenningsson) Date: Tue Oct 23 07:00:32 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: <47188248.3040309@cs.nott.ac.uk> References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> <20071015235003.GB2716@soi.city.ac.uk> <8dde104f0710171051jcce93e7j5e44e3ebe7e0d471@mail.gmail.com> <2608b8a80710180323ked6b468lb4275824cd998bb9@mail.gmail.com> <47188248.3040309@cs.nott.ac.uk> Message-ID: <8dde104f0710230402n3bdd4334s252c088ea42ea850@mail.gmail.com> Sorry for my slow reply, Well, it doesn't seem like we're anywhere near a consensus so I'll just drop this proposal. Let me just finish off by clarifying my views on this ticket as I answer Henrik's post. On 10/19/07, Henrik Nilsson wrote: > So, with the risk of stating what has already been covered, > my concerns are that like Jon I find the reuse of names > unfortunate, especially if it is done in what appears to > be a very central module. Moreover, as functions are perfectly > legitimate arrow instances, I don't really see the point of it all, > and I remain unconvinced by the argument that importing > Control.Arrow somehow is complicated and scary. > I don't think that importing Control.Arrow is complicated of scary. I just think it gives the wrong mental model of what it going on. In Control.Arrow it's all about the process of transforming one thing into the other. Arrows abstract over transformations and gives support for different varieties including transformations which are stateful, can throw exceptions and so on and so forth. However, when we look at the particular case of the function arrow instance there is a different mental model at play. At least for me. When I see the (&&&) operator instantiated for the function arrow I don't think about the process anymore, I think about the objects being manipulated. And the objects in this case are pairs. The reason is that the function arrow is so common in Haskell that at least I don't think about it as anything special. My focus shift towards the things that form the input and output. And those things are pairs in this case. So this really comes down to thinking about morphisms or thinking about objects if you phrase it in category theory lingo. In my brain these two ways of thinking are different and therefore I like to have separate functions for these two models. Even if it means that two functions are computationally equal. But maybe the problem is simply that I'm stupid and should learn to think about these two mental models as one :-). The other side of the coin is what to name the functions. For this proposal I chose the same names as their generalized counterparts. I can see why that worries people although I don't share that feeling. We have a module system whose purpose is (among other things) to handle names. It does so rather well, consider for instance Data.Map and Data.Set which I use extensively in my everyday programming. They have a lot of function names in common and which also clashes with Prelude names and other libraries. It's not a problem to have several functions having the same name. It's actually a feature which lessens the burden of remembering a ton of names and which shows that their intended semantics is, if not equal, then strongly related. Having these tuple function from my proposal but under different names would be OK for me though. It would be better that not having them at all. > It may well be, of course, that the current class hierarchy > isn't factored the right way, i.e. that operations like &&& and > *** should live some place else entirely. (This wouldn't be > the first instance of such problems.) That might be true. I don't have any opinion on that. > That's a somewhat orthogonal > discussion, though. But defining &&& and *** in more places > certainly isn't going to help. > Well, I disagree with that but I've already said why so no need to rehash it here. I guess we can agree to disagree. Cheers, /Josef From josef.svenningsson at gmail.com Tue Oct 23 08:10:28 2007 From: josef.svenningsson at gmail.com (Josef Svenningsson) Date: Tue Oct 23 08:08:19 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: <1193106209.6051.7.camel@sherborne> References: <471BA338.9080805@gmail.com> <1193106209.6051.7.camel@sherborne> Message-ID: <8dde104f0710230510kcfcd46ci8ca2ffab046333a2@mail.gmail.com> On 10/23/07, Ashley Yakeley wrote: > On Sun, 2007-10-21 at 22:04 +0200, apfelmus wrote: > > Twan van Laarhoven wrote: > > > My proposal would be the following. The important things are that: > > > 1. It incorporates Conal's deep arrow, > > > 2. as well as everything that is needed for functional > > > references/lenses and bijective/invertible functions. > > > > I'd opt for more research for that proposal to answer the following > > essential questions: > > - Do the classes correspond to already-known categories, i.e. are the > > class names optimal? > > - What laws do we expect to hold? > > - Are the signatures minimal, i.e. does there exist a smaller set of > > combinators that still achieves the intended effect? Are the signatures > > complete, i.e. can the intended effect always expressed with the given > > combinators? > > - Plenty and useful examples? At least enough examples that fit in the > > fine grained hierarchy but cannot be fit into a coarser grained one so > > as to demonstrate the necessity of a fine grained hierarchy. > > I tend to agree. Rather than being part of this change, it might be > better for someone to work on this as a separate library, and then make > a proposal to redefine the Arrow classes once it's well-understood and > settled. > +1 /Josef From nhn at Cs.Nott.AC.UK Tue Oct 23 08:15:42 2007 From: nhn at Cs.Nott.AC.UK (Henrik Nilsson) Date: Tue Oct 23 08:16:23 2007 Subject: Proposal: Add &&& and *** to Data.Tuple In-Reply-To: <8dde104f0710230402n3bdd4334s252c088ea42ea850@mail.gmail.com> References: <8dde104f0709170623h672ee600t569f1637664d5a6c@mail.gmail.com> <8dde104f0709270644u1b52e1cm49a10083f83eec82@mail.gmail.com> <8dde104f0710151216k7836c3f8ra75fb165fe050a1@mail.gmail.com> <20071015235003.GB2716@soi.city.ac.uk> <8dde104f0710171051jcce93e7j5e44e3ebe7e0d471@mail.gmail.com> <2608b8a80710180323ked6b468lb4275824cd998bb9@mail.gmail.com> <47188248.3040309@cs.nott.ac.uk> <8dde104f0710230402n3bdd4334s252c088ea42ea850@mail.gmail.com> Message-ID: <471DE5EE.6080006@cs.nott.ac.uk> Hi Josef, Thanks for the thorough and thoughtful reply. You do make a number of good points, and if people in general think this is a good proposal, I don't want to be the one killing it. However, I have thought a bit more about what really bothers me about the proposal, and I think it is this. You say: > The other side of the coin is what to name the functions. For this > proposal I chose the same names as their generalized counterparts. I > can see why that worries people although I don't share that feeling. > We have a module system whose purpose is (among other things) to > handle names. It does so rather well, consider for instance Data.Map > and Data.Set which I use extensively in my everyday programming. They > have a lot of function names in common and which also clashes with > Prelude names and other libraries. It's not a problem to have several > functions having the same name. It's actually a feature which lessens > the burden of remembering a ton of names and which shows that their > intended semantics is, if not equal, then strongly related. Yes. If it truly were the case that we were talking about different *functions* having the same name, I wouldn't be concerned. Data.Map and Data.Set are good examples. But here we are talking about reusing the name of a method, i.e. an already overloaded entity, as a function. That does bother me, for some reason. I guess one level of overloading too many for my taste. (Maybe my brain just cannot cope! ;-) I'd be equally concerned if someone suggested using well-established methods from, say, the Monad class for something else. Part of it is also that the fact that an entity belongs to a class notionally representing some mathematical structure implies a "moral obligation" that instances of that entity should conform to the structure, even if Haskell does not enforce this. Using such a name for something else breaks or at least weakens that conceptual link, which I think would be a pity. Sorry that I don't have time to give a more in-depth reply at this point. Best, /Henrik -- Henrik Nilsson School of Computer Science and Information Technology The University of Nottingham nhn@cs.nott.ac.uk 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 isaacdupree at charter.net Tue Oct 23 08:46:40 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Tue Oct 23 08:47:04 2007 Subject: Bumping "extralib" library versions In-Reply-To: <20071023005740.GA29251@matrix.chaos.earth.li> References: <1193053385.16641.55.camel@localhost> <20071022131103.GA9292@matrix.chaos.earth.li> <20071023005740.GA29251@matrix.chaos.earth.li> Message-ID: <471DED30.8060802@charter.net> Ian Lynagh wrote: > We do actually need to pick one or the other really quite quickly for > the GHC 6.8.1 release, although I don't think getting it wrong and > changing our minds later will cause any major problems. My impression > from those opinions I've read is that 4-component is more likely to be > the concensus. FWIW, I prefer the 4-component becoming the standard one. I wonder if the notions of API version and code version ought to be separable... Isaac From fmartini at gmail.com Tue Oct 23 11:22:19 2007 From: fmartini at gmail.com (Felix Martini) Date: Tue Oct 23 11:20:08 2007 Subject: System.Win32.Types to base library? In-Reply-To: <471DD3CE.6060904@gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <471DD3CE.6060904@gmail.com> Message-ID: <6c0416190710230822mcafcb74r76894499c9641b00@mail.gmail.com> 2007/10/23, Simon Marlow: > You don't say what you're working on specifically, but in general the > direction we want to move in is to develop new stuff outside of the base > package, where you have full access to the Win32 or unix APIs. In the > upcoming GHC release we've separated out various parts of base for this reason. I'm working on overlapped IO support for Haskell handles (sockets in particular) using an IO completion port. I'll put the code in a separate library. Regards, Felix From simonmarhaskell at gmail.com Tue Oct 23 11:47:17 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Tue Oct 23 11:45:11 2007 Subject: System.Win32.Types to base library? In-Reply-To: <6c0416190710230822mcafcb74r76894499c9641b00@mail.gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <471DD3CE.6060904@gmail.com> <6c0416190710230822mcafcb74r76894499c9641b00@mail.gmail.com> Message-ID: <471E1785.8000008@gmail.com> Felix Martini wrote: > 2007/10/23, Simon Marlow: >> You don't say what you're working on specifically, but in general the >> direction we want to move in is to develop new stuff outside of the base >> package, where you have full access to the Win32 or unix APIs. In the >> upcoming GHC release we've separated out various parts of base for this reason. > > I'm working on overlapped IO support for Haskell handles (sockets in > particular) using an IO completion port. I'll put the code in a > separate library. ooh, that would be nice. I imagine it won't be possible to put it in a separate library and have it work nicely with the existing Handle implementation; you really want it to replace the existing low-level IO for Handles. If you could integrate it with the existing IO manager thread in GHC.Conc, then all the better. In that case I suggest the best option for now is to pull in as much Win32 support as you need, in a similar way to System.Posix.Internals which has the POSIX bits that the base package needs to know about. Cheers, Simon From bulat.ziganshin at gmail.com Tue Oct 23 12:32:59 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Tue Oct 23 12:32:01 2007 Subject: System.Win32.Types to base library? In-Reply-To: <6c0416190710230822mcafcb74r76894499c9641b00@mail.gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <471DD3CE.6060904@gmail.com> <6c0416190710230822mcafcb74r76894499c9641b00@mail.gmail.com> Message-ID: <18689100.20071023203259@gmail.com> Hello Felix, Tuesday, October 23, 2007, 7:22:19 PM, you wrote: > I'm working on overlapped IO support for Haskell handles (sockets in > particular) using an IO completion port. I'll put the code in a > separate library. imho, it's better to put it into separate library. consider also an option to provide it as extension to the my Streams library ( http://haskell.org/haskellwiki/Library/Streams ) long time there was discussion about making universal API to the various overlapped IO interfaces (epoll, kqueue..), i think that Win32 support may be a part of this. unfortunately, we lack enough level of interest to complete the new I/O library development, although there is significant interest from some developers -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From igloo at earth.li Tue Oct 23 13:02:57 2007 From: igloo at earth.li (Ian Lynagh) Date: Tue Oct 23 13:00:46 2007 Subject: System.Win32.Types to base library? In-Reply-To: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> Message-ID: <20071023170257.GA16800@matrix.chaos.earth.li> On Mon, Oct 22, 2007 at 07:52:35PM +0200, Felix Martini wrote: > I am working on some Windows specific code for GHC in the base > library. System.Win32.Types contains basic Win32 types and error > handling functions. Using them would mean a dependency on the Win32 > library. I could duplicate parts of System.Win32.Types that i need, > but is it not preferable to relocate System.Win32.Types to the base > library? This won't help you right now, but FYI the long term plan is to split the base package up to the extent that Win32 can be underneath most of base rather than on top of it. Thanks Ian From ramsdell at mitre.org Tue Oct 23 16:03:13 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Tue Oct 23 16:01:00 2007 Subject: Packages within a package Message-ID: When I first carefully read the Cabal documentation, I remember wondering why there is a limit of one on the number of libraries in a package. Reflecting on autoconf, and its AC_CONFIG_SUBDIRS macro, I also wondered why packages cannot be components of a package. If you wrote a symbolic model checker, and you want it to be used with a specific version of a binary decision diagram package, the simplest way of enforcing this restriction is by including the package within yours. This is in fact how NuSMV is distributed. (It includes CUDD.) Recently, when I discovered there is no direct support for linking the executables in a package with the library it defines, I wondered why the advice was to separate the library and the executables into two packages even though both are meant to be used and distributed as a unit. Does Cabal not support things like packages within a package simply because Haskell libraries currently are not complex enough to require such a feature, or is there a guiding design principle with which these features are incompatible? John From conal at conal.net Tue Oct 23 16:04:42 2007 From: conal at conal.net (Conal Elliott) Date: Tue Oct 23 16:02:35 2007 Subject: !! for Data.Stream Message-ID: I see that (!!) for Data.Stream has arguments reversed, compared to !! on lists. The Haddock comment, however, suggests otherwise. Is the argument reversal intended? - Conal >From Data.Stream: -- | @xs !! n@ returns the element of the stream @xs@ at index -- @n@. Note that the head of the stream has index 0. -- -- /Beware/: passing a negative integer as the first argument will cause -- an error. (!!) :: Int -> Stream a -> a (!!) n (Cons x xs) | n == 0 = x | n > 0 = (!!) (n - 1) xs | otherwise = error "Stream.!! negative argument" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071023/f6dece48/attachment.htm From bulat.ziganshin at gmail.com Tue Oct 23 15:48:56 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Tue Oct 23 16:14:28 2007 Subject: System.Win32.Types to base library? In-Reply-To: <20071023170257.GA16800@matrix.chaos.earth.li> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <20071023170257.GA16800@matrix.chaos.earth.li> Message-ID: <861999117.20071023234856@gmail.com> Hello Ian, Tuesday, October 23, 2007, 9:02:57 PM, you wrote: > This won't help you right now, but FYI the long term plan is to split > the base package up to the extent that Win32 can be underneath most of > base rather than on top of it. the Handle type is used in the IOException type which is used in IO type definition and Prelude.catch. so it will be hard to move Handle definition outside of GHC/IOBase module -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lemming at henning-thielemann.de Tue Oct 23 16:21:52 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue Oct 23 16:19:41 2007 Subject: Packages within a package In-Reply-To: References: Message-ID: On Tue, 23 Oct 2007, John D. Ramsdell wrote: > When I first carefully read the Cabal documentation, I remember > wondering why there is a limit of one on the number of libraries in a > package. Reflecting on autoconf, and its AC_CONFIG_SUBDIRS macro, I > also wondered why packages cannot be components of a package. If you > wrote a symbolic model checker, and you want it to be used with a > specific version of a binary decision diagram package, the simplest > way of enforcing this restriction is by including the package within > yours. This is in fact how NuSMV is distributed. (It includes CUDD.) Having sub-packages is also one thing I need, but your example is one where I think that sub-packages are the wrong approach. Uploading the imported package (the binary decision diagram one) to hackage.haskell.org and including it (in the symbolic model checker) with the concrete version number is the better way. > Recently, when I discovered there is no direct support for linking the > executables in a package with the library it defines, You can define executables in a package which are automatically build - however Cabal will recompile the imported modules instead of using the compiled ones from the library part. > I wondered why the advice was to separate the library and the > executables into two packages even though both are meant to be used and > distributed as a unit. As far as I know the future plan is to split Cabal projects into library and executable parts and then to allow also multiple library parts. This way you could provide parts for special applications or different operating systems. > Does Cabal not support things like packages within a package simply > because Haskell libraries currently are not complex enough to require > such a feature, or is there a guiding design principle with which > these features are incompatible? It was requested several times but it seems not to be designed and implemented so easily. From benja.fallenstein at gmail.com Tue Oct 23 18:01:25 2007 From: benja.fallenstein at gmail.com (Benja Fallenstein) Date: Tue Oct 23 17:59:14 2007 Subject: Let's do ListT right, finally In-Reply-To: <2608b8a80710170728l6ee5ec3fwda29eb5146824ff0@mail.gmail.com> References: <2608b8a80710141200k665403bhfa1ee3cd8ba6692e@mail.gmail.com> <20071017135907.GB28313@matrix.chaos.earth.li> <2608b8a80710170728l6ee5ec3fwda29eb5146824ff0@mail.gmail.com> Message-ID: Hi, 2007/10/17, Yitzchak Gale : > I wrote: > >> Do we need to worry about breaking code? > > 2. Fenfire does seem to be under current development. > I'm not sure how this change would affect them. Yitz asked Tuukka and me about this in private mail (sorry for the late reply). We're actually working on other stuff currently but might be getting back to Fenfire, but no problem -- doing ListT right won't be a problem for us :-) Thanks for asking! - Benja From wss at Cs.Nott.AC.UK Wed Oct 24 03:22:18 2007 From: wss at Cs.Nott.AC.UK (Wouter Swierstra) Date: Wed Oct 24 03:20:55 2007 Subject: !! for Data.Stream In-Reply-To: References: Message-ID: > I see that (!!) for Data.Stream has arguments reversed, compared > to !! on lists. The Haddock comment, however, suggests otherwise. > Is the argument reversal intended? Well spotted Conal! I've uploaded a new version (0.2.1) to Hackage that fixes this. Thanks for the e-mail, 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 duncan.coutts at worc.ox.ac.uk Wed Oct 24 04:51:45 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Oct 24 04:46:39 2007 Subject: Packages within a package In-Reply-To: References: Message-ID: <1193215905.16641.155.camel@localhost> On Tue, 2007-10-23 at 22:21 +0200, Henning Thielemann wrote: > > Does Cabal not support things like packages within a package simply > > because Haskell libraries currently are not complex enough to require > > such a feature, or is there a guiding design principle with which > > these features are incompatible? > > It was requested several times but it seems not to be designed and > implemented so easily. The design choice is that the Cabal package is the unit of distribution. Of course what one sees as a system may well consist of multiple interdependent packages. The direction I think we're moving in is to try to improve our tools to make it easier for developers to work with systems that consist of multiple packages. However from the distribution and installation point of view, nothing needs to change, the package remains the unit of distribution. As far as I can see that covers all the cases where we might want "distributions", "shipments" or "sub-packages". Of course if anyone has any examples where they think our model might not cover things we should bring them up and consider them. The example I often think about is Gtk2Hs which now consists of 12 libraries, uses two different code generators, two FFI binding tools, lots of cpp and autoconf and has unified documentation, tutorials and demo code. Many of the features we have been adding to Cabal recently have been getting us closer to the stage where we can build and distribute Gtk2Hs using Cabal. Duncan From lemming at henning-thielemann.de Wed Oct 24 08:34:14 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Wed Oct 24 08:32:00 2007 Subject: Packages within a package In-Reply-To: <1193215905.16641.155.camel@localhost> References: <1193215905.16641.155.camel@localhost> Message-ID: On Wed, 24 Oct 2007, Duncan Coutts wrote: > On Tue, 2007-10-23 at 22:21 +0200, Henning Thielemann wrote: > > > > Does Cabal not support things like packages within a package simply > > > because Haskell libraries currently are not complex enough to require > > > such a feature, or is there a guiding design principle with which > > > these features are incompatible? > > > > It was requested several times but it seems not to be designed and > > implemented so easily. > > The design choice is that the Cabal package is the unit of distribution. > Of course what one sees as a system may well consist of multiple > interdependent packages. > > The direction I think we're moving in is to try to improve our tools to > make it easier for developers to work with systems that consist of > multiple packages. However from the distribution and installation point > of view, nothing needs to change, the package remains the unit of > distribution. > > As far as I can see that covers all the cases where we might want > "distributions", "shipments" or "sub-packages". Of course if anyone has > any examples where they think our model might not cover things we should > bring them up and consider them. If it becomes much easier to handle multiple packages this might work. - Recompiling multiple packages must be simplified, because I use Cabal in the development phase. If one "sub-package" changes it must be simple to recompile the package set and to import modified "sub-packages" without their installation. (Because installation might overwrite valid code with buggy code.) This includes finding the right order of package compilation according to the package dependencies. (I have even some code using FGL for this task, if someone is interested.) - It must be simple to distribute and to download multiple packages that belong together. It would be nice if one could maintain several packages which share the same 'src' directory in one darcs repository, which is of course duplicated on distribution. Say Foo.cabal Hs-Source-Dirs: src Exposed-Modules: Data.Structure.Foo Bar.cabal Hs-Source-Dirs: src Exposed-Modules: Data.Structure.Bar FooDemo.cabal Hs-Source-Dirs: demo Main-Is: FooDemo.hs BarDemo.cabal Hs-Source-Dirs: demo Main-Is: BarDemo.hs src/Data/Structure/Foo.hs src/Data/Structure/Bar.hs demo/FooDemo.hs demo/BarDemo.hs From ramsdell at mitre.org Wed Oct 24 08:53:35 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Wed Oct 24 08:51:27 2007 Subject: Packages within a package In-Reply-To: References: Message-ID: Henning Thielemann writes: > Having sub-packages is also one thing I need, but your example is > one where I think that sub-packages are the wrong > approach. Uploading the imported package (the binary decision > diagram one) to hackage.haskell.org and including it (in the > symbolic model checker) with the concrete version number is the > better way. The developer in my hypothetical symbolic model checker example decided to include a specific version of a binary decision diagram package within his system, just as the developers of NuSMV decided to incorporate CUDD into their distribution. You cannot second guess his/her decision. You should assume the developer knows about hackage.haskell.org, and chose not to use it, say for legal reasons. I cannot help but observe that I have received several answers on this list that show a distrust in wishes of Cabal users. Instead of addressing the needs given by the question, some of the answers are of the form: you shouldn't be doing that, followed by a tortured method for cramming the problem into the existing set of abstractions. The point of the questions is to get people to reassess the set of abstractions. > > Recently, when I discovered there is no direct support for linking the > > executables in a package with the library it defines, > > You can define executables in a package which are automatically build - > however Cabal will recompile the imported modules instead of using the > compiled ones from the library part. In a previous note, I showed how to get around this deficiency in Cabal using hook functions. With more use, I have since refined the code I sent to the list. If anyone wants the improved version, I'll send it to you. By the way, I think it is a tribute to the Cabal design, and the hook design in particular, that it was so easy for me to fix the problem using public interfaces, and just a small amount of code and effort. > > I wondered why the advice was to separate the library and the > > executables into two packages even though both are meant to be > > used and distributed as a unit. > > As far as I know the future plan is to split Cabal projects into > library and executable parts and then to allow also multiple library > parts. This way you could provide parts for special applications or > different operating systems. Please do not drop support for packaging a library with executables build on top of the library. The hook function hack noted above allows me to make it so that Cabal serves my needs, and one package can be used to distribute my system as a single unit. > > Does Cabal not support things like packages within a package > > simply because Haskell libraries currently are not complex enough > > to require such a feature, or is there a guiding design principle > > with which these features are incompatible? > > It was requested several times but it seems not to be designed and > implemented so easily. I bet it's easier than you think. You just have to dynamically generate package configuration files, just as I did to resolve my linking problem. John From ramsdell at mitre.org Wed Oct 24 09:03:37 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Wed Oct 24 09:03:39 2007 Subject: Packages within a package In-Reply-To: <1193215905.16641.155.camel@localhost> References: <1193215905.16641.155.camel@localhost> Message-ID: Duncan Coutts writes: > The design choice is that the Cabal package is the unit of > distribution. Of course what one sees as a system may well consist > of multiple interdependent packages. I think developers want support for developing and distributing systems as a unit. John From lemming at henning-thielemann.de Wed Oct 24 09:13:23 2007 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Wed Oct 24 09:11:08 2007 Subject: Packages within a package In-Reply-To: References: Message-ID: On Wed, 24 Oct 2007, John D. Ramsdell wrote: > Henning Thielemann writes: > > > It was requested several times but it seems not to be designed and > > implemented so easily. > > I bet it's easier than you think. You just have to dynamically > generate package configuration files, just as I did to resolve my > linking problem. I think that this solution was already discussed. It has the drawback that I can no longer be sure what's actually in an installed package. If I have the package dependency foobar=1.0 in my Cabal file then I must be sure that foobar-1.0 on every user machine will contain all the modules in the same state as I have installed on my machine. If Cabal packages are mapped 1:1 to Debian or RPM packages then it would be really cumbersome to have to split up a project to one Cabal package per executable. Otherwise it's ok for me to handle executables in separate units ("sub-packages" or just "packages"). From duncan.coutts at worc.ox.ac.uk Wed Oct 24 10:04:34 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Oct 24 09:59:25 2007 Subject: Packages within a package In-Reply-To: References: <1193215905.16641.155.camel@localhost> Message-ID: <1193234674.16641.188.camel@localhost> On Wed, 2007-10-24 at 09:03 -0400, John D. Ramsdell wrote: > Duncan Coutts writes: > > > The design choice is that the Cabal package is the unit of > > distribution. Of course what one sees as a system may well consist > > of multiple interdependent packages. > > I think developers want support for developing and distributing > systems as a unit. I think I'm claiming that developers want support for developing systems as a unit but distribution can be as a collection of components rather than as a unit. Then using a package manager or cabal-install a user can pull in the components they need, including pulling in their dependencies automatically. Duncan From duncan.coutts at worc.ox.ac.uk Wed Oct 24 10:21:07 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Oct 24 10:15:58 2007 Subject: Packages within a package In-Reply-To: References: <1193215905.16641.155.camel@localhost> Message-ID: <1193235667.16641.205.camel@localhost> On Wed, 2007-10-24 at 14:34 +0200, Henning Thielemann wrote: > On Wed, 24 Oct 2007, Duncan Coutts wrote: > > As far as I can see that covers all the cases where we might want > > "distributions", "shipments" or "sub-packages". Of course if anyone has > > any examples where they think our model might not cover things we should > > bring them up and consider them. > > If it becomes much easier to handle multiple packages this might work. > - Recompiling multiple packages must be simplified, because I use Cabal > in the development phase. Yes. We want to be able to build and use collections of packages inplace and to handle rebuilding automatically. Currently that has to be done manually by the developer which is a pain. I'd like to see Cabal do proper dependency analysis within and between packages in a source tree and build a single module dep graph and rebuild minimally (and in parallel). If this sounds an awful lot like make then that's no coincidence. > - It must be simple to distribute and to download multiple packages that > belong together. That is what cabal-install is for. It's available from hackage now although as somewhat of a preview. We'd like feedback on it, bug reports and patches. Then there are also the tools that convert cabal packages into native system packages and then we can let the native package manager handle the dependencies. For example I would imagine distributing Gtk2Hs as several .tar.gz packages on hackage. They would of course have interdependencies and most probably with very strict version ranges. One could then cabal-install the gtk package and have it pull in all of it's dependent packages, or when the distro package catches up then one could install that. My main point here is that it's perfectly possible to distribute a system as a bunch of packages. For example systems like Gnome or x.org's X windows system are distributed as 100's of individual .tar.gz packages with dependencies between them. This allows them to do incremental releases of bits of the system without having to do everything in one go. > It would be nice if one could maintain several packages > which share the same 'src' directory in one darcs repository, which is > of course duplicated on distribution. Right, when you do a cabal sdist then it makes a tarball which contains all the files necessary to build that package. This may well duplicate shared files. Duncan From ramsdell at mitre.org Wed Oct 24 12:05:33 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Wed Oct 24 12:03:19 2007 Subject: Packages within a package In-Reply-To: References: Message-ID: Henning Thielemann writes: > On Wed, 24 Oct 2007, John D. Ramsdell wrote: > > > Henning Thielemann writes: > > > > > It was requested several times but it seems not to be designed and > > > implemented so easily. > > > > I bet it's easier than you think. You just have to dynamically > > generate package configuration files, just as I did to resolve my > > linking problem. > > I think that this solution was already discussed. It has the > drawback that I can no longer be sure what's actually in an > installed package. ... For the NuSMV motivated case, subpackages are never installed. You use them only to build the libraries and executables that are exported by the top-level package, and thus one is always sure what is installed by a package, and that subpackages cannot cause installation conflicts. Of course your point was aimed at more general cases, ones that aren't solved by the simple suggestion I made. I'll try to come up with a suggestion that handles more cases. John From ramsdell at mitre.org Wed Oct 24 13:08:27 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Wed Oct 24 13:06:14 2007 Subject: Packages within a package In-Reply-To: <1193234674.16641.188.camel@localhost> References: <1193215905.16641.155.camel@localhost> <1193234674.16641.188.camel@localhost> Message-ID: Duncan Coutts writes: > I think I'm claiming that developers want support for developing > systems as a unit but distribution can be as a collection of > components rather than as a unit. Do you believe it is a bad idea to expect that Cabal be the appropriate tool for developing systems as a unit? Maybe Cabal should do just one thing, and one thing well, package components of systems into the smallest units available for distribution. I had been thinking of Cabal as a development tool as well as a packaging tool, similar to autoconf/automake, but perhaps Cabal is really meant to be similar to rpmbuild and dpkg-buildpackage. Maybe thinking of it as a development tool was an error on my part. For my application, I suppose I could use autoconf/automake to develop the software, install the executables, build a Cabal package description, and then use it with Cabal to make the library available as a package. Is this usage more inline with your intentions? John From duncan.coutts at worc.ox.ac.uk Wed Oct 24 14:19:23 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Wed Oct 24 14:14:16 2007 Subject: Packages within a package In-Reply-To: References: <1193215905.16641.155.camel@localhost> <1193234674.16641.188.camel@localhost> Message-ID: <1193249963.16641.223.camel@localhost> On Wed, 2007-10-24 at 13:08 -0400, John D. Ramsdell wrote: > Duncan Coutts writes: > > > I think I'm claiming that developers want support for developing > > systems as a unit but distribution can be as a collection of > > components rather than as a unit. > > Do you believe it is a bad idea to expect that Cabal be the > appropriate tool for developing systems as a unit? No. > Maybe Cabal should do just one thing, and one thing well, package > components of systems into the smallest units available for > distribution. > > I had been thinking of Cabal as a development tool as well as a > packaging tool, similar to autoconf/automake, but perhaps Cabal is > really meant to be similar to rpmbuild and dpkg-buildpackage. Maybe > thinking of it as a development tool was an error on my part. Currently it only helps with a single package at a time, so dealing with multi-package systems is cumbersome. The intention is to extend it to help developers working with multi-package systems. My claim is that all that requires is improvements in the tools, not a change in the notion of a package as the unit of distribution and dependency. > For my application, I suppose I could use autoconf/automake to develop > the software, install the executables, build a Cabal package > description, and then use it with Cabal to make the library available > as a package. Is this usage more inline with your intentions? We'd like to kill off autoconf as much as possible. :-) So we hope that developers will work directly with Cabal rather than generating Cabal packages from other systems. As I said before, my personal example is Gtk2Hs which is a relatively complex multi-package system. Currently it is impossible to package it with Cabal but we're getting closer. Gtk2Hs currently uses autoconf/automake and I can build everything with: ./configure make and I can rebuild everything with just make. And if there's nothing to do it takes a fraction of a second to work this out. I'd like to get to that stage with cabal. I'd like to say: cabal configure cabal build Or maybe just cabal build to get default configure parameters. And if I run cabal sdist I'd expect it to generate twelve .tar.gz packages that I can upload to hackage. With that kind of infrastructure there's lots of fun stuff we could do, like continuous build and test: cabal build --continuous & To get there of course we'll need lots of help from lots of people. I'd like to encourage people to get involved. Duncan From ashley at semantic.org Wed Oct 24 15:50:03 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Wed Oct 24 15:48:34 2007 Subject: Packages within a package In-Reply-To: <1193249963.16641.223.camel@localhost> References: <1193215905.16641.155.camel@localhost> <1193234674.16641.188.camel@localhost> <1193249963.16641.223.camel@localhost> Message-ID: Duncan Coutts wrote: > We'd like to kill off autoconf as much as possible. :-) +1 -- Ashley Yakeley From ramsdell at mitre.org Wed Oct 24 15:56:07 2007 From: ramsdell at mitre.org (John D. Ramsdell) Date: Wed Oct 24 15:53:52 2007 Subject: Packages within a package In-Reply-To: <1193249963.16641.223.camel@localhost> References: <1193215905.16641.155.camel@localhost> <1193234674.16641.188.camel@localhost> <1193249963.16641.223.camel@localhost> Message-ID: Duncan Coutts writes: > We'd like to kill off autoconf as much as possible. :-) For Haskell, this is okay by me. > As I said before, my personal example is Gtk2Hs ... This is an excellent example. John From simonmarhaskell at gmail.com Thu Oct 25 06:03:13 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Thu Oct 25 06:01:03 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <20071021125508.GA30931@web.de> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> Message-ID: <472069E1.8060106@gmail.com> Duncan and I have started a wiki page to collect proposals for ways to avoid or alleviate the pain from future package reorganisations. http://hackage.haskell.org/trac/ghc/wiki/PackageCompatibility It's been helpful for me to write all this down, the issues seem much clearer. However, I don't see an obviously best solution. For me proposal 4.2 (see the wiki page) looks the most promising, but it doesn't provide complete backwards compatibility, so I imagine there will be people who disagree. Please read the page. Fix problems, add rationale, add proposals if you have any that are substantially different from those already there. For general discussion just reply to this message (replies directed to libraries@haskell.org). Cheers, Simon From simonmarhaskell at gmail.com Thu Oct 25 06:15:05 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Thu Oct 25 06:12:53 2007 Subject: System.Win32.Types to base library? In-Reply-To: <861999117.20071023234856@gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <20071023170257.GA16800@matrix.chaos.earth.li> <861999117.20071023234856@gmail.com> Message-ID: <47206CA9.906@gmail.com> Bulat Ziganshin wrote: > Tuesday, October 23, 2007, 9:02:57 PM, you wrote: > >> This won't help you right now, but FYI the long term plan is to split >> the base package up to the extent that Win32 can be underneath most of >> base rather than on top of it. > > the Handle type is used in the IOException type which is used in IO > type definition and Prelude.catch. so it will be hard to move Handle > definition outside of GHC/IOBase module Ultimately, the whole IO library needs to be separated. I think a prerequisite for this will be to do extensible exceptions, because the reason that everything is so tightly coupled at the moment is because the Monad instance for IO refers to Exception, and Exception refers to Handle, as you say. With extensible exceptions we can break this dependency. Cheers, Simon From simonmarhaskell at gmail.com Thu Oct 25 06:19:41 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Thu Oct 25 06:17:30 2007 Subject: System.Win32.Types to base library? In-Reply-To: <18689100.20071023203259@gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <471DD3CE.6060904@gmail.com> <6c0416190710230822mcafcb74r76894499c9641b00@mail.gmail.com> <18689100.20071023203259@gmail.com> Message-ID: <47206DBD.4030808@gmail.com> Bulat Ziganshin wrote: > Tuesday, October 23, 2007, 7:22:19 PM, you wrote: > >> I'm working on overlapped IO support for Haskell handles (sockets in >> particular) using an IO completion port. I'll put the code in a >> separate library. > > imho, it's better to put it into separate library. consider also an > option to provide it as extension to the my Streams library > ( http://haskell.org/haskellwiki/Library/Streams ) Sure, but that would preclude using overlapped IO in the standard Handle implementation, which is where we need it right now. You want to be able to do ByteString IO using overlapped IO underneath, for example. I'm not claiming this is a good long-term plan, but in order for it to be useful *now*, it has to go into base. Cheers, Simon From ketil+haskell at ii.uib.no Thu Oct 25 06:31:05 2007 From: ketil+haskell at ii.uib.no (Ketil Malde) Date: Thu Oct 25 06:34:22 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <472069E1.8060106@gmail.com> (Simon Marlow's message of "Thu\, 25 Oct 2007 11\:03\:13 +0100") References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> Message-ID: <873avz1o5y.fsf@nmd9999.imr.no> Simon Marlow writes: > http://hackage.haskell.org/trac/ghc/wiki/PackageCompatibility > It's been helpful for me to write all this down, the issues seem much > clearer. However, I don't see an obviously best solution. For me > proposal 4.2 (see the wiki page) looks the most promising, but it > doesn't provide complete backwards compatibility, so I imagine there > will be people who disagree. The section "The problem of lax version dependencies" refers to "Solution 3", which doesn't seem to exists. Presumably "Solution 2" is meant? Wouldn't keeping "base-2.0" and rebranding "base-3.0" to "foundation-1.0" (which might be listed as "Solution 2.1") solve this issue? -k -- If I haven't seen further, it is by standing in the footprints of giants From Malcolm.Wallace at cs.york.ac.uk Thu Oct 25 06:44:47 2007 From: Malcolm.Wallace at cs.york.ac.uk (Malcolm Wallace) Date: Thu Oct 25 06:45:55 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <472069E1.8060106@gmail.com> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> Message-ID: <20071025114447.1787800b.Malcolm.Wallace@cs.york.ac.uk> Simon Marlow wrote: > http://hackage.haskell.org/trac/ghc/wiki/PackageCompatibility Good summary. One minor point: the section at the end, on "The problem of lax version dependencies", refers to solution 3, but there _is_ no solution 3: the list jumps direct from 2 to 4. So I couldn't follow the reasoning there. Regards, Malcolm From bulat.ziganshin at gmail.com Thu Oct 25 07:41:05 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Thu Oct 25 07:47:41 2007 Subject: System.Win32.Types to base library? In-Reply-To: <47206CA9.906@gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <20071023170257.GA16800@matrix.chaos.earth.li> <861999117.20071023234856@gmail.com> <47206CA9.906@gmail.com> Message-ID: <1177044657.20071025154105@gmail.com> Hello Simon, Thursday, October 25, 2007, 2:15:05 PM, you wrote: > Ultimately, the whole IO library needs to be separated. I think a > prerequisite for this will be to do extensible exceptions, because the > reason that everything is so tightly coupled at the moment is because the > Monad instance for IO refers to Exception, and Exception refers to Handle, > as you say. With extensible exceptions we can break this dependency. yes, my thought was exactly the same. this plan looks real. i propose to return to debating it when GHC team will have time, under the "further split of Base" title -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From bulat.ziganshin at gmail.com Thu Oct 25 07:47:28 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Thu Oct 25 07:47:46 2007 Subject: System.Win32.Types to base library? In-Reply-To: <47206DBD.4030808@gmail.com> References: <6c0416190710221052r1be794c5p8983053e5a2cd8ab@mail.gmail.com> <471DD3CE.6060904@gmail.com> <6c0416190710230822mcafcb74r76894499c9641b00@mail.gmail.com> <18689100.20071023203259@gmail.com> <47206DBD.4030808@gmail.com> Message-ID: <277149009.20071025154728@gmail.com> Hello Simon, Thursday, October 25, 2007, 2:19:41 PM, you wrote: >> imho, it's better to put it into separate library. consider also an >> option to provide it as extension to the my Streams library >> ( http://haskell.org/haskellwiki/Library/Streams ) > Sure, but that would preclude using overlapped IO in the standard Handle > implementation, which is where we need it right now. You want to be able > to do ByteString IO using overlapped IO underneath, for example. > I'm not claiming this is a good long-term plan, but in order for it to be > useful *now*, it has to go into base. it's interesting that my understanding of situation is directly opposite - anything implemented just now in terms of base cannot be used next 1-1.5 years (many people skip x.x.0 GHC releases), while implemented as separate library van be used immediately ByteString support isn't problem for Streams, although it needs to be implemented. i've done this in 0.2 version, but it is completely bitrotted now and i don't have time to work on it but i propose to at least discuss architecture of future IO libraries - hope that all interested people have enough time and interest at least for doing this -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From bulat.ziganshin at gmail.com Thu Oct 25 07:53:04 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Thu Oct 25 07:53:15 2007 Subject: Brainstorming package compatibility problem In-Reply-To: <472069E1.8060106@gmail.com> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> Message-ID: <448953822.20071025155304@gmail.com> i've forwarded this message from libraries list because i think it's very important topic for Haskell growth. please answer only to libraries@haskell.org This is a forwarded message From: Simon Marlow ===8<==============Original message text=============== Duncan and I have started a wiki page to collect proposals for ways to avoid or alleviate the pain from future package reorganisations. http://hackage.haskell.org/trac/ghc/wiki/PackageCompatibility It's been helpful for me to write all this down, the issues seem much clearer. However, I don't see an obviously best solution. For me proposal 4.2 (see the wiki page) looks the most promising, but it doesn't provide complete backwards compatibility, so I imagine there will be people who disagree. Please read the page. Fix problems, add rationale, add proposals if you have any that are substantially different from those already there. For general discussion just reply to this message (replies directed to libraries@haskell.org). Cheers, Simon _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries ===8<===========End of original message text=========== -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From igloo at earth.li Thu Oct 25 08:01:38 2007 From: igloo at earth.li (Ian Lynagh) Date: Thu Oct 25 07:59:21 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <873avz1o5y.fsf@nmd9999.imr.no> References: <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> Message-ID: <20071025120138.GA14861@matrix.chaos.earth.li> On Thu, Oct 25, 2007 at 12:31:05PM +0200, Ketil Malde wrote: > > Wouldn't keeping "base-2.0" and rebranding "base-3.0" to > "foundation-1.0" (which might be listed as "Solution 2.1") solve this > issue? We don't want to have to invent a new name for base every release. Thanks Ian From simonmarhaskell at gmail.com Thu Oct 25 08:42:41 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Thu Oct 25 08:40:31 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <873avz1o5y.fsf@nmd9999.imr.no> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> Message-ID: <47208F41.3010301@gmail.com> Ketil Malde wrote: > Simon Marlow writes: > >> http://hackage.haskell.org/trac/ghc/wiki/PackageCompatibility > >> It's been helpful for me to write all this down, the issues seem much >> clearer. However, I don't see an obviously best solution. For me >> proposal 4.2 (see the wiki page) looks the most promising, but it >> doesn't provide complete backwards compatibility, so I imagine there >> will be people who disagree. > > The section "The problem of lax version dependencies" refers to > "Solution 3", which doesn't seem to exists. Presumably "Solution 2" is meant? > > Wouldn't keeping "base-2.0" and rebranding "base-3.0" to > "foundation-1.0" (which might be listed as "Solution 2.1") solve this > issue? This is actually what proposal 4.2 is about. But note that in order to keep base-2.0 around you need to either compile up a complete copy of it and all the packages that depend on it (proposal 2, a non-starter IMO), or allow package re-exports (proposal 4). Maintaining an exact replica of the base-2.0 API is impractical (proposal 4.1), so what we'd actually have is base-3.0 (proposal 4.2). Cheers, Simon From ketil+haskell at ii.uib.no Thu Oct 25 09:33:31 2007 From: ketil+haskell at ii.uib.no (Ketil Malde) Date: Thu Oct 25 09:31:07 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <20071025120138.GA14861@matrix.chaos.earth.li> (Ian Lynagh's message of "Thu\, 25 Oct 2007 13\:01\:38 +0100") References: <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <20071025120138.GA14861@matrix.chaos.earth.li> Message-ID: <87wstbz5ck.fsf@nmd9999.imr.no> Ian Lynagh writes: > On Thu, Oct 25, 2007 at 12:31:05PM +0200, Ketil Malde wrote: >> Wouldn't keeping "base-2.0" and rebranding "base-3.0" to >> "foundation-1.0" (which might be listed as "Solution 2.1") solve this >> issue? > We don't want to have to invent a new name for base every release. But you do want to keep reshuffling the contents of base every release? I'm not sure it is stated plainly anywhere, but *I* think one goal of having a system of packages and versions is that it should be possible to compile old code on a new system. As soon as major (i.e. API) version numbers are manadatory for the dependencies in cabal files, bumping the version will be sufficient. The current situation is unfortunately that most libraries just specify 'base' and hope that will just continue to work. -k -- If I haven't seen further, it is by standing in the footprints of giants From ketil+haskell at ii.uib.no Thu Oct 25 09:50:23 2007 From: ketil+haskell at ii.uib.no (Ketil Malde) Date: Thu Oct 25 09:47:59 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <47208F41.3010301@gmail.com> (Simon Marlow's message of "Thu\, 25 Oct 2007 13\:42\:41 +0100") References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <47208F41.3010301@gmail.com> Message-ID: <87sl3zz4kg.fsf@nmd9999.imr.no> Simon Marlow writes: >> Wouldn't keeping "base-2.0" and rebranding "base-3.0" to >> "foundation-1.0" (which might be listed as "Solution 2.1") solve this >> issue? > This is actually what proposal 4.2 is about. Oh, I didn't catch that - I guess I didn't (and don't) see the connectiong to 4 (re-exporting of modules from other packages), nor does 4.2 seem to say anything about naming base differently. Looks like an orthogonal issue to me. Am I missing something? > But note that in order to keep base-2.0 around you need to either > compile up a complete copy of it and all the packages that depend on > it (proposal 2, a non-starter IMO), Perhaps the document could elaborate why it is a non-starter? -k -- If I haven't seen further, it is by standing in the footprints of giants From igloo at earth.li Thu Oct 25 10:01:01 2007 From: igloo at earth.li (Ian Lynagh) Date: Thu Oct 25 09:58:44 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <87wstbz5ck.fsf@nmd9999.imr.no> References: <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <20071025120138.GA14861@matrix.chaos.earth.li> <87wstbz5ck.fsf@nmd9999.imr.no> Message-ID: <20071025140101.GA19214@matrix.chaos.earth.li> On Thu, Oct 25, 2007 at 03:33:31PM +0200, Ketil Malde wrote: > Ian Lynagh writes: > > > On Thu, Oct 25, 2007 at 12:31:05PM +0200, Ketil Malde wrote: > > >> Wouldn't keeping "base-2.0" and rebranding "base-3.0" to > >> "foundation-1.0" (which might be listed as "Solution 2.1") solve this > >> issue? > > > We don't want to have to invent a new name for base every release. > > But you do want to keep reshuffling the contents of base every release? Certainly the next one; I'd be surprised if not the one after. Thanks Ian From apfelmus at quantentunnel.de Thu Oct 25 12:03:22 2007 From: apfelmus at quantentunnel.de (apfelmus) Date: Thu Oct 25 12:00:42 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: Conal Elliott wrote: > i'm missing a piece of reasoning. how about having &&& as primitive as in > your Cartesian proposal, but without the fst/&&& and snd/&&& laws? > you could still introduce those laws in a subclass that does not include Arrow. That would make me feel uncomfortable. At least, I'd drop the name "Cartesian" which intends to allude to "cartesian category". I can't quite put my finger on it, but I think it's the following: since &&& is somewhat abstract, the best way to characterize it is by laws. I mean, it's the same for monads and return . The fact that return has no side-effects is captured in its entirety by the laws return x >>= f = f x m >>= return = m In other words, return is determined uniquely by those two laws. Likewise, the three laws for fst, snd and &&& uniquely determine (up to isomorphism) the notion of "cartesian product" in any category (see also http://en.wikipedia.org/wiki/Product_%28category_theory%29). If those laws don't hold, I think the most compelling characterization of &&& is indeed in terms of the decomposition f &&& g = first f . second g and laws for the new primitives first and second like first f . first g = first (f . g) second f . second g = second (f . g) and others. fst . first f . dup = f snd . second f . dup = f snd . first f . dup = fst . second f . dup ... It's already tricky to list them all, how to express the fact that first and second pass the other value intact while still performing a potential side effect? And what about a minimal (but still complete) amount of laws? Regards, apfelmus From haskell at list.mightyreason.com Thu Oct 25 12:47:35 2007 From: haskell at list.mightyreason.com (haskell@list.mightyreason.com) Date: Thu Oct 25 12:45:23 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: <4720C8A7.8040507@list.mightyreason.com> apfelmus wrote: > Conal Elliott wrote: >> i'm missing a piece of reasoning. how about having &&& as primitive >> as in >> your Cartesian proposal, but without the fst/&&& and snd/&&& laws? >> you could still introduce those laws in a subclass that does not >> include Arrow. > > That would make me feel uncomfortable. At least, I'd drop the name > "Cartesian" which intends to allude to "cartesian category". > > I can't quite put my finger on it, but I think it's the following: since > &&& is somewhat abstract, the best way to characterize it is by laws. I > mean, it's the same for monads and return . The fact that return has > no side-effects is captured in its entirety by the laws > > return x >>= f = f x > m >>= return = m > > In other words, return is determined uniquely by those two laws. > Likewise, the three laws for fst, snd and &&& uniquely determine (up > to isomorphism) the notion of "cartesian product" in any category (see > also http://en.wikipedia.org/wiki/Product_%28category_theory%29). > > If those laws don't hold, I think the most compelling characterization > of &&& is indeed in terms of the decomposition > > f &&& g = first f . second g I think that gets the order of side effects wrong. I think you mean: f &&& g = second g . first f (As one can see from the original class default in CategoryFanOut with CategoryPair) > > and laws for the new primitives first and second like > > first f . first g = first (f . g) > second f . second g = second (f . g) > > and others. > > fst . first f . dup = f > snd . second f . dup = f > snd . first f . dup = fst . second f . dup > ... > > It's already tricky to list them all, how to express the fact that > first and second pass the other value intact while still performing a > potential side effect? And what about a minimal (but still complete) > amount of laws? Well, the type signature of first does not allow much to be done with the snd argument except id. The other tricks are: should dup have no side effects? How to specify? From Malcolm.Wallace at cs.york.ac.uk Thu Oct 25 12:19:00 2007 From: Malcolm.Wallace at cs.york.ac.uk (Malcolm Wallace) Date: Thu Oct 25 12:52:12 2007 Subject: proposal: in base, for Data.Version, change the meaning of comparisons Message-ID: <20071025171900.0a60e05a.Malcolm.Wallace@cs.york.ac.uk> Proposal: that values of the type Data.Version.Version should compare equal, by ignoring trailing zeros. Thus 1.2.0 == 1.2, rather than 1.2.0 > 1.2 Regards, Malcolm ---- New patches: [In Data.Version, make equality comparisons independent of trailing zeros. Malcolm.Wallace@cs.york.ac.uk**20071025161240] { hunk ./Data/Version.hs 122 - v1 == v2 = versionBranch v1 == versionBranch v2 + v1 == v2 = branchEq (versionBranch v1) (versionBranch v2) hunk ./Data/Version.hs 125 + where + branchEq :: [Int] -> [Int] -> Bool + branchEq [] [] = True + branchEq vs [] = all (==0) vs + branchEq [] vs = all (==0) vs + branchEq (v:vs) (w:ws) = v==w && branchEq vs ws hunk ./Data/Version.hs 133 - v1 `compare` v2 = versionBranch v1 `compare` versionBranch v2 - + v1 `compare` v2 = versionBranch v1 `cmpBranch` versionBranch v2 + where + cmpBranch [] [] = EQ + cmpBranch vs [] | all (==0) vs = EQ + | otherwise = GT + cmpBranch [] vs | all (==0) vs = EQ + | otherwise = LT + cmpBranch (v:vs) (w:ws) | v==w = cmpBranch vs ws + | otherwise = compare v w + } Context: [Fix doc building with Haddock 0.9 Simon Marlow **20071024090947 I was using a recent build here, which is more tolerant. ] [FIX #1258: document that openTempFile is secure(ish) Simon Marlow **20071023130928 Also change the mode from 0666 to 0600, which seems like a more sensible value and matches what C's mkstemp() does. ] [Clean up .cabal file a bit Duncan Coutts **20071022132708 specify build-type and cabal-version >= 1.2 put extra-tmp-files in the right place use os(windows) rather than os(mingw32) ] [base in 6.8 and head branch should be version 3.0 Don Stewart **20071007150408] [FIX #1652: openTempFile should accept an empty string for the directory Simon Marlow **20071018122345] [clean up duplicate code Simon Marlow **20071017141311] [expose the value of +RTS -N as GHC.Conc.numCapabilities (see #1733) Simon Marlow **20071009132042] [typo Simon Marlow **20070917130703] [put extra-tmp-files field in the right place Simon Marlow **20070914140812] [Add more entries to boring file Ian Lynagh **20070913210500] [Add a boring file Ian Lynagh **20070913204641] [TAG 2007-09-13 Ian Lynagh **20070913215720] Patch bundle hash: fe636959d9254b8fabd6e7ad6926a4d0b7ee0d15 From twanvl at gmail.com Thu Oct 25 20:21:19 2007 From: twanvl at gmail.com (Twan van Laarhoven) Date: Thu Oct 25 20:18:54 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: <471BA338.9080805@gmail.com> Message-ID: <472132FF.3090005@gmail.com> apfelmus wrote: > Twan van Laarhoven wrote: > >> My proposal would be the following. The important things are that: >> 1. It incorporates Conal's deep arrow, >> 2. as well as everything that is needed for functional >> references/lenses and bijective/invertible functions. > > > I'd opt for more research for that proposal to answer the following > essential questions Indeed. I have started a project/library at http://code.haskell.org/category/ for this purpose. It contains implementations of functional references and invertible functions as test subjects, and the laws are tested using quickcheck. > - Do the classes correspond to already-known categories, i.e. are the > class names optimal? > - What laws do we expect to hold? I have found an example of a law you'd expect to hold, that doesn't. This is: left id == id. For functional references it is not too hard to implement 'left', but it does not satisfy that law, since for the set operation you need two values with the same 'side'. There is no way to get a 'left' value from set (left id) (Left 'a') (Right 'b') = Right 'b' because a might differ from the result type for functions other than id, yet set id (Left 'a') (Right 'b') = Left 'a' > - Are the signatures minimal, i.e. does there exist a smaller set of > combinators that still achieves the intended effect? Are the signatures > complete, i.e. can the intended effect always expressed with the given > combinators? The big culprit here are the structural combinators: mirror, swap, assoc* and most of CategoryFun (and id). All of these can be written using 'arrInv'. So the questiong becomes: Are there arrows that allow structural manipulation of functions, products and sums, that do not support all bijections? Similairly, injection (inl/inr) and selection (fst/snd) can be written using 'arrRef'. So again: Are there arrows that do not contain the functional references, that do allow inl/inr and fst/snd. A likely candidate for both is Conal's DeepArrow. Another thing I don't like about these functions is that they are specific to (,) and Either. This becomes important once you add syntactic sugar. Case expressions can only be desugared when you have 'arrInv'. Perhaps there can be a superclass of InvArrow with the same type signature, but with the additional requirement that it may only be used for structural isomorphisms. > - Plenty and useful examples? At least enough examples that fit in the > fine grained hierarchy but cannot be fit into a coarser grained one so > as to demonstrate the necessity of a fine grained hierarchy. > > These questions likely have nice answers for many of the classes, but > CategoryZero, CategoryPlus CategoryZero and CategoryPlus just give a monoid structure, exactly the same as MonadZero and MonadPlus. They could be put into a single class like the current MonadPlus. The only reason we need these things are needed is because Haskell doesn't allow universaly quantified contexts f :: CategoryPlus cat => ... f :: (Category cat, forall a b. Monoid (cat a b)) => ... > .. CategoryChoice .. As mentioned before, CategoryChoice is the dual to CategoryPair. So it is just as reasonable. > and in particular CategoryFun may be hard nuts. (note: I am brainstorming here) Asside from result, curry, uncurry and funR (aka flip) which can all be expressed with arrInv/arrIso, there are funF and funS which can not. I see no sane way to implement them in anything below ArrowFun. Perhaps these two functions can together form a class class CategoryPair cat => CategoryFunPair cat where funF :: cat (c -> a, b) (c -> (a, b)) funS :: cat (a, c -> b) (c -> (a, b)) funS = result swap . funF . swap And dually class CategoryChoice cat => CategoryFunChoice cat where funL :: cat (Either (c -> a) b) (c -> (Either a b)) funR :: cat (Either a (c -> b)) (c -> (Either a b)) I expect the problem with these classes comes from the fact that they use *two* categories, cat and (->), and a monad. Generalizing to other monads gives for instance funLst :: cat [c -> a] (c -> [a]) Alternatively, it's one category and two monads / applicative functors. Then we get: sequence :: cat (f (g a)) (g (f a)) Now the question becomes: does sequencing in a category cat ever differ from sequencing in (->)? Clearly it can be a subset, but is there anything other than the cases: - f and g commute (f . g = g . f), sequence can be done in IsoArrow - g only sequences through f, we may need a new class for this; otherwise Arrow will do. For some cases RefArrow might be enough. - f and g don't commute, nothing happens. Again I look at Conal for a likely source of examples. Look at Data.Traversable.sequence for this function in (->). > Also, the proposed subclass chain InvArrow => RefArrow => FunArrow may > be cumbersome in practice since it would mean to define three functions > instead of just arr when declaring an Arrow. There are examples of all three, and I think it is important to ensure that the instances of the superclasses are available for the subclasses. Otherwise changing a function from, say, FunArrow to RefArrow does not make it more general. Twan From simonmarhaskell at gmail.com Fri Oct 26 04:18:09 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Fri Oct 26 04:15:52 2007 Subject: proposal: in base, for Data.Version, change the meaning of comparisons In-Reply-To: <20071025171900.0a60e05a.Malcolm.Wallace@cs.york.ac.uk> References: <20071025171900.0a60e05a.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <4721A2C1.6050702@gmail.com> Malcolm Wallace wrote: > Proposal: that values of the type Data.Version.Version should compare > equal, by ignoring trailing zeros. > Thus 1.2.0 == 1.2, rather than 1.2.0 > 1.2 I see advantages and disadvantages. Advantages: * matches intuitive understanding of versions * lets us drop trailing zeroes in version numbers Disadvantages: * version ordering is slightly harder to explain Is there a precedent anywhere else for doing this? > [In Data.Version, make equality comparisons independent of trailing zeros. > Malcolm.Wallace@cs.york.ac.uk**20071025161240] { > hunk ./Data/Version.hs 122 > - v1 == v2 = versionBranch v1 == versionBranch v2 > + v1 == v2 = branchEq (versionBranch v1) (versionBranch v2) > hunk ./Data/Version.hs 125 > + where > + branchEq :: [Int] -> [Int] -> Bool > + branchEq [] [] = True > + branchEq vs [] = all (==0) vs > + branchEq [] vs = all (==0) vs > + branchEq (v:vs) (w:ws) = v==w && branchEq vs ws > hunk ./Data/Version.hs 133 > - v1 `compare` v2 = versionBranch v1 `compare` versionBranch v2 > - > + v1 `compare` v2 = versionBranch v1 `cmpBranch` versionBranch v2 > + where > + cmpBranch [] [] = EQ > + cmpBranch vs [] | all (==0) vs = EQ > + | otherwise = GT > + cmpBranch [] vs | all (==0) vs = EQ > + | otherwise = LT > + cmpBranch (v:vs) (w:ws) | v==w = cmpBranch vs ws > + | otherwise = compare v w > + > } Wouldn't the implementation be simpler if you added a dropTrailingZeros function, and just applied it before comparing? That would more obviously match the informal description too. Cheers, Simon From simonmarhaskell at gmail.com Fri Oct 26 05:53:26 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Fri Oct 26 05:51:11 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <87sl3zz4kg.fsf@nmd9999.imr.no> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <47208F41.3010301@gmail.com> <87sl3zz4kg.fsf@nmd9999.imr.no> Message-ID: <4721B916.9020609@gmail.com> Ketil Malde wrote: > Simon Marlow writes: > >>> Wouldn't keeping "base-2.0" and rebranding "base-3.0" to >>> "foundation-1.0" (which might be listed as "Solution 2.1") solve this >>> issue? > >> This is actually what proposal 4.2 is about. > > Oh, I didn't catch that - I guess I didn't (and don't) see the > connectiong to 4 (re-exporting of modules from other packages), nor > does 4.2 seem to say anything about naming base differently. > > Looks like an orthogonal issue to me. Am I missing something? Probably it could be made clearer. In 4.2 the idea is that instead of replacing base-2.0 ==> base-3.0 + directory-1.0 + array-1.0 + ... you would replace base-2.0 ==> newbase-1.0 + directory-1.0 + array-1.0 + ... and additionally have a package base-3.0 that re-exports the whole of (newbase + directory + array + ...). An alternative to this last step, and I think what you had in mind, is to provide the original base-2.0; this is what proposal (2) talks about. >> But note that in order to keep base-2.0 around you need to either >> compile up a complete copy of it and all the packages that depend on >> it (proposal 2, a non-starter IMO), > > Perhaps the document could elaborate why it is a non-starter? This is the "functional" solution: keep old versions of everything and GC them later. It's feasible for Nix to do this, indeed it requires a system like Nix to even make this work, because most OS packaging systems have no notion of the difference between "process-2.0 compiled against base-2.0" as distinct from "process-2.0 compiled against base-3.0", and neither does GHC's packaging system or Cabal. Also, this doesn't solve all the problems - if you need to use two packages, one of which only compiles against base-2.0 and the other only compiles against base-3.0, then in order to use them both in a program you almost certainly still have to modify one of them. The reason being that the types provided by base-2.0 (e.g. Bool) would be incompatible with those provided by base-3.0. Thinking about this is really making my head hurt, I need to go back to doing something easy like writing Haskell :-) Cheers, Simon From Malcolm.Wallace at cs.york.ac.uk Fri Oct 26 06:46:34 2007 From: Malcolm.Wallace at cs.york.ac.uk (Malcolm Wallace) Date: Fri Oct 26 06:50:38 2007 Subject: proposal: in base, for Data.Version, change the meaning of comparisons In-Reply-To: <4721A2C1.6050702@gmail.com> References: <20071025171900.0a60e05a.Malcolm.Wallace@cs.york.ac.uk> <4721A2C1.6050702@gmail.com> Message-ID: <20071026114634.4e373004.Malcolm.Wallace@cs.york.ac.uk> > > Proposal: that values of the type Data.Version.Version should > > compare equal, by ignoring trailing zeros. > > Thus 1.2.0 == 1.2, rather than 1.2.0 > 1.2 Simon Marlow wrote: > I see advantages and disadvantages. > Advantages: > * matches intuitive understanding of versions > * lets us drop trailing zeroes in version numbers > Disadvantages: > * version ordering is slightly harder to explain Pretty much, yes. Although arguably the disadvantage is not so bad, since currently one has to explain why 1.2.0 is _not_ the same as 1.2. > Is there a precedent anywhere else for doing this? I could point to ordinary decimal notation, where 1.2000 == 1.2. http://en.wikipedia.org/wiki/Trailing_zero Perl has a related notion of implicit zero-extension in the "version" pod: http://search.cpan.org/~jpeacock/version-0.74/lib/version.pod Microsoft's .NET Framework seems to ignore trailing zeros in versions: http://www.cyscape.com/products/bhawk/docs/BrowserHawk/CompareVersions_Method_NET_.htm http://msdn2.microsoft.com/en-us/library/d5cd9b2c.aspx wxWidgets release numbers sometimes omit trailing zeros: http://www.wxwidgets.org/manuals/stable/wx_backwardcompatibility.html I found proposals to ignore trailing zeros in version comparisons within OpenOffice, Python distutils, and Drupal: http://extensions.openoffice.org/servlets/ReadMsg?list=dev&msgNo=212 http://mail.python.org/pipermail/distutils-sig/2007-September/008324.html http://vbdrupal.org/forum/showthread.php?p=591 > Wouldn't the implementation be simpler if you added a > dropTrailingZeros function, and just applied it before comparing? Yes, that is another possible implementation. It involves traversing both version structures twice rather than once (but I don't suppose the slight efficiency loss would ever be noticable). Regards, Malcolm From isaacdupree at charter.net Fri Oct 26 10:29:36 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Fri Oct 26 10:30:32 2007 Subject: proposal: in base, for Data.Version, change the meaning of comparisons In-Reply-To: <20071026114634.4e373004.Malcolm.Wallace@cs.york.ac.uk> References: <20071025171900.0a60e05a.Malcolm.Wallace@cs.york.ac.uk> <4721A2C1.6050702@gmail.com> <20071026114634.4e373004.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <4721F9D0.7070108@charter.net> Malcolm Wallace wrote: >>> Proposal: that values of the type Data.Version.Version should >>> compare equal, by ignoring trailing zeros. >>> Thus 1.2.0 == 1.2, rather than 1.2.0 > 1.2 > > Simon Marlow wrote: > >> I see advantages and disadvantages. >> Advantages: >> * matches intuitive understanding of versions >> * lets us drop trailing zeroes in version numbers maybe, but the trailing zeroes have some effect so far... >> Disadvantages: >> * version ordering is slightly harder to explain > > Pretty much, yes. Although arguably the disadvantage is not so bad, > since currently one has to explain why 1.2.0 is _not_ the same as 1.2. * it means (==) is not extensional equality for Versions (e.g. (vA == vB && not (show vA == show vB))... then again, this is already true if versionTags is used for anything. (show version), and especially the appending-the-date, depend on how many trailing zeroes are in a particular version so it is likely to be ill-defined, if versions are used as Map keys, which one is stored as the key... not too bad, but people tend to think of (==) as extensional equality most of the time, I think > >> Is there a precedent anywhere else for doing this? okay, the precedent you demonstrated seems like an advantage if we do this, we should find a way not to depend on the number of trailing zeroes for anything? note that, version-wise, unless we imagine (rightly enough) that negative version numbers are forbidden, this would make Version not even obey the Ord laws; currently Prelude Data.Version> Version [1] [] < Version [1,-1] [] True Prelude Data.Version> Version [1,-1] [] < Version [1,0] [] True Prelude Data.Version> Version [1] [] < Version [1,0] [] True #by transitivity; but the proposal would defeat that Actually not if [1,-1] < [1], which would be plausible to be part of the implicit trailing zeroes concept Isaac From claus.reinke at talk21.com Fri Oct 26 20:14:18 2007 From: claus.reinke at talk21.com (Claus Reinke) Date: Fri Oct 26 20:12:18 2007 Subject: [Haskell] Re: Trying to install binary-0.4 References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost><20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> Message-ID: > Duncan and I have started a wiki page to collect proposals for ways to avoid or alleviate the pain > from future package reorganisations. > > http://hackage.haskell.org/trac/ghc/wiki/PackageCompatibility i've filled in the section on provides/requires with what i remember from our discussion. claus From igloo at earth.li Fri Oct 26 20:59:59 2007 From: igloo at earth.li (Ian Lynagh) Date: Fri Oct 26 20:57:37 2007 Subject: proposal: in base, for Data.Version, change the meaning of comparisons In-Reply-To: <20071026114634.4e373004.Malcolm.Wallace@cs.york.ac.uk> References: <20071025171900.0a60e05a.Malcolm.Wallace@cs.york.ac.uk> <4721A2C1.6050702@gmail.com> <20071026114634.4e373004.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <20071027005958.GA15530@matrix.chaos.earth.li> On Fri, Oct 26, 2007 at 11:46:34AM +0100, Malcolm Wallace wrote: > > Simon Marlow wrote: > > > Is there a precedent anywhere else for doing this? > > I could point to ordinary decimal notation, where 1.2000 == 1.2. > http://en.wikipedia.org/wiki/Trailing_zero Well, I don't think anyone is arguing that Cabal should think that 1.2000 == 1.2. > Perl has a related notion of implicit zero-extension in the "version" pod: > http://search.cpan.org/~jpeacock/version-0.74/lib/version.pod I haven't read the documentation properly to know exactly what the logic is behind this definition of versions (is it trying to DTRT for historical perl version numbers?), but it looks pretty scary: $ perl -Mversion -de 1 [...] DB<1> p version->new(0.2) > version->new(0.1) 1 DB<2> p version->new(0.2.0) > version->new(0.1) DB<3> p version->new(0.2)->normal v0.200.0 DB<4> p version->new(0.2.0)->normal v0.2.0 DB<5> > [...] I don't think software release numbers are very compelling examples, unless they release both x and x.0 (in which case they presumably are not going to be considered equal). For what it's worth, dpkg thinks x.0 > x: $ dpkg --compare-versions 1.0 gt 1 && echo yes yes I believe rpm does too, although I can't find an easy way to ask it or a reliable description of what the algorithm does. I also can't immediately find any details on what Gentoo, *BSD, etc think. Personally I don't have strong feelings either way, although I lean slightly towards the current definition. I'd like x.0 to be the same as x, but Cabal's snapshot version feature (append .$date to the version number) can tell them apart. Also, I believe the code is simpler for the current definition. Thanks Ian From apa3a at yahoo.com Fri Oct 26 23:26:04 2007 From: apa3a at yahoo.com (Andriy Palamarchuk) Date: Fri Oct 26 23:23:41 2007 Subject: Data.Map, Data.IntMap documentation (1611) In-Reply-To: Message-ID: <216132.29104.qm@web56414.mail.re3.yahoo.com> Thanks everybody for the corrections and suggestions. Finally I got back to this work. Sorry it took this long to respond. Log comment: Improved, fixed documentation for Data.Map, Data.IntMap. Added examples. Changes since the first submission: * Moved time complexity Big-O values back to the beginning of function descriptions. * Converted examples from interpreter session-like format to more compact equation-like format. * As per http://www.haskell.org/pipermail/libraries/2007-March/007304.html added following information to the description of updateLookupWithKey: The function returns changed value, if it is updated. Returns the original key value if the map entry is deleted. Ticket: http://hackage.haskell.org/trac/ghc/ticket/1611 Haddock output: http://hackage.haskell.org/trac/ghc/attachment/ticket/1611/Data-Map.html?format=raw Comments, suggestions, critique? Did I miss anything? I'll update IntMap for the final review. Andriy __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From conal at conal.net Sat Oct 27 02:13:03 2007 From: conal at conal.net (Conal Elliott) Date: Sat Oct 27 02:10:39 2007 Subject: QuickCheck support in libraries Message-ID: I'd like libraries to provide QuickCheck support (instances of Arbitrary) for types they define, where possible. Are there any reasons not to routinely do so? Otherwise, I end up working them out for myself and probably replicating other people's work. - Conal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071026/98ce698e/attachment.htm From johan.tibell at gmail.com Sat Oct 27 04:57:43 2007 From: johan.tibell at gmail.com (Johan Tibell) Date: Sat Oct 27 04:55:19 2007 Subject: Data.Map, Data.IntMap documentation (1611) In-Reply-To: <216132.29104.qm@web56414.mail.re3.yahoo.com> References: <216132.29104.qm@web56414.mail.re3.yahoo.com> Message-ID: <90889fe70710270157y10e61050xb59f1cda02a8f13f@mail.gmail.com> On 10/27/07, Andriy Palamarchuk wrote: > Thanks everybody for the corrections and suggestions. > Finally I got back to this work. > Sorry it took this long to respond. Thanks for doing this! More documentation make me happy. -- Johan From duncan.coutts at worc.ox.ac.uk Sat Oct 27 07:15:19 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sat Oct 27 07:10:01 2007 Subject: QuickCheck support in libraries In-Reply-To: References: Message-ID: <1193483720.16641.458.camel@localhost> On Fri, 2007-10-26 at 23:13 -0700, Conal Elliott wrote: > I'd like libraries to provide QuickCheck support (instances of > Arbitrary) for types they define, where possible. Are there any > reasons not to routinely do so? Otherwise, I end up working them out > for myself and probably replicating other people's work. People sometimes worry about making their packages depend on the QuickCheck package. For example QuickCheck is not required to build ghc, but if we included the Arbitrary instances for ByteString in the bytestring package then ghc would depend on QuickCheck. Perhaps one solution is to use configurations, so people can build a package with or without the QuickCheck dependency. Duncan From duncan.coutts at worc.ox.ac.uk Sat Oct 27 07:30:14 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sat Oct 27 07:24:52 2007 Subject: proposal: in base, for Data.Version, change the meaning of comparisons In-Reply-To: <20071027005958.GA15530@matrix.chaos.earth.li> References: <20071025171900.0a60e05a.Malcolm.Wallace@cs.york.ac.uk> <4721A2C1.6050702@gmail.com> <20071026114634.4e373004.Malcolm.Wallace@cs.york.ac.uk> <20071027005958.GA15530@matrix.chaos.earth.li> Message-ID: <1193484614.16641.463.camel@localhost> On Sat, 2007-10-27 at 01:59 +0100, Ian Lynagh wrote: > I believe rpm does too, although I can't find an easy way to ask it or a > reliable description of what the algorithm does. I also can't > immediately find any details on what Gentoo, *BSD, etc think. Most details on gentoo package versions are explained here: http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=3&chap=1#doc_chap3 It doesn't say if trailing .0 version components are significant but from a quick experiment with dummy packages foo-0.1 and foo-0.1.0 Gentoo does consider 0.1.0 > 0.1. That is, it considers version 0.1.0 to be an upgrade on 0.1 where as 0.1 is a re-install. Duncan From duncan.coutts at worc.ox.ac.uk Sat Oct 27 08:07:44 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sat Oct 27 08:02:23 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost><20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> Message-ID: <1193486864.16641.469.camel@localhost> On Sat, 2007-10-27 at 01:14 +0100, Claus Reinke wrote: > > Duncan and I have started a wiki page to collect proposals for ways to avoid or alleviate the pain > > from future package reorganisations. > > > > http://hackage.haskell.org/trac/ghc/wiki/PackageCompatibility > > i've filled in the section on provides/requires with > what i remember from our discussion. Thanks. I quite like the idea of inferring in much more detail what a package actually needs from its imports. Having Cabal do the module dependency analysis will make this a bit easier, but doing it at a finer granularity than the module list will require more complicated language processing. I suppose there is the question of how much should be in the language (like ML functors) and how much in the packaging system. Duncan From igloo at earth.li Sat Oct 27 08:08:32 2007 From: igloo at earth.li (Ian Lynagh) Date: Sat Oct 27 08:06:10 2007 Subject: QuickCheck support in libraries In-Reply-To: <1193483720.16641.458.camel@localhost> References: <1193483720.16641.458.camel@localhost> Message-ID: <20071027120832.GA21163@matrix.chaos.earth.li> On Sat, Oct 27, 2007 at 11:15:19AM +0000, Duncan Coutts wrote: > > For example QuickCheck is not required to build ghc, but if we included > the Arbitrary instances for ByteString in the bytestring package then > ghc would depend on QuickCheck. > > Perhaps one solution is to use configurations, so people can build a > package with or without the QuickCheck dependency. What would a dependency on bytestring 0.9 mean then? How would I indicate that I need the Arbitrary instance? Someone could make a ghc-bootlib-arbitrary package, containing all the Arbitrary instances for types in the bootlibs. Thanks Ian From duncan.coutts at worc.ox.ac.uk Sat Oct 27 08:43:44 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Sat Oct 27 08:38:23 2007 Subject: QuickCheck support in libraries In-Reply-To: <20071027120832.GA21163@matrix.chaos.earth.li> References: <1193483720.16641.458.camel@localhost> <20071027120832.GA21163@matrix.chaos.earth.li> Message-ID: <1193489024.16641.474.camel@localhost> On Sat, 2007-10-27 at 13:08 +0100, Ian Lynagh wrote: > On Sat, Oct 27, 2007 at 11:15:19AM +0000, Duncan Coutts wrote: > > > > For example QuickCheck is not required to build ghc, but if we included > > the Arbitrary instances for ByteString in the bytestring package then > > ghc would depend on QuickCheck. > > > > Perhaps one solution is to use configurations, so people can build a > > package with or without the QuickCheck dependency. > > What would a dependency on bytestring 0.9 mean then? How would I > indicate that I need the Arbitrary instance? You're right, you couldn't. > Someone could make a ghc-bootlib-arbitrary package, containing all the > Arbitrary instances for types in the bootlibs. Yes, or the QuikCheck package might be a good place for most of those :-) The same problem goes for all libs, people are reluctant to add dependencies on QC and HUnit packages just for their tests. Perhaps the solution is that people should just not worry about adding such dependencies. Duncan From bulat.ziganshin at gmail.com Sat Oct 27 09:39:05 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Sat Oct 27 09:37:53 2007 Subject: QuickCheck support in libraries In-Reply-To: <1193489024.16641.474.camel@localhost> References: <1193483720.16641.458.camel@localhost> <20071027120832.GA21163@matrix.chaos.earth.li> <1193489024.16641.474.camel@localhost> Message-ID: <1892132500.20071027173905@gmail.com> Hello Duncan, Saturday, October 27, 2007, 4:43:44 PM, you wrote: > The same problem goes for all libs, people are reluctant to add > dependencies on QC and HUnit packages just for their tests. Perhaps the > solution is that people should just not worry about adding such > dependencies. these libs looks like a very candidates to include in standard set -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From sebastian.sylvan at gmail.com Sat Oct 27 10:44:37 2007 From: sebastian.sylvan at gmail.com (Sebastian Sylvan) Date: Sat Oct 27 10:42:14 2007 Subject: QuickCheck support in libraries In-Reply-To: <1193489024.16641.474.camel@localhost> References: <1193483720.16641.458.camel@localhost> <20071027120832.GA21163@matrix.chaos.earth.li> <1193489024.16641.474.camel@localhost> Message-ID: <3d96ac180710270744x6f275956r7aa0f992b72325ac@mail.gmail.com> On 27/10/2007, Duncan Coutts wrote: > Perhaps the > solution is that people should just not worry about adding such > dependencies. I agree with this! -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862 From conal at conal.net Sat Oct 27 11:42:48 2007 From: conal at conal.net (Conal Elliott) Date: Sat Oct 27 11:40:25 2007 Subject: QuickCheck support in libraries In-Reply-To: <1193489024.16641.474.camel@localhost> References: <1193483720.16641.458.camel@localhost> <20071027120832.GA21163@matrix.chaos.earth.li> <1193489024.16641.474.camel@localhost> Message-ID: That's my leaning as well -- just make the dependency. Alternatively, a library like foo could be accompanied by a library foo-QC. On 10/27/07, Duncan Coutts wrote: > > [...] > The same problem goes for all libs, people are reluctant to add > dependencies on QC and HUnit packages just for their tests. Perhaps the > solution is that people should just not worry about adding such > dependencies. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/libraries/attachments/20071027/7222a1f4/attachment.htm From isaacdupree at charter.net Sun Oct 28 13:49:12 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Sun Oct 28 13:50:22 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4721B916.9020609@gmail.com> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <47208F41.3010301@gmail.com> <87sl3zz4kg.fsf@nmd9999.imr.no> <4721B916.9020609@gmail.com> Message-ID: <4724CB98.5090700@charter.net> Simon Marlow wrote: > Probably it could be made clearer. In 4.2 the idea is that instead of > replacing > > base-2.0 ==> base-3.0 + directory-1.0 + array-1.0 + ... > > you would replace > > base-2.0 ==> newbase-1.0 + directory-1.0 + array-1.0 + ... > > and additionally have a package base-3.0 that re-exports the whole of > (newbase + directory + array + ...). "Macros" in cabal: Why not just say that depending on base-3.0 actually means that you have to depend on newbase-1.0, and directory-1.0, etc... Why is compiler support needed? is it really possible that I still don't understand? Isaac From nominolo at googlemail.com Sun Oct 28 14:08:30 2007 From: nominolo at googlemail.com (Thomas Schilling) Date: Sun Oct 28 14:06:39 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4724CB98.5090700@charter.net> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <47208F41.3010301@gmail.com> <87sl3zz4kg.fsf@nmd9999.imr.no> <4721B916.9020609@gmail.com> <4724CB98.5090700@charter.net> Message-ID: <1193594910.20004.14.camel@intothevoid> On Sun, 2007-10-28 at 13:49 -0400, Isaac Dupree wrote: > Simon Marlow wrote: > > Probably it could be made clearer. In 4.2 the idea is that instead of > > replacing > > > > base-2.0 ==> base-3.0 + directory-1.0 + array-1.0 + ... > > > > you would replace > > > > base-2.0 ==> newbase-1.0 + directory-1.0 + array-1.0 + ... > > > > and additionally have a package base-3.0 that re-exports the whole of > > (newbase + directory + array + ...). > > "Macros" in cabal: Why not just say that depending on base-3.0 actually > means that you have to depend on newbase-1.0, and directory-1.0, etc... > Why is compiler support needed? is it really possible that I still > don't understand? You'd still have the problem that every package has to specify this "macro" for itself. You'd want some global macro-database to avoid this. The better solution would be to just have a package that re-exports everything. I.e., the definition of package base-2.0 would look something like this: if has system has base-3.0, directory, array ... re-export else exposed-modules: Data.Maybe, Data.List, ... From isaacdupree at charter.net Sun Oct 28 14:25:26 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Sun Oct 28 14:26:35 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <1193594910.20004.14.camel@intothevoid> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <47208F41.3010301@gmail.com> <87sl3zz4kg.fsf@nmd9999.imr.no> <4721B916.9020609@gmail.com> <4724CB98.5090700@charter.net> <1193594910.20004.14.camel@intothevoid> Message-ID: <4724D416.2020209@charter.net> Thomas Schilling wrote: > On Sun, 2007-10-28 at 13:49 -0400, Isaac Dupree wrote: >> Simon Marlow wrote: >>> Probably it could be made clearer. In 4.2 the idea is that instead of >>> replacing >>> >>> base-2.0 ==> base-3.0 + directory-1.0 + array-1.0 + ... >>> >>> you would replace >>> >>> base-2.0 ==> newbase-1.0 + directory-1.0 + array-1.0 + ... >>> >>> and additionally have a package base-3.0 that re-exports the whole of >>> (newbase + directory + array + ...). >> "Macros" in cabal: Why not just say that depending on base-3.0 actually >> means that you have to depend on newbase-1.0, and directory-1.0, etc... >> Why is compiler support needed? is it really possible that I still >> don't understand? > > You'd still have the problem that every package has to specify this > "macro" for itself. You'd want some global macro-database to avoid > this. The better solution would be to just have a package that > re-exports everything. I.e., the definition of package base-2.0 would > look something like this: > > if has system has base-3.0, directory, array ... > re-export > else > exposed-modules: Data.Maybe, Data.List, ... Of course it would be defined in the same place that base-3.0 would normally be defined if it existed (hypothetically supposing base was renamed to newbase in this case). Instead of Haskell code, a cabal file that just says, in order to depend on this "package", you (meaning the cabal mechanism, not the users) need to depend on this set of packages instead - which is repeatedly expanded until only ghc-packages (or the equivalent for whatever compiler it is) are in the list. Isaac From ketil+haskell at ii.uib.no Sun Oct 28 17:42:25 2007 From: ketil+haskell at ii.uib.no (Ketil Malde) Date: Sun Oct 28 17:39:39 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4721B916.9020609@gmail.com> (Simon Marlow's message of "Fri\, 26 Oct 2007 10\:53\:26 +0100") References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <47208F41.3010301@gmail.com> <87sl3zz4kg.fsf@nmd9999.imr.no> <4721B916.9020609@gmail.com> Message-ID: <87640qx6f2.fsf@nmd9999.imr.no> Simon Marlow writes: >> Looks like an orthogonal issue to me. Am I missing something? > Probably it could be made clearer. In 4.2 the idea is that instead of > replacing > > base-2.0 ==> base-3.0 + directory-1.0 + array-1.0 + ... > > you would replace > > base-2.0 ==> newbase-1.0 + directory-1.0 + array-1.0 + ... That's pretty clear, thanks. Couldn't you still do this by recompiling the libraries, *if* the re-exporting feature turns out to be stumbling block. > Thinking about this is really making my head hurt, I need to go back > to doing something easy like writing Haskell :-) If it leads to better/more robust libraries, I'm happy to pick up the bill for that bottle of aspirin. :-) -k -- If I haven't seen further, it is by standing in the footprints of giants From wnoise at ofb.net Sun Oct 28 19:26:32 2007 From: wnoise at ofb.net (Aaron Denney) Date: Sun Oct 28 19:24:16 2007 Subject: proposal: in base, for Data.Version, change the meaning of comparisons References: <20071025171900.0a60e05a.Malcolm.Wallace@cs.york.ac.uk> <4721A2C1.6050702@gmail.com> <20071026114634.4e373004.Malcolm.Wallace@cs.york.ac.uk> <4721F9D0.7070108@charter.net> Message-ID: On 2007-10-26, Isaac Dupree wrote: > Actually not if [1,-1] < [1], which would be plausible to be part of the > implicit trailing zeroes concept This should clearly be true, if we want to argue from positional number systems. -- Aaron Denney -><- From ashley at semantic.org Sun Oct 28 22:34:07 2007 From: ashley at semantic.org (Ashley Yakeley) Date: Sun Oct 28 22:31:56 2007 Subject: Proposal: Add Compositor class as superclass of Arrow In-Reply-To: References: Message-ID: I wrote: > http://hackage.haskell.org/trac/ghc/ticket/1773 > (darcs patch attached to ticket) ... > Proposal period: two weeks, until 10-27 Consensus was to add this under the name Category: class Category cat where id :: cat a a (.) :: cat b c -> cat a b -> cat a c id and (.) would not replace those in the Prelude. Category would become a superclass of the existing Arrow class. Updated code, pushed patches to base, closed ticket "fixed". Thanks everyone! -- Ashley Yakeley From simonmarhaskell at gmail.com Mon Oct 29 06:52:09 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Mon Oct 29 06:49:43 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <1193594910.20004.14.camel@intothevoid> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <47208F41.3010301@gmail.com> <87sl3zz4kg.fsf@nmd9999.imr.no> <4721B916.9020609@gmail.com> <4724CB98.5090700@charter.net> <1193594910.20004.14.camel@intothevoid> Message-ID: <4725BB59.7010604@gmail.com> Thomas Schilling wrote: > On Sun, 2007-10-28 at 13:49 -0400, Isaac Dupree wrote: >> Simon Marlow wrote: >>> Probably it could be made clearer. In 4.2 the idea is that instead of >>> replacing >>> >>> base-2.0 ==> base-3.0 + directory-1.0 + array-1.0 + ... >>> >>> you would replace >>> >>> base-2.0 ==> newbase-1.0 + directory-1.0 + array-1.0 + ... >>> >>> and additionally have a package base-3.0 that re-exports the whole of >>> (newbase + directory + array + ...). >> "Macros" in cabal: Why not just say that depending on base-3.0 actually >> means that you have to depend on newbase-1.0, and directory-1.0, etc... >> Why is compiler support needed? is it really possible that I still >> don't understand? > > You'd still have the problem that every package has to specify this > "macro" for itself. You'd want some global macro-database to avoid > this. The better solution would be to just have a package that > re-exports everything. I.e., the definition of package base-2.0 would > look something like this: > > if has system has base-3.0, directory, array ... > re-export > else > exposed-modules: Data.Maybe, Data.List, ... And this runs into trouble when base-3.0 has changes to datatypes and/or classes relative to base-2.0 (see 4.1 of http://hackage.haskell.org/trac/ghc/wiki/PackageCompatibility). This approach doesn't scale; it may be useful for providing backwards-compatible versions of smaller packages, but impractical for base. Cheers, Simon From simonmarhaskell at gmail.com Mon Oct 29 07:24:53 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Mon Oct 29 07:22:27 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4721B916.9020609@gmail.com> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <47208F41.3010301@gmail.com> <87sl3zz4kg.fsf@nmd9999.imr.no> <4721B916.9020609@gmail.com> Message-ID: <4725C305.8080601@gmail.com> Simon Marlow wrote: > Probably it could be made clearer. In 4.2 the idea is that instead of > replacing > > base-2.0 ==> base-3.0 + directory-1.0 + array-1.0 + ... > > you would replace > > base-2.0 ==> newbase-1.0 + directory-1.0 + array-1.0 + ... > > and additionally have a package base-3.0 that re-exports the whole of > (newbase + directory + array + ...). There's another alternative, that Simon PJ pointed out to me this morning. Actually I think this is rather nice, as it solves the problem of having to rename base for each split. Let's suppose that in GHC 6.10 we want to split some modules from base again (highly likely). So we make this change, for example: base-3.0 ===> base-4.0 + concurrent-1.0 + generics-1.0 note that the new, smaller, base is called base-4.0. Then, we provide a wrapper package base-3.1, that re-exports (base-4.0 + concurrent-1.0 + generics-1.0). Why is it called 3.1, not 3.0? Because almost certainly by the time GHC 6.10 is released there will be some API changes in these packages too, and we aren't trying to reproduce the base-3.0 API exactly (that's proposal 4.1). This amounts to adopting a convention for the base package that changes in the first component of the version indicate splits or removal of modules, and changes to the second component indicate other API changes only. The idea is that all packages on Hackage will be using precise dependencies by this point, so they will all have something like build-depends: base-3.0.* Now, when GHC 6.10 is released, the majority of these packages will build again if the .cabal file is changed to say build-depends: base >= 3.0 && <= 3.1 rather than introducing conditional dependencies as was necessary with the recent base split. In due course, packages can be upgraded to depend on the new base-4.0. I'll call this proposal 4.3 and add it to the wiki. It seems like a pretty good compromise to me. Cheers, Simon From isaacdupree at charter.net Mon Oct 29 09:30:30 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Mon Oct 29 09:31:47 2007 Subject: [Haskell] Re: Trying to install binary-0.4 In-Reply-To: <4725C305.8080601@gmail.com> References: <470CCAED.4010702@cogito.org.uk> <20071010142229.GA30114@scytale.galois.com> <20071011232711.GB2972@web.de> <20071014140922.GA25871@matrix.chaos.earth.li> <20071014151930.GB4256@web.de> <20071014164840.GA19265@matrix.chaos.earth.li> <20071015175520.GG2323@scytale.galois.com> <20071018230033.GA20830@web.de> <1192752781.8926.62.camel@localhost> <20071021125508.GA30931@web.de> <472069E1.8060106@gmail.com> <873avz1o5y.fsf@nmd9999.imr.no> <47208F41.3010301@gmail.com> <87sl3zz4kg.fsf@nmd9999.imr.no> <4721B916.9020609@gmail.com> <4725C305.8080601@gmail.com> Message-ID: <4725E076.6070607@charter.net> Simon Marlow wrote: > Now, when GHC 6.10 is released, the majority of these packages will > build again if the .cabal file is changed to say > > build-depends: base >= 3.0 && <= 3.1 > > rather than introducing conditional dependencies as was necessary with > the recent base split. In due course, packages can be upgraded to > depend on the new base-4.0. > > I'll call this proposal 4.3 and add it to the wiki. It seems like a > pretty good compromise to me. yay, a good naming proposal! This explains what I meant by the thing with macros - of course it cannot provide base-2.0, but it provides something close to that base API, such as you would expect from a version number increase. what if the ghc 6.8 branch's base has to change enough that it needs to be incremented to 3.1 by PVP? Or maybe that should never happen. but, oh, the .cabal file should be changed _after_ the release of 6.10 (so that it will be accurate) (otherwise it might be >= 3.0 && < 4) so we'll know what the version numbers are (as long as we never do a point release of a previous GHC branch, once "3.1" has been taken by 6.10's base) It could be "3.5"... but then that theoretical 3.1 would be considered a valid dependency even if it contained different API changes that broke things... so, okay Isaac From dons at galois.com Tue Oct 30 18:23:00 2007 From: dons at galois.com (Don Stewart) Date: Tue Oct 30 18:20:27 2007 Subject: X11-extras merged into X11 library Message-ID: <20071030222300.GT1101@scytale.galois.com> This is a heads up about the X11 library. For the past 6 months a set of extensions, required by xmonad, to this library have been developed in the so-called X11-extras package. The time came to merge these together, finally. A new head branch of X11 has been created, which lives at: darcs.haskell.org/X11 with the merged source (adding support for xinerama, window manger stuff, X events, X fonts and more). This has also been tagged as X11 1.3.0 (following the versioning spec), and uploaded to hackage. Any stable branch ghc wishes to use for its extras bundle can still be found at darcs.haskell.org/packages/X11. -- Don From nominolo at googlemail.com Wed Oct 31 09:29:56 2007 From: nominolo at googlemail.com (Thomas Schilling) Date: Wed Oct 31 09:27:58 2007 Subject: PROPOSAL: Add Data.Set.mapMaybe Message-ID: <1193837396.5865.11.camel@intothevoid> Hi there. I recently find myself missing Data.Set.mapMaybe. This function is implemented for Data.Map.Map, but is strangely missing from Data.Set.mapMaybe. I believe it could be implemented using Data.Foldable, but not as efficiently. The obvious implementation would be: mapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set b mapMaybe f Tip = Tip mapMaybe f (Bin _ x l r) = case f x of Nothing -> merge (mapMaybe f l) (mapMaybe f r) Just y -> union y (mapMaybe f l) (mapMaybe f r) Any comments? Preliminary deadline: Nov 21, 2007 (3 weeks) From nominolo at googlemail.com Wed Oct 31 09:38:02 2007 From: nominolo at googlemail.com (Thomas Schilling) Date: Wed Oct 31 09:36:03 2007 Subject: PROPOSAL: Add Data.Set.mapMaybe In-Reply-To: <1193837396.5865.11.camel@intothevoid> References: <1193837396.5865.11.camel@intothevoid> Message-ID: <1193837882.5865.14.camel@intothevoid> On Wed, 2007-10-31 at 14:29 +0100, Thomas Schilling wrote: > Hi there. > > I recently find myself missing Data.Set.mapMaybe. This function is > implemented for Data.Map.Map, but is strangely missing from > Data.Set.mapMaybe. I believe it could be implemented using > Data.Foldable, but not as efficiently. The obvious implementation would > be: > > mapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set b > mapMaybe f Tip = Tip > mapMaybe f (Bin _ x l r) = case f x of > Nothing -> merge (mapMaybe f l) (mapMaybe f r) > Just y -> union y (mapMaybe f l) (mapMaybe f r) > > Any comments? D'oh! This is wrong. Sorry, for the noise. From nominolo at googlemail.com Wed Oct 31 09:45:35 2007 From: nominolo at googlemail.com (Thomas Schilling) Date: Wed Oct 31 09:43:38 2007 Subject: PROPOSAL: Add Data.Set.mapMaybe In-Reply-To: <1193837882.5865.14.camel@intothevoid> References: <1193837396.5865.11.camel@intothevoid> <1193837882.5865.14.camel@intothevoid> Message-ID: <1193838335.5865.17.camel@intothevoid> On Wed, 2007-10-31 at 14:38 +0100, Thomas Schilling wrote: > On Wed, 2007-10-31 at 14:29 +0100, Thomas Schilling wrote: > > Hi there. > > > > I recently find myself missing Data.Set.mapMaybe. This function is > > implemented for Data.Map.Map, but is strangely missing from > > Data.Set.mapMaybe. I believe it could be implemented using > > Data.Foldable, but not as efficiently. The obvious implementation would > > be: > > > > mapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set b > > mapMaybe f Tip = Tip > > mapMaybe f (Bin _ x l r) = case f x of > > Nothing -> merge (mapMaybe f l) (mapMaybe f r) > > Just y -> union y (mapMaybe f l) (mapMaybe f r) > > > > Any comments? > > D'oh! This is wrong. Sorry, for the noise. Should be: mapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set b mapMaybe f = foldl' g Set.empty . Set.toList where g s a = case f a of Nothing -> s Just b -> Set.insert b s testMapMaybe = mapMaybe f (Set.fromList [(-4),(-3)..5]) where f x | odd x = Nothing | otherwise = Just (-(x * x)) From dons at galois.com Wed Oct 31 14:01:18 2007 From: dons at galois.com (Don Stewart) Date: Wed Oct 31 13:58:42 2007 Subject: PROPOSAL: Add Data.Set.mapMaybe In-Reply-To: <1193838335.5865.17.camel@intothevoid> References: <1193837396.5865.11.camel@intothevoid> <1193837882.5865.14.camel@intothevoid> <1193838335.5865.17.camel@intothevoid> Message-ID: <20071031180118.GB17689@scytale.galois.com> nominolo: > On Wed, 2007-10-31 at 14:38 +0100, Thomas Schilling wrote: > > On Wed, 2007-10-31 at 14:29 +0100, Thomas Schilling wrote: > > > Hi there. > > > > > > I recently find myself missing Data.Set.mapMaybe. This function is > > > implemented for Data.Map.Map, but is strangely missing from > > > Data.Set.mapMaybe. I believe it could be implemented using > > > Data.Foldable, but not as efficiently. The obvious implementation would > > > be: > > > > > > mapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set b > > > mapMaybe f Tip = Tip > > > mapMaybe f (Bin _ x l r) = case f x of > > > Nothing -> merge (mapMaybe f l) (mapMaybe f r) > > > Just y -> union y (mapMaybe f l) (mapMaybe f r) > > > > > > Any comments? > > > > D'oh! This is wrong. Sorry, for the noise. > > Should be: > > mapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set b > mapMaybe f = foldl' g Set.empty . Set.toList > where > g s a = case f a of > Nothing -> s > Just b -> Set.insert b s > > testMapMaybe = mapMaybe f (Set.fromList [(-4),(-3)..5]) > where f x | odd x = Nothing > | otherwise = Just (-(x * x)) > Looks good. Did you open up a libraries ticket? -- Don From nominolo at googlemail.com Wed Oct 31 15:56:10 2007 From: nominolo at googlemail.com (Thomas Schilling) Date: Wed Oct 31 15:54:11 2007 Subject: PROPOSAL: Add Data.Set.mapMaybe In-Reply-To: <20071031180118.GB17689@scytale.galois.com> References: <1193837396.5865.11.camel@intothevoid> <1193837882.5865.14.camel@intothevoid> <1193838335.5865.17.camel@intothevoid> <20071031180118.GB17689@scytale.galois.com> Message-ID: <1193860570.5869.1.camel@intothevoid> On Wed, 2007-10-31 at 11:01 -0700, Don Stewart wrote: > Looks good. Did you open up a libraries ticket? http://hackage.haskell.org/trac/ghc/ticket/1816 / Thomas