From johan.tibell at gmail.com Thu Aug 2 01:23:34 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Wed, 1 Aug 2012 16:23:34 -0700 Subject: Small problem in containers-0.5.0.0 docs In-Reply-To: References: Message-ID: Fixed. Thanks for the bug report! In the future you can file reports at https://github.com/haskell/containers/issues to make sure I don't forget about them! :) On Wed, Aug 1, 2012 at 6:30 AM, Christoph Breitkopf wrote: > Hello, > > the haddoc sources refer to the strict/lazy modules using single quotes, > which does not work, as is is interpreted as a type reference > (.../Data-Map.html#t:Strict). Replacing the single quotes by double quotes > for a module reference fixes this. (I just had the same problem in > IntervalMap). > > I spotted the problem in Data.Map, but it's probably also present in other > modules. > > Regards, > > Chris From dsf at seereason.com Thu Aug 9 18:28:31 2012 From: dsf at seereason.com (David Fox) Date: Thu, 9 Aug 2012 09:28:31 -0700 Subject: System.Process.ByteString.readProcess, readProcessWithExitCode Message-ID: Attached is a module containing ByteString analogs of two functions from System.Process: readProcess and readProcessWithExitCode. I use these a lot and would love to see them incorporated into a standard library, though I'm not sure which one. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ByteString.hs Type: application/octet-stream Size: 3877 bytes Desc: not available URL: From dsf at seereason.com Thu Aug 9 20:33:33 2012 From: dsf at seereason.com (David Fox) Date: Thu, 9 Aug 2012 11:33:33 -0700 Subject: System.Process.ByteString.readProcess, readProcessWithExitCode In-Reply-To: References: Message-ID: On Thu, Aug 9, 2012 at 9:28 AM, David Fox wrote: > Attached is a module containing ByteString analogs of two functions from > System.Process: readProcess and readProcessWithExitCode. I use these a lot > and would love to see them incorporated into a standard library, though I'm > not sure which one. Sorry, didn't know attachments were excluded. The two functions are available in the Unixutils library: http://hackage.haskell.org/packages/archive/Unixutils/1.50/doc/html/System-Unix-Process.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwiegley at gmail.com Thu Aug 9 19:19:20 2012 From: jwiegley at gmail.com (John Wiegley) Date: Thu, 09 Aug 2012 12:19:20 -0500 Subject: System.Process.ByteString.readProcess, readProcessWithExitCode References: Message-ID: >>>>> David Fox writes: > Attached is a module containing ByteString analogs of two functions from > System.Process: readProcess and readProcessWithExitCode. ?I use these a lot > and would love to see them incorporated into a standard library, though I'm > not sure which one. I agree. I wrote my own version of readProcessWithExitCode a while back as well. John From v.dijk.bas at gmail.com Fri Aug 10 09:01:25 2012 From: v.dijk.bas at gmail.com (Bas van Dijk) Date: Fri, 10 Aug 2012 09:01:25 +0200 Subject: System.Process.ByteString.readProcess, readProcessWithExitCode In-Reply-To: References: Message-ID: On 9 August 2012 20:33, David Fox wrote: > On Thu, Aug 9, 2012 at 9:28 AM, David Fox wrote: >> >> Attached is a module containing ByteString analogs of two functions from >> System.Process: readProcess and readProcessWithExitCode. I use these a lot >> and would love to see them incorporated into a standard library, though I'm >> not sure which one. > > > Sorry, didn't know attachments were excluded. The two functions are > available in the Unixutils library: > http://hackage.haskell.org/packages/archive/Unixutils/1.50/doc/html/System-Unix-Process.html Some time ago I fixed some asynchronous exception bugs in those functions. Take a look at the current implementation: https://github.com/ghc/packages-process/blob/master/System/Process.hs#L392 You might want to incorporate these changes into your library. Cheers, Bas From dsf at seereason.com Fri Aug 10 21:13:41 2012 From: dsf at seereason.com (David Fox) Date: Fri, 10 Aug 2012 12:13:41 -0700 Subject: System.Process.ByteString.readProcess, readProcessWithExitCode In-Reply-To: References: Message-ID: On Fri, Aug 10, 2012 at 12:01 AM, Bas van Dijk wrote: > On 9 August 2012 20:33, David Fox wrote: > > On Thu, Aug 9, 2012 at 9:28 AM, David Fox wrote: > >> > >> Attached is a module containing ByteString analogs of two functions from > >> System.Process: readProcess and readProcessWithExitCode. I use these a > lot > >> and would love to see them incorporated into a standard library, though > I'm > >> not sure which one. > > > > > > Sorry, didn't know attachments were excluded. The two functions are > > available in the Unixutils library: > > > http://hackage.haskell.org/packages/archive/Unixutils/1.50/doc/html/System-Unix-Process.html > > Some time ago I fixed some asynchronous exception bugs in those > functions. Take a look at the current implementation: > > https://github.com/ghc/packages-process/blob/master/System/Process.hs#L392 > > You might want to incorporate these changes into your library. > It looks like this will have to wait for bytestring 0.10, which has NFData instances. I guess there are ways to hack this... -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazar6 at illinois.edu Sun Aug 12 22:53:10 2012 From: lazar6 at illinois.edu (David Lazar) Date: Sun, 12 Aug 2012 20:53:10 +0000 (UTC) Subject: System.Process.ByteString.readProcess, readProcessWithExitCode References: Message-ID: David Fox seereason.com> writes: > Attached is a module containing ByteString analogs of two functions from > System.Process: readProcess and readProcessWithExitCode. I use these a lot > and would love to see them incorporated into a standard library, though I'm > not sure which one. I have the process-extras library on Hackage which contains readProcessWithExitCode variants for ByteString and Text. http://hackage.haskell.org/package/process-extras I'd be happy to apply patches which add readProcess and make other improvements :-). Cheers, David From ekmett at gmail.com Mon Aug 13 10:16:11 2012 From: ekmett at gmail.com (Edward Kmett) Date: Mon, 13 Aug 2012 04:16:11 -0400 Subject: PolyKinds, Control.Category and GHC 7.6.1 Message-ID: Would it be possible to add something like {-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE PolyKinds #-} #endif to the top of Control.Category before the 7.6.1 final release? Control.Category.Category is pretty much the only type in base that directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds. I only noticed that it wasn't there in the release candidate just now. -Edward Kmett -------------- next part -------------- An HTML attachment was scrubbed... URL: From danburton.email at gmail.com Mon Aug 13 15:55:39 2012 From: danburton.email at gmail.com (Dan Burton) Date: Mon, 13 Aug 2012 07:55:39 -0600 Subject: PolyKinds, Control.Category and GHC 7.6.1 In-Reply-To: References: Message-ID: > > Control.Category.Category is pretty much the only type in base that > directly benefits from PolyKinds without any code changes, but without > enabling the extension there nobody can define categories for kinds other > than *, and most interesting categories actually have more exotic kinds. What, precisely, is the benefit of turning on PolyKinds for that file without changing the code? If we're cpp'ing it in, then are there further benefits that we could also reap by cpp'ing some code changes? -- Dan Burton -------------- next part -------------- An HTML attachment was scrubbed... URL: From ekmett at gmail.com Mon Aug 13 16:12:26 2012 From: ekmett at gmail.com (Edward Kmett) Date: Mon, 13 Aug 2012 10:12:26 -0400 Subject: PolyKinds, Control.Category and GHC 7.6.1 In-Reply-To: References: Message-ID: On Mon, Aug 13, 2012 at 9:55 AM, Dan Burton wrote: > Control.Category.Category is pretty much the only type in base that >> directly benefits from PolyKinds without any code changes, but without >> enabling the extension there nobody can define categories for kinds other >> than *, and most interesting categories actually have more exotic >> kinds. > > > What, precisely, is the benefit of turning on PolyKinds for that file > without changing the code? If we're cpp'ing it in, then are there further > benefits that we could also reap by cpp'ing some code changes? > The benefit is that the kind of Category changes to Category :: (x -> x -> *) -> Constraint This means I can do things like make data Dict p where Dict :: p => Dict p newtype a |- b = Sub (a => Dict b) and then (|-) :: Constraint -> Constraint -> * is a valid candidate to become a Category. Moreover, PolyKinds + DataKinds finally enable us to write product and sum categories, make categories for natural transformations, and generally finally put Category to work. These were all disallowed by the previous simpler kind. No code changes need be applied beyond permitting the type of Category to generalize and existing code continues to work. This change actually could have been applied in 7.4.1. -Edward Kmett -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Mon Aug 13 19:13:08 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Mon, 13 Aug 2012 19:13:08 +0200 (CEST) Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: On Sun, 29 Jul 2012, Thomas Schilling wrote: > On 29 July 2012 15:37, Thomas DuBuisson wrote: >> >> That is a great point. Most my uses of 'bitSize' are monomorphic and >> Maybe would just be silly. OTOH, I'd be more than happy to fix up any >> polymorphic code to include a new BitSize constraint. > > To make sure I understand this correctly: > > The current problem is that bitSize is a partial function *depending > on the type* of its argument (currently it always returns _|_ for > Integer, and is total for any other type). That does indeed seem like > a Bad Idea. > > You propose to: > > 1. Remove "bitSize" from the Bits class. > 2. Add a new class BitSize which only contains the "bitSize" method. > Integer would not be an instance of this class. +1 From ekmett at gmail.com Mon Aug 13 23:38:40 2012 From: ekmett at gmail.com (Edward Kmett) Date: Mon, 13 Aug 2012 17:38:40 -0400 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: On Sun, Jul 29, 2012 at 12:38 PM, Antoine Latter wrote: > On Sun, Jul 29, 2012 at 11:37 AM, Antoine Latter > wrote: > > > > The downside to this proposal is that the requester (Edward) actually > > wants a function of type "a -> Maybe Int", so his polymorphic function > > can handle both infinite bit-types and finite bit-types. > > > > With the new class, Edward could write: > > > > class BitTraversable i where > > traverseBits :: > > > > instance (BitSize i) => BitTraversable i where > > traverseBits = > > > > instance BitTraversable Integer where > > traverseBits = > > > > I should add that this approach looks like it would require > OverlappingInstances. Correct. This is not a viable solution for the problem, also it precludes the existance of support for someone else's Natural number type, etc. Every type that is currently an instance of Bits is either of a fixed size or potentially infinite. Changing bitSize to return a Maybe a works. Making a separate BitSize class simply forces me to do exactly what I'm doing right now, which is ignore it and manually probe. I'm a strong -1 vote to any solution that splits BitSize out into a separate class. -Edward -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Mon Aug 13 23:48:05 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Mon, 13 Aug 2012 23:48:05 +0200 (CEST) Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: On Mon, 13 Aug 2012, Edward Kmett wrote: > Correct. This is not a viable solution for the problem, also it precludes the existance of support for > someone else's Natural number type, etc. > > Every type that is currently an instance of Bits is either of a fixed size or potentially infinite. > > Changing bitSize to return a Maybe a works. Making a separate BitSize class simply forces me to do exactly > what I'm doing right now, which is ignore it and manually probe.? How about two versions of 'bitSize' - one with Maybe return type in the Bits class and one without Maybe in a FixedBitSize subclass? From mark.lentczner at gmail.com Tue Aug 14 00:06:01 2012 From: mark.lentczner at gmail.com (Mark Lentczner) Date: Mon, 13 Aug 2012 18:06:01 -0400 Subject: gearing up for 2012.4.0.0 Message-ID: It's that time again.... time to get cooking on another tasty Haskell Platform release! Here's my updated timeline for 2012.4.0.0, target: *November 12th, 2012* - *August 20th, 2012* - Call for proposals for additions and changes - *September 17th, 2012* - Call for proposals ends (no more proposals considered) - *October 1st, 2012* - Proposals decided, Initial version list - *October 15th, 2012* - First candidates - *October 29th, 2012* - Open issues resolved, Second candidates - *November 5th, 2012* - Final release candidates *If you are maintainer of a library in the platform:* Please start thinking about which version of your library should be in the release. If it will require coordination with versions of other libraries in the platform, now is the time to start coordinating. In mid-september, we will need to hear from the maintainers which version should be included: *I will not automatically bump to the latest version on Hackage for this release.* * * *If you are a maintainer of a library that you'd like to be in the platform: * Now is the time to get a clean version on Hackage, and then put together a proposal for the haskell-platform list. Please see the process for Adding Packages . *If you are part of the reviewing process:* Traditionally, proposals have been accompanied by lengthly discussions, often resulting in deep API design confabs. As we are approaching a release, I'd like to ask all to consider making this round more succinct if at all possible. In particular, it would be great if proposals were keyed to specific revisions of a library to be considered. If consensus is that something needs to be changed before inclusion - it would be best if maintainers took that input into account, turned another library version and placed that up for consideration. Please note the schedule: I'm going to hold October 1st firm. *If you are GHC Central: *I couldn't find a timeline for 7.6. Will that have hit a stable release by October 1st, or should we be planning on shipping 7.4.2 (which I think would be fine.) *If you are a packager or builder of HP releases: *Please review the trac ticket list . Please edit tickets to reflect reality: Close things that are fixed or won't ever be done. Edit descriptions with more information if you have it. But most importantly, please assign milestones correctly: If you are going to fix something this time - put it in the 2012.4.0.0 milestone. If it is for the future, put it in Blue Sky. - Mark "mzero" Lentczner, Chef de la Release -------------- next part -------------- An HTML attachment was scrubbed... URL: From ekmett at gmail.com Tue Aug 14 00:08:53 2012 From: ekmett at gmail.com (Edward Kmett) Date: Mon, 13 Aug 2012 18:08:53 -0400 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: That would work perfectly. Sent from my iPhone On Aug 13, 2012, at 5:48 PM, Henning Thielemann wrote: > > On Mon, 13 Aug 2012, Edward Kmett wrote: > >> Correct. This is not a viable solution for the problem, also it precludes the existance of support for >> someone else's Natural number type, etc. >> Every type that is currently an instance of Bits is either of a fixed size or potentially infinite. >> Changing bitSize to return a Maybe a works. Making a separate BitSize class simply forces me to do exactly >> what I'm doing right now, which is ignore it and manually probe. > > How about two versions of 'bitSize' - one with Maybe return type in the Bits class and one without Maybe in a FixedBitSize subclass? > From johan.tibell at gmail.com Tue Aug 14 00:13:38 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Mon, 13 Aug 2012 15:13:38 -0700 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: On Mon, Aug 13, 2012 at 2:48 PM, Henning Thielemann wrote: > How about two versions of 'bitSize' - one with Maybe return type in the Bits > class and one without Maybe in a FixedBitSize subclass? Is this worth breaking existing users of bitSize over? If anything it seems more worthwhile to throw out Integer from the Bits class and declare Bits to be for fixed sized entities. From lemming at henning-thielemann.de Tue Aug 14 00:19:36 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue, 14 Aug 2012 00:19:36 +0200 (CEST) Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: On Mon, 13 Aug 2012, Johan Tibell wrote: > On Mon, Aug 13, 2012 at 2:48 PM, Henning Thielemann > wrote: >> How about two versions of 'bitSize' - one with Maybe return type in the Bits >> class and one without Maybe in a FixedBitSize subclass? > > Is this worth breaking existing users of bitSize over? If the method of 'FixedBitSize' is named 'bitSize' then only the type signature will be affected (FixedBitSize constraint instead of Bits). Although I don't know whether this is a good solution. > If anything it seems more worthwhile to throw out Integer from the Bits > class and declare Bits to be for fixed sized entities. From johan.tibell at gmail.com Tue Aug 14 00:21:56 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Mon, 13 Aug 2012 15:21:56 -0700 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: On Mon, Aug 13, 2012 at 3:19 PM, Henning Thielemann wrote: > > On Mon, 13 Aug 2012, Johan Tibell wrote: > >> On Mon, Aug 13, 2012 at 2:48 PM, Henning Thielemann >> wrote: >>> >>> How about two versions of 'bitSize' - one with Maybe return type in the >>> Bits >>> class and one without Maybe in a FixedBitSize subclass? >> >> >> Is this worth breaking existing users of bitSize over? > > > If the method of 'FixedBitSize' is named 'bitSize' then only the type > signature will be affected (FixedBitSize constraint instead of Bits). > Although I don't know whether this is a good solution. Imports will have to be modified as well if Bits keeps the name 'bitSize' for its method. In general these kind of breakages has been very painful in the past. Most libraries need to support the last two or three released versions of GHC (and thus base) so breaking changes like this are likely to result in lots of #ifdefs in client code to paper over the differences. Perhaps I'm getting old and cranky but I more in the never-break-anything camp than I used to be. -- Johan From lemming at henning-thielemann.de Tue Aug 14 00:26:49 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue, 14 Aug 2012 00:26:49 +0200 (CEST) Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: On Mon, 13 Aug 2012, Johan Tibell wrote: > On Mon, Aug 13, 2012 at 3:19 PM, Henning Thielemann wrote: >> >> If the method of 'FixedBitSize' is named 'bitSize' then only the type >> signature will be affected (FixedBitSize constraint instead of Bits). >> Although I don't know whether this is a good solution. > > Imports will have to be modified as well if Bits keeps the name > 'bitSize' for its method. > > In general these kind of breakages has been very painful in the past. > Most libraries need to support the last two or three released versions > of GHC (and thus base) so breaking changes like this are likely to > result in lots of #ifdefs in client code to paper over the > differences. That's true. How about keeping 'bitSize' as it is, maybe deprecate it in the future, add maybeBitSize to Bits class and add a new class FixedBitSize with method fixedBitSize? From johan.tibell at gmail.com Tue Aug 14 00:41:35 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Mon, 13 Aug 2012 15:41:35 -0700 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: On Mon, Aug 13, 2012 at 3:26 PM, Henning Thielemann wrote: > > On Mon, 13 Aug 2012, Johan Tibell wrote: > >> On Mon, Aug 13, 2012 at 3:19 PM, Henning Thielemann >> wrote: >>> >>> >>> If the method of 'FixedBitSize' is named 'bitSize' then only the type >>> signature will be affected (FixedBitSize constraint instead of Bits). >>> Although I don't know whether this is a good solution. >> >> >> Imports will have to be modified as well if Bits keeps the name >> 'bitSize' for its method. >> >> In general these kind of breakages has been very painful in the past. >> Most libraries need to support the last two or three released versions >> of GHC (and thus base) so breaking changes like this are likely to >> result in lots of #ifdefs in client code to paper over the >> differences. > > > That's true. How about keeping 'bitSize' as it is, maybe deprecate it in the > future, add maybeBitSize to Bits class and add a new class FixedBitSize with > method fixedBitSize? This sounds more reasonably to me. I don't particularly need a fixedBitSize method, but if people have uses for it go ahead. From ekmett at gmail.com Tue Aug 14 00:42:54 2012 From: ekmett at gmail.com (Edward Kmett) Date: Mon, 13 Aug 2012 18:42:54 -0400 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> Throwing Integer out of Bits seems more prone to induce breakage than providing a more accurate type for bitSize -- I know at least one of my modules for working with boolean rings would have be scrapped. It is also likely to force users who wanted the bit operations they already had on Integer to create wonky local instances to get back behavior the previously had available. Given my druthers at this point I'd go for: Making a subclass to move the existing bitSize to, replete with a default definition. class Bits b => FiniteBits b where bitSize :: b -> Int bitSize = fromJust . perhapsBitSize and adding the perhapsBitSize Lennart suggested to BitSize to replace the moved bitSize: class Bits b where perhapsBitSize :: b -> Maybe Int ... Then code that only works for finite cases can use bitSize, code that already worked with infinite cases that never touched bitSize can continue to work, existing users that called bitSize but could only handle finite cases can change to FiniteBits and doesn't need to take a performance hit or fiddling with the Just constructor, and code that can work for the infinite case if it didn't crap out with bottom can safely upgrade to perhapsBitSize. I am not wedded to the perhapsBitSize name. I am wedded to not losing existing functionality unnecessarily, however. Sent from my iPhone On Aug 13, 2012, at 6:13 PM, Johan Tibell wrote: > On Mon, Aug 13, 2012 at 2:48 PM, Henning Thielemann > wrote: >> How about two versions of 'bitSize' - one with Maybe return type in the Bits >> class and one without Maybe in a FixedBitSize subclass? > > Is this worth breaking existing users of bitSize over? If anything it > seems more worthwhile to throw out Integer from the Bits class and > declare Bits to be for fixed sized entities. From ekmett at gmail.com Tue Aug 14 00:44:13 2012 From: ekmett at gmail.com (Edward Kmett) Date: Mon, 13 Aug 2012 18:44:13 -0400 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <50141A01.2010707@ifi.lmu.de> Message-ID: <0492FCB7-3062-449E-B612-109A591B67CF@gmail.com> I'd be okay with this version of things as well. Sent from my iPhone On Aug 13, 2012, at 6:26 PM, Henning Thielemann wrote: > > On Mon, 13 Aug 2012, Johan Tibell wrote: > >> On Mon, Aug 13, 2012 at 3:19 PM, Henning Thielemann wrote: >>> >>> If the method of 'FixedBitSize' is named 'bitSize' then only the type >>> signature will be affected (FixedBitSize constraint instead of Bits). >>> Although I don't know whether this is a good solution. >> >> Imports will have to be modified as well if Bits keeps the name >> 'bitSize' for its method. >> >> In general these kind of breakages has been very painful in the past. >> Most libraries need to support the last two or three released versions >> of GHC (and thus base) so breaking changes like this are likely to >> result in lots of #ifdefs in client code to paper over the >> differences. > > That's true. How about keeping 'bitSize' as it is, maybe deprecate it in the future, add maybeBitSize to Bits class and add a new class FixedBitSize with method fixedBitSize? From thomas.dubuisson at gmail.com Tue Aug 14 00:51:37 2012 From: thomas.dubuisson at gmail.com (Thomas DuBuisson) Date: Mon, 13 Aug 2012 15:51:37 -0700 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> References: <50141A01.2010707@ifi.lmu.de> <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> Message-ID: On Mon, Aug 13, 2012 at 3:42 PM, Edward Kmett wrote: > Throwing Integer out of Bits seems more prone to induce breakage than providing a more accurate type for bitSize -- I know at least one of my modules for working with boolean rings would have be scrapped. > > It is also likely to force users who wanted the bit operations they already had on Integer to create wonky local instances to get back behavior the previously had available. > > Given my druthers at this point I'd go for: > > Making a subclass to move the existing bitSize to, replete with a default definition. > > class Bits b => FiniteBits b where > bitSize :: b -> Int > bitSize = fromJust . perhapsBitSize > > and adding the perhapsBitSize Lennart suggested to BitSize to replace the moved bitSize: > > class Bits b where > perhapsBitSize :: b -> Maybe Int > ... I know I've been quite after stirring up some of this discussion. In general I am happy with this suggestion from Edward (+1) and am willing to fix up any breakage in my libraries, though I feel like much of this debate is due to insufficient type class machinery in the language that we should discuss some day. Thomas > > Then code that only works for finite cases can use bitSize, code that already worked with infinite cases that never touched bitSize can continue to work, existing users that called bitSize but could only handle finite cases can change to FiniteBits and doesn't need to take a performance hit or fiddling with the Just constructor, and code that can work for the infinite case if it didn't crap out with bottom can safely upgrade to perhapsBitSize. > > I am not wedded to the perhapsBitSize name. I am wedded to not losing existing functionality unnecessarily, however. > > Sent from my iPhone > > On Aug 13, 2012, at 6:13 PM, Johan Tibell wrote: > >> On Mon, Aug 13, 2012 at 2:48 PM, Henning Thielemann >> wrote: >>> How about two versions of 'bitSize' - one with Maybe return type in the Bits >>> class and one without Maybe in a FixedBitSize subclass? >> >> Is this worth breaking existing users of bitSize over? If anything it >> seems more worthwhile to throw out Integer from the Bits class and >> declare Bits to be for fixed sized entities. From johan.tibell at gmail.com Tue Aug 14 01:08:39 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Mon, 13 Aug 2012 16:08:39 -0700 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> References: <50141A01.2010707@ifi.lmu.de> <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> Message-ID: On Mon, Aug 13, 2012 at 3:42 PM, Edward Kmett wrote: > Then code that only works for finite cases can use bitSize, code that already worked with infinite cases that never touched bitSize can continue to work, existing users that called bitSize but could only handle finite cases can change to FiniteBits and doesn't need to take a performance hit or fiddling with the Just constructor, and code that can work for the infinite case if it didn't crap out with bottom can safely upgrade to perhapsBitSize. This will still break client code though. The #ifdefs would then have to go in the import lists instead. I like Lennart's suggestion to deprecate 'bitSize' but not remove it. From illissius at gmail.com Tue Aug 14 02:15:12 2012 From: illissius at gmail.com (=?ISO-8859-1?Q?G=E1bor_Lehel?=) Date: Tue, 14 Aug 2012 02:15:12 +0200 Subject: PolyKinds, Control.Category and GHC 7.6.1 In-Reply-To: References: Message-ID: On Mon, Aug 13, 2012 at 10:16 AM, Edward Kmett wrote: > Would it be possible to add something like > > {-# LANGUAGE CPP #-} > #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 > {-# LANGUAGE PolyKinds #-} > #endif > > to the top of Control.Category before the 7.6.1 final release? > > Control.Category.Category is pretty much the only type in base that directly > benefits from PolyKinds without any code changes, but without enabling the > extension there nobody can define categories for kinds other than *, and > most interesting categories actually have more exotic kinds. > > I only noticed that it wasn't there in the release candidate just now. > > -Edward Kmett +1, this would be nice. > This change actually could have been applied in 7.4.1. FWIW PolyKinds in 7.4 is rough, and I had experiences where enabling it led to compile failures in downstream modules, so this wouldn't necessarily have been painless. Hopefully with 7.6 it will be. -- Your ship was destroyed in a monadic eruption. From amindfv at gmail.com Tue Aug 14 04:31:19 2012 From: amindfv at gmail.com (Tom Murphy) Date: Mon, 13 Aug 2012 22:31:19 -0400 Subject: maybeRead in base Message-ID: It would be great to have maybeRead in base in time for the next Haskell Platform release. There's been talk about including it several times, but it's remained as a utility function in other libraries (Network.CGI, for example, if I'm remembering right). Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From sol at typeful.net Tue Aug 14 08:54:13 2012 From: sol at typeful.net (Simon Hengel) Date: Tue, 14 Aug 2012 08:54:13 +0200 Subject: maybeRead in base In-Reply-To: References: Message-ID: <20120814065413.GB2742@x200> On Mon, Aug 13, 2012 at 10:31:19PM -0400, Tom Murphy wrote: > It would be great to have maybeRead in base in time for the next Haskell > Platform release. There's been talk about including it several times, but > it's remained as a utility function in other libraries (Network.CGI, for > example, if I'm remembering right). It's in base-4.6.0.0, but it's called readMaybe (personally, I don't like that name, but I guess it's for consistency with readEither). Cheers, Simon From dmcgill9071 at gmail.com Tue Aug 14 11:32:19 2012 From: dmcgill9071 at gmail.com (David McGillicuddy) Date: Tue, 14 Aug 2012 10:32:19 +0100 Subject: maybeRead in base In-Reply-To: <20120814065413.GB2742@x200> References: <20120814065413.GB2742@x200> Message-ID: What about (.:)*? Just looking at Hayoo quickly, at least half a dozen libraries seem to have defined it and it's a permanent feature on lambdabot. *(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d (.:) = (.) (.) (.) David On Tue, Aug 14, 2012 at 7:54 AM, Simon Hengel wrote: > On Mon, Aug 13, 2012 at 10:31:19PM -0400, Tom Murphy wrote: > > It would be great to have maybeRead in base in time for the next Haskell > > Platform release. There's been talk about including it several times, but > > it's remained as a utility function in other libraries (Network.CGI, for > > example, if I'm remembering right). > > It's in base-4.6.0.0, but it's called readMaybe (personally, I don't > like that name, but I guess it's for consistency with readEither). > > Cheers, > Simon > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simonpj at microsoft.com Tue Aug 14 13:14:19 2012 From: simonpj at microsoft.com (Simon Peyton-Jones) Date: Tue, 14 Aug 2012 11:14:19 +0000 Subject: PolyKinds, Control.Category and GHC 7.6.1 In-Reply-To: References: Message-ID: <59543203684B2244980D7E4057D5FBC137971160@DB3EX14MBXC312.europe.corp.microsoft.com> | FWIW PolyKinds in 7.4 is rough, and I had experiences where enabling it | led to compile failures in downstream modules, so this wouldn't | necessarily have been painless. Hopefully with 7.6 it will be. PolyKinds is not an advertised feature of 7.4, so you should absolutely not rely on it working in 7.4. But it IS an advertised feature for 7.6 and should work flawlessly. (If not, yell.) Simon From bos at serpentine.com Tue Aug 14 19:27:38 2012 From: bos at serpentine.com (Bryan O'Sullivan) Date: Tue, 14 Aug 2012 10:27:38 -0700 Subject: gearing up for 2012.4.0.0 In-Reply-To: References: Message-ID: On Mon, Aug 13, 2012 at 3:06 PM, Mark Lentczner wrote: > > *If you are part of the reviewing process:* Traditionally, proposals have > been accompanied by lengthly discussions, often resulting in deep API > design confabs. > The discussion period for inclusion of vector in the HP has ended. I'd like to move that vector 0.9.1 be added to the next HP. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ekmett at gmail.com Tue Aug 14 20:02:15 2012 From: ekmett at gmail.com (Edward Kmett) Date: Tue, 14 Aug 2012 14:02:15 -0400 Subject: gearing up for 2012.4.0.0 In-Reply-To: References: Message-ID: +1 On Tue, Aug 14, 2012 at 1:27 PM, Bryan O'Sullivan wrote: > On Mon, Aug 13, 2012 at 3:06 PM, Mark Lentczner wrote: > >> >> *If you are part of the reviewing process:* Traditionally, proposals >> have been accompanied by lengthly discussions, often resulting in deep API >> design confabs. >> > > The discussion period for inclusion of vector in the HP has ended. I'd > like to move that vector 0.9.1 be added to the next HP. > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwiegley at gmail.com Mon Aug 13 21:23:01 2012 From: jwiegley at gmail.com (John Wiegley) Date: Mon, 13 Aug 2012 14:23:01 -0500 Subject: System.Process.ByteString.readProcess, readProcessWithExitCode References: Message-ID: >>>>> David Lazar writes: > I have the process-extras library on Hackage which contains > readProcessWithExitCode variants for ByteString and Text. How about adding the same function for the lazy variants? John From ekmett at gmail.com Wed Aug 15 02:41:43 2012 From: ekmett at gmail.com (Edward Kmett) Date: Tue, 14 Aug 2012 20:41:43 -0400 Subject: gearing up for 2012.4.0.0 In-Reply-To: References: Message-ID: Lest I forget, we'll need to bump mtl to the 2.1.2 that is already on Hackage to work with changes to the Prelude. http://hdiff.luite.com/cgit/mtl/commit/?id=73be6cb23732ffb292412602b3b492fbc2a26f6a -Edward Kmett -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christian.Maeder at dfki.de Wed Aug 15 15:07:33 2012 From: Christian.Maeder at dfki.de (Christian Maeder) Date: Wed, 15 Aug 2012 15:07:33 +0200 Subject: List-0.4.3 Message-ID: <502B9F15.1000208@dfki.de> Hi, The change in package List-0.4.3 cause hexpat to fail. (It works with List-0.4.2 without "mapMaybe") C. Resolving dependencies... Downloading hexpat-0.20.2... Configuring hexpat-0.20.2... Building hexpat-0.20.2... Preprocessing library hexpat-0.20.2... [ 1 of 12] Compiling Text.XML.Expat.Internal.IO ( Text/XML/Expat/Internal/IO.hs, dist/build/Text/XML/Expat/Internal/IO.o ) [ 2 of 12] Compiling Text.XML.Expat.SAX ( Text/XML/Expat/SAX.hs, dist/build/Text/XML/Expat/SAX.o ) [ 3 of 12] Compiling Text.XML.Expat.Internal.NodeClass ( Text/XML/Expat/Internal/NodeClass.hs, dist/build/Text/XML/Expat/Internal/NodeClass.o ) [ 4 of 12] Compiling Text.XML.Expat.Internal.Qualified ( Text/XML/Expat/Internal/Qualified.hs, dist/build/Text/XML/Expat/Internal/Qualified.o ) [ 5 of 12] Compiling Text.XML.Expat.Internal.Namespaced ( Text/XML/Expat/Internal/Namespaced.hs, dist/build/Text/XML/Expat/Internal/Namespaced.o ) [ 6 of 12] Compiling Text.XML.Expat.Tree ( Text/XML/Expat/Tree.hs, dist/build/Text/XML/Expat/Tree.o ) [ 7 of 12] Compiling Text.XML.Expat.Cursor ( Text/XML/Expat/Cursor.hs, dist/build/Text/XML/Expat/Cursor.o ) [ 8 of 12] Compiling Text.XML.Expat.Internal.DocumentClass ( Text/XML/Expat/Internal/DocumentClass.hs, dist/build/Text/XML/Expat/Internal/DocumentClass.o ) [ 9 of 12] Compiling Text.XML.Expat.Extended ( Text/XML/Expat/Extended.hs, dist/build/Text/XML/Expat/Extended.o ) Text/XML/Expat/Extended.hs:372:25: Ambiguous occurrence `mapMaybe' It could refer to either `Data.List.Class.mapMaybe', imported from `Data.List.Class' at Text/XML/Expat/Extended.hs:83:1-22 or `Data.Maybe.mapMaybe', imported from `Data.Maybe' at Text/XML/Expat/Extended.hs:84:1-17 cabal: Error: some packages failed to install: hexpat-0.20.2 failed during the building phase. The exception was: ExitFailure 1 From ekmett at gmail.com Wed Aug 15 19:02:39 2012 From: ekmett at gmail.com (Edward Kmett) Date: Wed, 15 Aug 2012 13:02:39 -0400 Subject: maybeRead in base In-Reply-To: References: <20120814065413.GB2742@x200> Message-ID: I'm not a huge fan of (.:), but you insist on adding it, please generalize it to fmap.fmap. (.:) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b) This subsumes the other use case. -Edward On Tue, Aug 14, 2012 at 5:32 AM, David McGillicuddy wrote: > What about (.:)*? Just looking at Hayoo quickly, at least half a dozen > libraries seem to have defined it and it's a permanent feature on lambdabot. > > *(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d > (.:) = (.) (.) (.) > > David > > On Tue, Aug 14, 2012 at 7:54 AM, Simon Hengel wrote: > >> On Mon, Aug 13, 2012 at 10:31:19PM -0400, Tom Murphy wrote: >> > It would be great to have maybeRead in base in time for the next Haskell >> > Platform release. There's been talk about including it several times, >> but >> > it's remained as a utility function in other libraries (Network.CGI, for >> > example, if I'm remembering right). >> >> It's in base-4.6.0.0, but it's called readMaybe (personally, I don't >> like that name, but I guess it's for consistency with readEither). >> >> Cheers, >> Simon >> >> _______________________________________________ >> Libraries mailing list >> Libraries at haskell.org >> http://www.haskell.org/mailman/listinfo/libraries >> > > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christian.Maeder at dfki.de Thu Aug 16 11:50:38 2012 From: Christian.Maeder at dfki.de (Christian Maeder) Date: Thu, 16 Aug 2012 11:50:38 +0200 Subject: List-0.4.3 (and hexpat) In-Reply-To: References: <502B9F15.1000208@dfki.de> Message-ID: <502CC26E.8010103@dfki.de> Thanks for your prompt response and action! Am 15.08.2012 23:46, schrieb Yair Chuchem: > Hi Christian, > > Please try again now (after a cabal update). > I uploaded List-0.4.4 which removes mapMaybe, and then also uploaded > List-0.5.0 which re-adds it. > hexpat should now be using List-0.4.4 as it wants List < 0.5 > > I'll follow up with a few steps: > * Make myself a rule to test installing hexpat before I push updates to > List in future. > * Contact Stephen to change hexpat to not use unqualified open imports, > at least for List. His email was not in the package description. Christian > * Add docs to my package warning users that using it with unqualified > open imports may be more dangerous than usual (btw unqualified open > imports are always dangerous) because List exports functions which > generalize Prelude functions and shares their names by design. Similar > to how Control.Category exports "." and "id". > > Cheers & Happy coding, > Yair From twanvl at gmail.com Thu Aug 16 13:16:46 2012 From: twanvl at gmail.com (Twan van Laarhoven) Date: Thu, 16 Aug 2012 13:16:46 +0200 Subject: maybeRead in base In-Reply-To: References: <20120814065413.GB2742@x200> Message-ID: <502CD69E.6080504@gmail.com> On 15/08/12 19:02, Edward Kmett wrote: > I'm not a huge fan of (.:), but you insist on adding it, please generalize it to > fmap.fmap. > > (.:) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b) > > This subsumes the other use case. For the love of Categories, please don't go down this road. fmap is not the proper generalization of (.). Twan From ekmett at gmail.com Thu Aug 16 17:14:05 2012 From: ekmett at gmail.com (Edward Kmett) Date: Thu, 16 Aug 2012 11:14:05 -0400 Subject: maybeRead in base In-Reply-To: <502CD69E.6080504@gmail.com> References: <20120814065413.GB2742@x200> <502CD69E.6080504@gmail.com> Message-ID: This is part of why I'm not a fan of (.:) in the first place, but trying to generalize through Category doesn't offer anything here. Sent from my iPad On Aug 16, 2012, at 7:16 AM, Twan van Laarhoven wrote: > On 15/08/12 19:02, Edward Kmett wrote: >> I'm not a huge fan of (.:), but you insist on adding it, please generalize it to >> fmap.fmap. >> >> (.:) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b) >> >> This subsumes the other use case. > > For the love of Categories, please don't go down this road. fmap is not the proper generalization of (.). > > > Twan > > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries From v.dijk.bas at gmail.com Thu Aug 16 18:36:36 2012 From: v.dijk.bas at gmail.com (Bas van Dijk) Date: Thu, 16 Aug 2012 18:36:36 +0200 Subject: System.Process.ByteString.readProcess, readProcessWithExitCode In-Reply-To: References: Message-ID: On 12 August 2012 22:53, David Lazar wrote: > I'd be happy to apply patches which add readProcess and make other > improvements :-). I made a pull request that fixes some asynchronous exception bugs and adds the System.Process.Text.Lazy module: https://github.com/davidlazar/process-extras/pull/1 Cheers, Bas From lazar6 at illinois.edu Fri Aug 17 02:21:33 2012 From: lazar6 at illinois.edu (David Lazar) Date: Thu, 16 Aug 2012 19:21:33 -0500 Subject: System.Process.ByteString.readProcess, readProcessWithExitCode In-Reply-To: References: Message-ID: On Thu, Aug 16, 2012 at 11:36 AM, Bas van Dijk wrote: > On 12 August 2012 22:53, David Lazar wrote: >> I'd be happy to apply patches which add readProcess and make other >> improvements :-). > > I made a pull request that fixes some asynchronous exception bugs and > adds the System.Process.Text.Lazy module: > > https://github.com/davidlazar/process-extras/pull/1 Awesome. I've merged the pull request. I'll release a new version shortly. Cheers, David From dsf at seereason.com Fri Aug 17 02:31:07 2012 From: dsf at seereason.com (David Fox) Date: Thu, 16 Aug 2012 17:31:07 -0700 Subject: System.Process.ByteString.readProcess, readProcessWithExitCode In-Reply-To: References: Message-ID: On Thu, Aug 16, 2012 at 9:36 AM, Bas van Dijk wrote: > On 12 August 2012 22:53, David Lazar wrote: > > I'd be happy to apply patches which add readProcess and make other > > improvements :-). > > I made a pull request that fixes some asynchronous exception bugs and > adds the System.Process.Text.Lazy module: > > https://github.com/davidlazar/process-extras/pull/1 Does this depend on bytestring >= 0.10? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Fri Aug 17 14:10:02 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Fri, 17 Aug 2012 14:10:02 +0200 (CEST) Subject: addForeignPtrFinalizer - finalizers run in FIFO or LIFO order? Message-ID: The doc of base-4.5:Foreign.ForeignPtr.addForeignPtrFinalizer states: "This function adds a finalizer to the given foreign object. The finalizer will run before all other finalizers for the same object which have already been registered." I do addForeignPtrFinalizer finalize1 fp addForeignPtrFinalizer finalize2 fp and let the finalizers print something when they are started. I get the output: finalizer1 finalizer2 This indicates that the newly added finalizer is run _after_ the finalizers that are already registered. Is this a documentation bug or a bug in the base library? From lemming at henning-thielemann.de Fri Aug 17 17:34:05 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Fri, 17 Aug 2012 17:34:05 +0200 (CEST) Subject: addForeignPtrFinalizer - finalizers run in FIFO or LIFO order? In-Reply-To: References: Message-ID: On Fri, 17 Aug 2012, Henning Thielemann wrote: > The doc of base-4.5:Foreign.ForeignPtr.addForeignPtrFinalizer states: > "This function adds a finalizer to the given foreign object. The finalizer > will run before all other finalizers for the same object which have already > been registered." > > > I do > > addForeignPtrFinalizer finalize1 fp > addForeignPtrFinalizer finalize2 fp > > and let the finalizers print something when they are started. > I get the output: > > finalizer1 > finalizer2 > > This indicates that the newly added finalizer is run _after_ the finalizers > that are already registered. Is this a documentation bug or a bug in the base > library? Hm, it seems to depend on the context. In some situations I get the correct (reversed) order finalizer2 finalizer1 and in others I get finalizer1 first and then finalizer2. Any hint what can change the order of finalizers? From lemming at henning-thielemann.de Fri Aug 17 18:32:14 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Fri, 17 Aug 2012 18:32:14 +0200 (CEST) Subject: addForeignPtrFinalizer - finalizers run in FIFO or LIFO order? In-Reply-To: References: Message-ID: On Fri, 17 Aug 2012, Henning Thielemann wrote: > On Fri, 17 Aug 2012, Henning Thielemann wrote: > >> The doc of base-4.5:Foreign.ForeignPtr.addForeignPtrFinalizer states: >> "This function adds a finalizer to the given foreign object. The >> finalizer will run before all other finalizers for the same object which >> have already been registered." >> >> >> I do >> >> addForeignPtrFinalizer finalize1 fp >> addForeignPtrFinalizer finalize2 fp >> >> and let the finalizers print something when they are started. >> I get the output: >> >> finalizer1 >> finalizer2 >> >> This indicates that the newly added finalizer is run _after_ the finalizers >> that are already registered. Is this a documentation bug or a bug in the >> base library? > > > Hm, it seems to depend on the context. In some situations I get the correct > (reversed) order > > finalizer2 > finalizer1 > > and in others I get finalizer1 first and then finalizer2. Any hint what can > change the order of finalizers? continuing my monologue ... It seems that a simple modification like turning a not directly related allocaBytes into a mallocBytes reverses the order from incorrect to correct (reversed). Maybe adding the finalizers is not the problem but running them. Maybe there are different ways to run the finalizers and allocaBytes causes an invalid execution of finalizers whereas mallocBytes leaves the correct way. From ezyang at MIT.EDU Fri Aug 17 22:06:44 2012 From: ezyang at MIT.EDU (Edward Z. Yang) Date: Fri, 17 Aug 2012 16:06:44 -0400 Subject: addForeignPtrFinalizer - finalizers run in FIFO or LIFO order? In-Reply-To: References: Message-ID: <1345233987-sup-6852@ezyang> No. 1 question: do you have a reproduceable test case of both behaviors? Edward Excerpts from Henning Thielemann's message of Fri Aug 17 08:10:02 -0400 2012: > > The doc of base-4.5:Foreign.ForeignPtr.addForeignPtrFinalizer states: > "This function adds a finalizer to the given foreign object. The > finalizer will run before all other finalizers for the same object which > have already been registered." > > > I do > > addForeignPtrFinalizer finalize1 fp > addForeignPtrFinalizer finalize2 fp > > and let the finalizers print something when they are started. > I get the output: > > finalizer1 > finalizer2 > > This indicates that the newly added finalizer is run _after_ the > finalizers that are already registered. Is this a documentation bug or a > bug in the base library? > From lemming at henning-thielemann.de Fri Aug 17 22:29:34 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Fri, 17 Aug 2012 22:29:34 +0200 (CEST) Subject: addForeignPtrFinalizer - finalizers run in FIFO or LIFO order? In-Reply-To: <1345233987-sup-6852@ezyang> References: <1345233987-sup-6852@ezyang> Message-ID: On Fri, 17 Aug 2012, Edward Z. Yang wrote: > No. 1 question: do you have a reproduceable test case of both behaviors? Unfortunately I was not able to reduce it to a small test. Below a certain complexity the problem vanishes. Currently my example has many dependencies on external libraries (libav etc.) :-( Thus I hoped I could approach the problem from a different direction. If there are different ways to run the finalizers of a ForeignPtr then I could check them. I could not find something suspicious in base:GHC.ForeignPtr, though. From bertram.felgenhauer at googlemail.com Sat Aug 18 17:43:38 2012 From: bertram.felgenhauer at googlemail.com (Bertram Felgenhauer) Date: Sat, 18 Aug 2012 17:43:38 +0200 Subject: addForeignPtrFinalizer - finalizers run in FIFO or LIFO order? In-Reply-To: References: Message-ID: <20120818154338.GA5168@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> Henning Thielemann wrote: > and let the finalizers print something when they are started. > I get the output: > > finalizer1 > finalizer2 Funny bug, I can reproduce it. (And it is a bug; the code in question violates a documented invariant.) What happens is, in essence, that the list of finalizers is reversed during garbage collection. See http://hackage.haskell.org/trac/ghc/ticket/7160 for an example program. Best regards, Bertram From lemming at henning-thielemann.de Sat Aug 18 18:10:14 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sat, 18 Aug 2012 18:10:14 +0200 (CEST) Subject: addForeignPtrFinalizer - finalizers run in FIFO or LIFO order? In-Reply-To: <20120818154338.GA5168@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> References: <20120818154338.GA5168@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> Message-ID: Hi Bertram, On Sat, 18 Aug 2012, Bertram Felgenhauer wrote: > Henning Thielemann wrote: >> and let the finalizers print something when they are started. >> I get the output: >> >> finalizer1 >> finalizer2 > > Funny bug, I can reproduce it. (And it is a bug; the code in question > violates a documented invariant.) What happens is, in essence, that the > list of finalizers is reversed during garbage collection. > > See http://hackage.haskell.org/trac/ghc/ticket/7160 for an example > program. Thank you a lot for working out the example! It could have required ages for me to reduce my problem to such a compact example. From mark.lentczner at gmail.com Tue Aug 21 15:43:39 2012 From: mark.lentczner at gmail.com (Mark Lentczner) Date: Tue, 21 Aug 2012 06:43:39 -0700 Subject: HP 2012.4.0.0 -- Call for Proposals Message-ID: While proposals for changes to Haskell Platform can be made at any time, this call is for proposals that would like to land in the 2012.4.0.0 release. The 2012.4.0.0 is scheduled for November 12th, 2012. In order for a proposal to made it in that release, it needs to meet the following timeline: - *August 20th, 2012* - Call for proposals for additions and changes - *September 17th, 2012* - Call for proposals ends (no more proposals considered) - *October 1st, 2012* - Proposals decided, Initial version list *If you are a maintainer of a library that you'd like to be in the platform: * Now is the time to get a clean version on Hackage, and then put together a proposal for the haskell-platform list. Please see the process for Adding Packages . *Outstanding work:* - There is a proposal to include vector-0.9.1 in the platform - There is a ticket to consider including OpenGLRaw ? Ticket #167 - There are tickets to consider removing OpenGL and GLUT ? Ticket #57, Ticket #58 - There is a ticket about binary being in the platform without being part of it ? Ticket #191 - There is a ticket about needing hscolour to build the platform, but it isn't part of it ? Ticket #160 Please not that none of the tickets is a proposal before the list yet. If the maintainer of those libraries, or someone else, want to propose a change based on those tickets, now is the time to do so. In any event, I will close those tickets on September 17th. *If you are part of the reviewing process:* Traditionally, proposals have been accompanied by lengthly discussions, often resulting in deep API design confabs. As we are approaching a release, I'd like to ask all to consider making this round more succinct if at all possible. In particular, it would be great if proposals were keyed to specific revisions of a library to be considered. If consensus is that something needs to be changed before inclusion - it would be best if maintainers took that input into account, turned another library version and placed that up for consideration. Please note the schedule: I'm going to hold October 1st firm. ? Mark "proposed in a restaurant in front of friends" Lentczner -------------- next part -------------- An HTML attachment was scrubbed... URL: From marlowsd at gmail.com Tue Aug 21 17:32:49 2012 From: marlowsd at gmail.com (Simon Marlow) Date: Tue, 21 Aug 2012 16:32:49 +0100 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: Message-ID: <5033AA21.8070703@gmail.com> There's also a proposal (by me) to include the async package: http://trac.haskell.org/haskell-platform/wiki/Proposals/async The deadlines have now expired. During the discussion several people were positive about the package, however I don't think anyone expressed an opinion specifically on whether the package should be in the platform. I'm not sure how to interpret that result - at the least, it suggests a certain lack of enthusiasm. I'm still keen to see the package go in, mainly because when you start doing concurrent programming you quite quickly run into the need for some way to return results from threads, and then you need error handling. Then you start to need a way to wait for results from multiple threads with error handling... people build these things themselves, but in fact it's quite tricky with the basic Control.Concurrent API to do it right. The async package provides a well though-out API for that essential functionality, in a way that composes nicely. It's a very small package, but it should be a part of our standard vocabulary in my opinion. We should have it if only for the cool one-liners you can write with mapConcurrently :: Traversable t => (a -> IO b) -> t a -> IO (t b) :-) On the other hand, given that nobody else argued for it to be in the platform, a reasonable decision would be "wait and see"; I'd be fine with that too. Cheers, Simon On 21/08/2012 14:43, Mark Lentczner wrote: > While proposals for changes to Haskell Platform can be made at any time, > this call is for proposals that would like to land in the 2012.4.0.0 > release. > > The 2012.4.0.0 is scheduled for November 12th, 2012. In order for a > proposal to made it in that release, it needs to meet the following > timeline: > > * *August 20th, 2012* - Call for proposals for additions and changes > * *September 17th, 2012* - Call for proposals ends (no more proposals > considered) > * *October 1st, 2012* - Proposals decided, Initial version list > > *If you are a maintainer of a library that you'd like to be in the > platform:* Now is the time to get a clean version on Hackage, and then > put together a proposal for the haskell-platform list. Please see the > process for Adding Packages > . > > *Outstanding work:* > > * There is a proposal to include vector-0.9.1 in the platform > * There is a ticket to consider including OpenGLRaw ? Ticket #167 > > * There are tickets to consider removing OpenGL and GLUT ? Ticket #57 > , Ticket #58 > > * There is a ticket about binary being in the platform without being > part of it ? Ticket #191 > > * There is a ticket about needing hscolour to build the platform, but > it isn't part of it ? Ticket #160 > > > Please not that none of the tickets is a proposal before the list yet. > If the maintainer of those libraries, or someone else, want to propose a > change based on those tickets, now is the time to do so. In any event, I > will close those tickets on September 17th. > > *If you are part of the reviewing process:* Traditionally, proposals > have been accompanied by lengthly discussions, often resulting in deep > API design confabs. As we are approaching a release, I'd like to ask all > to consider making this round more succinct if at all possible. In > particular, it would be great if proposals were keyed to specific > revisions of a library to be considered. If consensus is that something > needs to be changed before inclusion - it would be best if maintainers > took that input into account, turned another library version and placed > that up for consideration. Please note the schedule: I'm going to hold > October 1st firm. > > ? Mark "proposed in a restaurant in front of friends" Lentczner > > > _______________________________________________ > Haskell-platform mailing list > Haskell-platform at projects.haskell.org > http://projects.haskell.org/cgi-bin/mailman/listinfo/haskell-platform > From bos at serpentine.com Tue Aug 21 17:54:47 2012 From: bos at serpentine.com (Bryan O'Sullivan) Date: Tue, 21 Aug 2012 08:54:47 -0700 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <5033AA21.8070703@gmail.com> References: <5033AA21.8070703@gmail.com> Message-ID: On Tue, Aug 21, 2012 at 8:32 AM, Simon Marlow wrote: > I'm not sure how to interpret that result - at the least, it suggests a > certain lack of enthusiasm. > I would like to see the async package go in. I have hand-rolled something like it a couple of times. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bos at serpentine.com Tue Aug 21 17:55:40 2012 From: bos at serpentine.com (Bryan O'Sullivan) Date: Tue, 21 Aug 2012 08:55:40 -0700 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: Message-ID: On Tue, Aug 21, 2012 at 6:43 AM, Mark Lentczner wrote: > *Outstanding work:* > I believe there was also a proposal to include the split package: http://trac.haskell.org/haskell-platform/wiki/Proposals/split -------------- next part -------------- An HTML attachment was scrubbed... URL: From felipe.lessa at gmail.com Tue Aug 21 17:56:18 2012 From: felipe.lessa at gmail.com (Felipe Almeida Lessa) Date: Tue, 21 Aug 2012 12:56:18 -0300 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: <5033AA21.8070703@gmail.com> Message-ID: Is it time for votes yet? +1 for async =). -- Felipe. From johan.tibell at gmail.com Tue Aug 21 18:26:46 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Tue, 21 Aug 2012 09:26:46 -0700 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: <5033AA21.8070703@gmail.com> Message-ID: On Tue, Aug 21, 2012 at 8:54 AM, Bryan O'Sullivan wrote: > On Tue, Aug 21, 2012 at 8:32 AM, Simon Marlow wrote: >> >> I'm not sure how to interpret that result - at the least, it suggests a >> certain lack of enthusiasm. > > > I would like to see the async package go in. I have hand-rolled something > like it a couple of times. Having just read through the API, which is very well-written, I'd like to see this go in as well. -- Johan From byorgey at seas.upenn.edu Tue Aug 21 19:12:36 2012 From: byorgey at seas.upenn.edu (Brent Yorgey) Date: Tue, 21 Aug 2012 13:12:36 -0400 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: Message-ID: <20120821171236.GA16448@seas.upenn.edu> On Tue, Aug 21, 2012 at 08:55:40AM -0700, Bryan O'Sullivan wrote: > On Tue, Aug 21, 2012 at 6:43 AM, Mark Lentczner wrote: > > > *Outstanding work:* > > > > I believe there was also a proposal to include the split package: > http://trac.haskell.org/haskell-platform/wiki/Proposals/split Indeed. I plan to release a new version (incorporating feedback) and bump the process soon. -Brent From allbery.b at gmail.com Tue Aug 21 19:24:44 2012 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 21 Aug 2012 13:24:44 -0400 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <5033AA21.8070703@gmail.com> References: <5033AA21.8070703@gmail.com> Message-ID: On Tue, Aug 21, 2012 at 11:32 AM, Simon Marlow wrote: > I'm still keen to see the package go in, mainly because when you start > doing concurrent programming you quite quickly run into the need for I think most of us are of the opinion that it would be nice to see it get some independent use and shake the bugs and infelicities out of it first; being in the platform implies (correctly or not) a certain level of interface stability and trust in functionality. -- brandon s allbery allbery.b at gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Tue Aug 21 20:05:50 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Tue, 21 Aug 2012 11:05:50 -0700 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: <5033AA21.8070703@gmail.com> Message-ID: On Tue, Aug 21, 2012 at 10:24 AM, Brandon Allbery wrote: > On Tue, Aug 21, 2012 at 11:32 AM, Simon Marlow wrote: >> >> I'm still keen to see the package go in, mainly because when you start >> doing concurrent programming you quite quickly run into the need for > > > I think most of us are of the opinion that it would be nice to see it get > some independent use and shake the bugs and infelicities out of it first; > being in the platform implies (correctly or not) a certain level of > interface stability and trust in functionality. Is the time until the actual release enough? If not we can accept the package now but not include it until the next release, at which point any obvious bugs should be gone. Simon, has the package seen any use (e.g. in one of your classes) yet? From danburton.email at gmail.com Tue Aug 21 20:34:52 2012 From: danburton.email at gmail.com (Dan Burton) Date: Tue, 21 Aug 2012 12:34:52 -0600 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: <5033AA21.8070703@gmail.com> Message-ID: Both split and async fit well with the "batteries included" nature of the platform. Regardless of how much use it has seen, async is definitely an API that should be bundled with the "standard" libraries. Compare with, say, Java or Python standard libs; programmers expect modern languages to expose easy-to-use concurrency operations. Most of the async definitions are thin convenience wrappers around Control.Concurrent, so as long as we are comfortable with Control.Concurrent, I see no reason to worry about async. In my unprofessional opinion, it's high time we add async to the platform. -- Dan Burton -------------- next part -------------- An HTML attachment was scrubbed... URL: From byorgey at seas.upenn.edu Tue Aug 21 20:48:28 2012 From: byorgey at seas.upenn.edu (Brent Yorgey) Date: Tue, 21 Aug 2012 14:48:28 -0400 Subject: Call for consensus: addition of split package to platform Message-ID: <20120821184828.GA25437@seas.upenn.edu> Hi everyone, Following the great feedback I got on the initial proposal, and after testing with the GHC 7.6 release candidate, I have just released split-0.2.0.0, which I am proposing for inclusion in the HP. The full proposal, links to previous discussion, etc. can be found on the wiki: http://trac.haskell.org/haskell-platform/wiki/Proposals/split Comments, questions, constructive criticism, etc. are still welcome, but this time around I hope we can build a consensus as to whether it should go in the platform or not. I would also like people's opinions on the one big question remaining: whether to use cabal's mechanisms to conditionally include some code, allowing the 'build' function to be taken from GHC.Exts when available, or defined manually otherwise. This would make split fully H2010-compatible. The currently released version does NOT include this, so it is H2010-compatible but GHC specific. The options are: 1) just use a generic version of 'build' (simplest option) 2) use only GHC's version of build (slightly faster) 3) do the conditional thing to choose between 1) and 2) at compile time (most general but most complicated/cumbersome) -Brent From lemming at henning-thielemann.de Tue Aug 21 20:55:40 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue, 21 Aug 2012 20:55:40 +0200 (CEST) Subject: Call for consensus: addition of split package to platform In-Reply-To: <20120821184828.GA25437@seas.upenn.edu> References: <20120821184828.GA25437@seas.upenn.edu> Message-ID: On Tue, 21 Aug 2012, Brent Yorgey wrote: > I would also like people's opinions on the one big question remaining: > whether to use cabal's mechanisms to conditionally include some code, > allowing the 'build' function to be taken from GHC.Exts when > available, or defined manually otherwise. This would make split fully > H2010-compatible. The currently released version does NOT include > this, so it is H2010-compatible but GHC specific. The options are: > > 1) just use a generic version of 'build' (simplest option) > > 2) use only GHC's version of build (slightly faster) > > 3) do the conditional thing to choose between 1) and 2) at compile > time (most general but most complicated/cumbersome) The best solution would be to have a package that provides the 'build' function for all compilers. For GHC it exports the fusing 'build' and for other compilers it exports a generic version. I think this 'build' function is useful for other packages, too. This package does not yet exist and if it would exist then it should or must be part of the platform. For now I would think a simple solution is ok, thus I vote for solution number 1. Later you can simply switch the import of 'build'. From gale at sefer.org Wed Aug 22 07:29:59 2012 From: gale at sefer.org (Yitzchak Gale) Date: Wed, 22 Aug 2012 08:29:59 +0300 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: Message-ID: On Tue, Aug 21, 2012, Mark Lentczner wrote: > Please see the process for > [Adding Packages](http://trac.haskell.org/haskell-platform/wiki/AddingPackages). > > Outstanding work... Just to clarify: Since Mark referenced the policy page, I assume that means we need to adhere to it at least to some degree before a package can be added to the platform. If so, there must be a proposal page on the Trac Wiki before we can consider a package. Therefore, there is only ONE package so far that is a candidate: async. A proposal page can be created by anyone, not just the package maintainer. So if you are in favor of a package other than async, you might better spend your time working on a wiki page instead of "voting" for a non-proposal. All that said, it seems to me that we might not need quite so much formal process for each package addition. If there is serious discussion on these lists, I personally would be willing to entrust the final decision to a benevolent dictator. We could save the formal process for periodic selection of the dictator. A number of open source projects work in this way. Thanks, Yitz From johan.tibell at gmail.com Wed Aug 22 07:50:54 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Tue, 21 Aug 2012 22:50:54 -0700 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: Message-ID: On Tuesday, August 21, 2012, Yitzchak Gale wrote: > On Tue, Aug 21, 2012, Mark Lentczner wrote: > > Please see the process for > > [Adding Packages]( > http://trac.haskell.org/haskell-platform/wiki/AddingPackages). > > > > Outstanding work... > > Just to clarify: > > Since Mark referenced the policy page, I assume that > means we need to adhere to it at least to some degree > before a package can be added to the platform. > > If so, there must be a proposal page on the Trac Wiki > before we can consider a package. Therefore, there > is only ONE package so far that is a candidate: async. There is also one for vector: http://trac.haskell.org/haskell-platform/wiki/Proposals/vector -------------- next part -------------- An HTML attachment was scrubbed... URL: From gale at sefer.org Wed Aug 22 10:27:13 2012 From: gale at sefer.org (Yitzchak Gale) Date: Wed, 22 Aug 2012 11:27:13 +0300 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: Message-ID: Johan Tibell wrote: > There is also one for vector: > http://trac.haskell.org/haskell-platform/wiki/Proposals/vector Ah, sorry. I didn't notice it at first because it wasn't on the list of active proposals: http://trac.haskell.org/haskell-platform/wiki/Proposals I added it. Now I see that Brent has created a proposal page for the split package; I added that as well. There is one more active proposal that Mark did not mention: the time-extras package, proposed by its author, Ashley Yakeley. I added a link to that, too. Thanks, Yitz From gale at sefer.org Wed Aug 22 10:40:57 2012 From: gale at sefer.org (Yitzchak Gale) Date: Wed, 22 Aug 2012 11:40:57 +0300 Subject: Add binary and/or cereal to the Haskell Platform Message-ID: I see that several years ago a proposal page was prepared for adding the binary package to the Haskell Platform, but it was never actually submitted as a proposal. http://trac.haskell.org/haskell-platform/wiki/Proposals/binary I think the reason it was not submitted was that things were in flux at that time regarding the binary and cereal packages. Now the situation has settled down. I think one or both of those packages ought to be added to the platform. Any opinions? Thanks, Yitz From marlowsd at gmail.com Wed Aug 22 13:09:50 2012 From: marlowsd at gmail.com (Simon Marlow) Date: Wed, 22 Aug 2012 12:09:50 +0100 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: <5033AA21.8070703@gmail.com> Message-ID: <5034BDFE.80004@gmail.com> On 21/08/2012 19:05, Johan Tibell wrote: > On Tue, Aug 21, 2012 at 10:24 AM, Brandon Allbery wrote: >> On Tue, Aug 21, 2012 at 11:32 AM, Simon Marlow wrote: >>> >>> I'm still keen to see the package go in, mainly because when you start >>> doing concurrent programming you quite quickly run into the need for >> >> >> I think most of us are of the opinion that it would be nice to see it get >> some independent use and shake the bugs and infelicities out of it first; >> being in the platform implies (correctly or not) a certain level of >> interface stability and trust in functionality. > > Is the time until the actual release enough? If not we can accept the > package now but not include it until the next release, at which point > any obvious bugs should be gone. > > Simon, has the package seen any use (e.g. in one of your classes) yet? The API is actually developed in my tutorial (which will become the book) from first principles, starting from MVars and then moving to STM, as a way to motivate and explain the underlying primitives. Basic versions of the API are used in several of the examples, although I'm not using the async package itself yet - the examples came first. I don't see any reverse deps on async in Hackage yet. Perhaps I need to write a blog post about it... Cheers, Simon From mark.lentczner at gmail.com Wed Aug 22 16:32:54 2012 From: mark.lentczner at gmail.com (Mark Lentczner) Date: Wed, 22 Aug 2012 07:32:54 -0700 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <5034BDFE.80004@gmail.com> References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> Message-ID: Thank you, Yitz, for the wiki maintenance! *vector* and *time-extras *- these should be updated by the proposers as they have been "reproposed" *async*, *vector*, and *time-extras* - I think these all need to be updated to reflect the current discussion period. While required by the process, I'd urge proposers to link to the specific version of the package under consideration. While the proposal is for inclusion of the package going forward (hence evolving versions over time), it really helps API discussions to pin them to a particular version. If discussion causes you to update a package, then the proposal discussion can "re-vector" to the new version. Please split discussion of particular proposals off from this thread. Lastly, just to be clear, the dates I set out are the dates by which I need proposals handled and decided in order to get the release out on schedule. The proposal process is not tied to releases, and can continue aysnc from release if any proposal needs time-extra. - Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Wed Aug 22 17:05:01 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Wed, 22 Aug 2012 08:05:01 -0700 Subject: Add binary and/or cereal to the Haskell Platform In-Reply-To: References: Message-ID: Hi all, On Wed, Aug 22, 2012 at 1:40 AM, Yitzchak Gale wrote: > I see that several years ago a proposal page was prepared > for adding the binary package to the Haskell Platform, > but it was never actually submitted as a proposal. > > http://trac.haskell.org/haskell-platform/wiki/Proposals/binary > > I think the reason it was not submitted was that things > were in flux at that time regarding the binary and cereal > packages. > > Now the situation has settled down. I think one or both > of those packages ought to be added to the platform. > Any opinions? As I've mentioned before [1] I think binary and cereal should be merged. They are almost identical and both the strict (cereal) and lazy (binary) runGet interfaces can coexist in the same API, implemented on top of runGetPartial. The only remaining issue I'm aware of is that Lennart tried implementing the current binary API using continuations and it was a bit tricky to maintain performance. Furthermore, I really think the Put and Get modules should be split, which implement encoding/decoding of base types in standardized encodings, should be split from the Binary/Cereal module, which implement a very specific and non-standardized (but still useful) format. Not not break any old code I suggest that the binary/cereal package will re-export this split off API (e.g. a new binary-encodings package). 1. http://blog.johantibell.com/2011/01/merging-binary-and-cereal.html -- Johan From gale at sefer.org Wed Aug 22 17:20:02 2012 From: gale at sefer.org (Yitzchak Gale) Date: Wed, 22 Aug 2012 18:20:02 +0300 Subject: Add binary and/or cereal to the Haskell Platform In-Reply-To: References: Message-ID: Hi Johan, Johan Tibell wrote: > As I've mentioned before [1] I think binary and cereal should be > merged.... [other proposed API improvements] > 1. http://blog.johantibell.com/2011/01/merging-binary-and-cereal.html Yes, those are great ideas. The thing is, nobody (myself included of course) has done anything about it for almost two years. Right now, binary and cereal are what they are. These are important packages that are popular dependencies. I observe empirically that their APIs are extremely stable. Unless there is new evidence that someone will work on them in the very near future and change the APIs significantly, I think they should go into the platform the way they are now. Or at least one of the two. I'd like to hear other opinions on that, though. Better yet - here's an easy chance for someone to step up, be a hero, and become famous. Thanks, Yitz From johan.tibell at gmail.com Wed Aug 22 18:29:57 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Wed, 22 Aug 2012 09:29:57 -0700 Subject: Add binary and/or cereal to the Haskell Platform In-Reply-To: References: Message-ID: On Wed, Aug 22, 2012 at 8:20 AM, Yitzchak Gale wrote: > Hi Johan, > > Johan Tibell wrote: >> As I've mentioned before [1] I think binary and cereal should be >> merged.... [other proposed API improvements] >> 1. http://blog.johantibell.com/2011/01/merging-binary-and-cereal.html > > Yes, those are great ideas. The thing is, nobody > (myself included of course) has done anything about > it for almost two years. Right now, binary and cereal > are what they are. These are important packages that > are popular dependencies. I observe empirically > that their APIs are extremely stable. Unless there is > new evidence that someone will work on them in the > very near future and change the APIs significantly, > I think they should go into the platform the way they > are now. Or at least one of the two. I agree with this sentiment. My current thinking is that perhaps it's better to leave both out. I don't feel too strongly about it though. If binary went in we might convince Lennart to finish and release his "cps" branch which should give binary incremental input capabilities. -- Johan From dons00 at gmail.com Wed Aug 22 19:26:55 2012 From: dons00 at gmail.com (Don Stewart) Date: Wed, 22 Aug 2012 11:26:55 -0600 Subject: Add binary and/or cereal to the Haskell Platform In-Reply-To: References: Message-ID: I'd say put the strict bs (cereal) and lazy bs (binary) in. On Wednesday, August 22, 2012, Johan Tibell wrote: > On Wed, Aug 22, 2012 at 8:20 AM, Yitzchak Gale > > wrote: > > Hi Johan, > > > > Johan Tibell wrote: > >> As I've mentioned before [1] I think binary and cereal should be > >> merged.... [other proposed API improvements] > >> 1. http://blog.johantibell.com/2011/01/merging-binary-and-cereal.html > > > > Yes, those are great ideas. The thing is, nobody > > (myself included of course) has done anything about > > it for almost two years. Right now, binary and cereal > > are what they are. These are important packages that > > are popular dependencies. I observe empirically > > that their APIs are extremely stable. Unless there is > > new evidence that someone will work on them in the > > very near future and change the APIs significantly, > > I think they should go into the platform the way they > > are now. Or at least one of the two. > > I agree with this sentiment. My current thinking is that perhaps it's > better to leave both out. I don't feel too strongly about it though. > If binary went in we might convince Lennart to finish and release his > "cps" branch which should give binary incremental input capabilities. > > -- Johan > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bos at serpentine.com Wed Aug 22 19:28:16 2012 From: bos at serpentine.com (Bryan O'Sullivan) Date: Wed, 22 Aug 2012 10:28:16 -0700 Subject: Add binary and/or cereal to the Haskell Platform In-Reply-To: References: Message-ID: On Wed, Aug 22, 2012 at 9:29 AM, Johan Tibell wrote: > My current thinking is that perhaps it's better to leave both out. > For me, a disincentive to accepting binary is that it doesn't provide a way for a Get to fail. I'd be more in favour of cereal for that reason. -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Wed Aug 22 19:33:17 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Wed, 22 Aug 2012 10:33:17 -0700 Subject: Add binary and/or cereal to the Haskell Platform In-Reply-To: References: Message-ID: On Wed, Aug 22, 2012 at 10:28 AM, Bryan O'Sullivan wrote: > On Wed, Aug 22, 2012 at 9:29 AM, Johan Tibell > wrote: >> >> My current thinking is that perhaps it's better to leave both out. > > > For me, a disincentive to accepting binary is that it doesn't provide a way > for a Get to fail. I'd be more in favour of cereal for that reason. I switched my latest in progress package to cereal for this reason, and because I needed to incrementally supply data while parsing. -- Johan From trevor at galois.com Wed Aug 22 22:53:57 2012 From: trevor at galois.com (Trevor Elliott) Date: Wed, 22 Aug 2012 13:53:57 -0700 Subject: Add binary and/or cereal to the Haskell Platform In-Reply-To: References: Message-ID: <503546E5.6010801@galois.com> This was the motivation for the initial work on cereal. I'd be happy to see cereal make it into the HP, and I do believe that it provides a different feature set than binary, but I worry that it's reaching feature parity with attoparsec. I'm not sure what to do in the long run for this, as the two are used in fairly different ways. Maybe cereal could eventually become some sort of presentation of attoparsec and one of the builder packages? --trevor On Wed 22 Aug 2012 10:33:17 AM PDT, Johan Tibell wrote: > On Wed, Aug 22, 2012 at 10:28 AM, Bryan O'Sullivan wrote: >> On Wed, Aug 22, 2012 at 9:29 AM, Johan Tibell >> wrote: >>> >>> My current thinking is that perhaps it's better to leave both out. >> >> >> For me, a disincentive to accepting binary is that it doesn't provide a way >> for a Get to fail. I'd be more in favour of cereal for that reason. > > I switched my latest in progress package to cereal for this reason, > and because I needed to incrementally supply data while parsing. > > -- Johan > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2311 bytes Desc: S/MIME Cryptographic Signature URL: From ian at well-typed.com Wed Aug 22 23:19:29 2012 From: ian at well-typed.com (Ian Lynagh) Date: Wed, 22 Aug 2012 22:19:29 +0100 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> References: <50141A01.2010707@ifi.lmu.de> <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> Message-ID: <20120822211929.GA1135@matrix.chaos.earth.li> On Mon, Aug 13, 2012 at 06:42:54PM -0400, Edward Kmett wrote: > > class Bits b where > perhapsBitSize :: b -> Maybe Int > ... > > I am not wedded to the perhapsBitSize name I've lost track of where this proposal is, but if we do end up with a Maybe function then I think it should be called maybeBitSize or bitSizeMaybe. The only analogous example in the core libraries that I can think of OTTOMH is Text.Read.readMaybe. Thanks IAn From johan.tibell at gmail.com Wed Aug 22 23:19:53 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Wed, 22 Aug 2012 14:19:53 -0700 Subject: Add binary and/or cereal to the Haskell Platform In-Reply-To: <503546E5.6010801@galois.com> References: <503546E5.6010801@galois.com> Message-ID: On Wed, Aug 22, 2012 at 1:53 PM, Trevor Elliott wrote: > This was the motivation for the initial work on cereal. I'd be happy to see > cereal make it into the HP, and I do believe that it provides a different > feature set than binary, but I worry that it's reaching feature parity with > attoparsec. I'm not sure what to do in the long run for this, as the two > are used in fairly different ways. Maybe cereal could eventually become > some sort of presentation of attoparsec and one of the builder packages? I think the builder should eventually end up being a thin wrapper around the new builder we're releasing in the next bytestring release (based on blaze-builder). From ekmett at gmail.com Thu Aug 23 01:49:49 2012 From: ekmett at gmail.com (Edward Kmett) Date: Wed, 22 Aug 2012 19:49:49 -0400 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: <20120822211929.GA1135@matrix.chaos.earth.li> References: <50141A01.2010707@ifi.lmu.de> <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> <20120822211929.GA1135@matrix.chaos.earth.li> Message-ID: To summarize the design we've converged upon during the discussion period for Ian: We want to add > class Bits b where > bitSizeMaybe :: b -> Maybe Int and deprecate, but not remove bitSize this iteration, and make a separate class FiniteBits for things with a finite, fixed number of bits: > class Bits b => FiniteBits b where > finiteBitSize :: b -> Int > finiteBitSize = bitSize The former permits safer access to bitSize while allowing applications that can deal with infinite structures to run, the latter permits safer access to bitSize while allowing applications that cannot deal with infinite structures to know that they aren't dealing with Integer or somebody's Natural data type. -Edward On Wed, Aug 22, 2012 at 5:19 PM, Ian Lynagh wrote: > On Mon, Aug 13, 2012 at 06:42:54PM -0400, Edward Kmett wrote: > > > > class Bits b where > > perhapsBitSize :: b -> Maybe Int > > ... > > > > I am not wedded to the perhapsBitSize name > > I've lost track of where this proposal is, but if we do end up with a > Maybe function then I think it should be called maybeBitSize or > bitSizeMaybe. The only analogous example in the core libraries that I > can think of OTTOMH is Text.Read.readMaybe. > > > Thanks > IAn > > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roconnor at theorem.ca Fri Aug 24 01:08:04 2012 From: roconnor at theorem.ca (roconnor at theorem.ca) Date: Thu, 23 Aug 2012 19:08:04 -0400 (EDT) Subject: Time to add the Traversable laws to the Documentation Message-ID: Based on recent work of Edward Kmett and myself and older work by Twan van Laarhoven, we have derived a set of laws for Traversable that are essentially the same to the Laws given by Jeremey Gibbons, Bruno Oliveria in "The Essence of the Iterator Pattern" and which are again the same as the laws given by Mauro Jaskelioff and Ondrej Rypacek in "An Investigation of the Laws of Traversals". With such wide spread agreement going back at least 6 years, I think it is time to add the following 2 laws to the documentation for Data.Traversable.Traversable. (1) traverse Identity == Identity (2) traverse (Compose . fmap g . f) == Compose . fmap (traverse g) . traverse f (and adding a link to the paper titled "An Investigation of the Laws of Traversals" is probably also worthwhile.) In some publications you will see law 1 written as traverse (Identity . f) == Identity . fmap f This is form is equivalent to law 1 by parametricity. Another alterantive formulation of law 1 is traverse pure == pure which is equivalent to law 1 by the Applicative typeclass parametricity. I can provide short proofs of these two equivalences on demand. Of these different formulations of law (1), I think "traverse Identity == Identity" is the nicest because it is concise, mirrors the analogous functor law, and Identity is the natural identity element for Compose. But more importantly, some choice of formal specification of the traversal laws needs to be added to the documentation. -- Russell O'Connor ``All talk about `theft,''' the general counsel of the American Graphophone Company wrote, ``is the merest claptrap, for there exists no property in ideas musical, literary or artistic, except as defined by statute.'' From ross at soi.city.ac.uk Fri Aug 24 02:53:59 2012 From: ross at soi.city.ac.uk (Ross Paterson) Date: Fri, 24 Aug 2012 01:53:59 +0100 Subject: Time to add the Traversable laws to the Documentation In-Reply-To: References: Message-ID: <20120824005359.GA14510@soi.city.ac.uk> On Fri, Aug 24, 2012 at 12:08:04AM +0100, roconnor at theorem.ca wrote: > With such wide spread agreement going back at least 6 years, I think it is > time to add the following 2 laws to the documentation for > Data.Traversable.Traversable. > > (1) traverse Identity == Identity > (2) traverse (Compose . fmap g . f) == Compose . fmap (traverse g) . traverse f Sounds good (except that Identity and Compose aren't defined in base). I guess you're assuming that the naturality property, i.e. (3) traverse (t . f) = t . traverse f for any Applicative transformation t, is automatic. Even so it would be useful to state it. From roconnor at theorem.ca Fri Aug 24 03:53:30 2012 From: roconnor at theorem.ca (roconnor at theorem.ca) Date: Thu, 23 Aug 2012 21:53:30 -0400 (EDT) Subject: Time to add the Traversable laws to the Documentation In-Reply-To: <20120824005359.GA14510@soi.city.ac.uk> References: <20120824005359.GA14510@soi.city.ac.uk> Message-ID: On Fri, 24 Aug 2012, Ross Paterson wrote: > On Fri, Aug 24, 2012 at 12:08:04AM +0100, roconnor at theorem.ca wrote: >> With such wide spread agreement going back at least 6 years, I think it is >> time to add the following 2 laws to the documentation for >> Data.Traversable.Traversable. >> >> (1) traverse Identity == Identity >> (2) traverse (Compose . fmap g . f) == Compose . fmap (traverse g) . traverse f > > Sounds good (except that Identity and Compose aren't defined in base). Er right. I'm not entirely sure how to address this issue. > I guess you're assuming that the naturality property, i.e. > > (3) traverse (t . f) = t . traverse f > > for any Applicative transformation t, is automatic. Even so it would > be useful to state it. Yes, I understand from Voigtlander's "Free theorems involving type constructor classes: functional pearl" that for fast and loose reasoning it is automatic. I agree that it would be good to state. If you want to follow the terminology from "Essence of the Iterator Pattern" of using "idiomatic" for adjectives, you would call t an "Idiomatic transformation". -- Russell O'Connor ``All talk about `theft,''' the general counsel of the American Graphophone Company wrote, ``is the merest claptrap, for there exists no property in ideas musical, literary or artistic, except as defined by statute.'' From haskell-oren at ben-kiki.org Fri Aug 24 11:12:55 2012 From: haskell-oren at ben-kiki.org (Oren Ben-Kiki) Date: Fri, 24 Aug 2012 12:12:55 +0300 Subject: Signature of Control.Monad when and unless Message-ID: I understand why the normal signature is: when :: Monad m => Bool -> m () -> m () unless :: Monad m => Bool -> m () -> m () But why isn't there also: when_ :: Monad m => Bool -> m a -> m () unless_ :: Monad m => Bool -> m a -> m () That is, I agree that results shouldn't be discarded "by default", but it should be easy to get rid of them if they are unneeded. Thanks, Oren Ben-Kiki -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.tetley at gmail.com Fri Aug 24 14:24:56 2012 From: stephen.tetley at gmail.com (Stephen Tetley) Date: Fri, 24 Aug 2012 13:24:56 +0100 Subject: Signature of Control.Monad when and unless In-Reply-To: References: Message-ID: Hasn't `void` recently been added to Base so that you can discard the result of any monadic action? > when True (void actionWithAnswer) On 24 August 2012 10:12, Oren Ben-Kiki wrote: [CUT] > > That is, I agree that results shouldn't be discarded "by default", but it > should be easy to get rid of them if they are unneeded. From ivan.miljenovic at gmail.com Fri Aug 24 14:48:28 2012 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Fri, 24 Aug 2012 22:48:28 +1000 Subject: Signature of Control.Monad when and unless In-Reply-To: References: Message-ID: On 24 August 2012 22:24, Stephen Tetley wrote: > Hasn't `void` recently been added to Base so that you can discard the > result of any monadic action? > >> when True (void actionWithAnswer) I also recall a similar discussion within the past six months on this topic, though I'm having difficulty finding it either online or in my emails :/ I believe the consensus of the previous discussion was that having functions such as your stated when_ and unless_ are dangerous in the general case due to the discarded results being implicitly ignored (same as how GHC nowadays throws warnings when statements in a do-block aren't of type m () ). > > > On 24 August 2012 10:12, Oren Ben-Kiki wrote: > [CUT] > >> >> That is, I agree that results shouldn't be discarded "by default", but it >> should be easy to get rid of them if they are unneeded. > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From leather at cs.uu.nl Fri Aug 24 14:54:46 2012 From: leather at cs.uu.nl (Sean Leather) Date: Fri, 24 Aug 2012 14:54:46 +0200 Subject: Signature of Control.Monad when and unless In-Reply-To: References: Message-ID: On Fri, Aug 24, 2012 at 2:48 PM, Ivan Lazar Miljenovic wrote: > On 24 August 2012 22:24, Stephen Tetley wrote: > > Hasn't `void` recently been added to Base so that you can discard the > > result of any monadic action? > > > >> when True (void actionWithAnswer) > > I also recall a similar discussion within the past six months on this > topic, though I'm having difficulty finding it either online or in my > emails :/ > It started in April. The thread is split between haskell@ and libraries@: http://www.haskell.org/pipermail/haskell/2012-April/date.html#23276 http://www.haskell.org/pipermail/libraries/2012-April/date.html#17722 Regards, Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From ekmett at gmail.com Fri Aug 24 15:22:13 2012 From: ekmett at gmail.com (Edward Kmett) Date: Fri, 24 Aug 2012 09:22:13 -0400 Subject: Signature of Control.Monad when and unless In-Reply-To: References: Message-ID: Personally, I would really like to see these added. Alas, I missed the discussion the first time around, and I'm afraid if I tried to raise the issue again the safety police will go through and actively remove the 'a's from the remaining useful combinators I still have. ;) I do find it particularly obnoxious that I have to round trip through the monad transformer stack just to rip off a type argument when couldn't use if it wanted to in the first place. Moreover, the 'void' type that actually wound up implemented doesn't help at all if you only know you have a Monad and don't have the additional Functor, (e.g. are writing a monad transformer), so even though void exists you wind up having to use 'do x <- ...; return ()' in most library code anyways. -Edward On Fri, Aug 24, 2012 at 5:12 AM, Oren Ben-Kiki wrote: > I understand why the normal signature is: > > when :: Monad m => Bool -> m () -> m () > unless :: Monad m => Bool -> m () -> m () > > But why isn't there also: > > when_ :: Monad m => Bool -> m a -> m () > unless_ :: Monad m => Bool -> m a -> m () > > That is, I agree that results shouldn't be discarded "by default", but it > should be easy to get rid of them if they are unneeded. > > Thanks, > > Oren Ben-Kiki > > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ross at soi.city.ac.uk Sat Aug 25 12:47:34 2012 From: ross at soi.city.ac.uk (Ross Paterson) Date: Sat, 25 Aug 2012 11:47:34 +0100 Subject: Time to add the Traversable laws to the Documentation In-Reply-To: References: <20120824005359.GA14510@soi.city.ac.uk> Message-ID: <20120825104734.GA3361@soi.city.ac.uk> On Fri, Aug 24, 2012 at 02:53:30AM +0100, roconnor at theorem.ca wrote: > On Fri, 24 Aug 2012, Ross Paterson wrote: > > > On Fri, Aug 24, 2012 at 12:08:04AM +0100, roconnor at theorem.ca wrote: > >> With such wide spread agreement going back at least 6 years, I think it is > >> time to add the following 2 laws to the documentation for > >> Data.Traversable.Traversable. > >> > >> (1) traverse Identity == Identity > >> (2) traverse (Compose . fmap g . f) == Compose . fmap (traverse g) . traverse f > > > > Sounds good (except that Identity and Compose aren't defined in base). > > Er right. I'm not entirely sure how to address this issue. There doesn't seem to be any alternative to re-iterating the newtype definitions and the Functor and Applicative instances in the doc comment. > If you want to follow the terminology from "Essence of the Iterator > Pattern" of using "idiomatic" for adjectives, you would call t an > "Idiomatic transformation". Noooo, please don't do that. The transformations should match the functors, and the adjective "applicative" at least has a grain of relevant meaning. From roconnor at theorem.ca Sat Aug 25 18:15:27 2012 From: roconnor at theorem.ca (roconnor at theorem.ca) Date: Sat, 25 Aug 2012 12:15:27 -0400 (EDT) Subject: Time to add the Traversable laws to the Documentation In-Reply-To: <20120825104734.GA3361@soi.city.ac.uk> References: <20120824005359.GA14510@soi.city.ac.uk> <20120825104734.GA3361@soi.city.ac.uk> Message-ID: On Sat, 25 Aug 2012, Ross Paterson wrote: > On Fri, Aug 24, 2012 at 02:53:30AM +0100, roconnor at theorem.ca wrote: >> On Fri, 24 Aug 2012, Ross Paterson wrote: >> >>> On Fri, Aug 24, 2012 at 12:08:04AM +0100, roconnor at theorem.ca wrote: >>>> With such wide spread agreement going back at least 6 years, I think it is >>>> time to add the following 2 laws to the documentation for >>>> Data.Traversable.Traversable. >>>> >>>> (1) traverse Identity == Identity >>>> (2) traverse (Compose . fmap g . f) == Compose . fmap (traverse g) . traverse f >>> >>> Sounds good (except that Identity and Compose aren't defined in base). >> >> Er right. I'm not entirely sure how to address this issue. > > There doesn't seem to be any alternative to re-iterating the newtype > definitions and the Functor and Applicative instances in the doc comment. The only alternative I can think of would be to move the Idenity and Compose functors from transformers into base. The consequences of this would be massive. I don't really suggest doing this at this time. >> If you want to follow the terminology from "Essence of the Iterator >> Pattern" of using "idiomatic" for adjectives, you would call t an >> "Idiomatic transformation". > > Noooo, please don't do that. The transformations should match the > functors, and the adjective "applicative" at least has a grain of > relevant meaning. Okay. -- Russell O'Connor ``All talk about `theft,''' the general counsel of the American Graphophone Company wrote, ``is the merest claptrap, for there exists no property in ideas musical, literary or artistic, except as defined by statute.'' From andreas.abel at ifi.lmu.de Sun Aug 26 11:50:39 2012 From: andreas.abel at ifi.lmu.de (Andreas Abel) Date: Sun, 26 Aug 2012 11:50:39 +0200 Subject: Signature of Control.Monad when and unless In-Reply-To: References: Message-ID: <5039F16F.2030509@ifi.lmu.de> On 24.08.12 3:22 PM, Edward Kmett wrote: > Personally, I would really like to see these added. +1 > Alas, I missed the discussion the first time around, and I'm afraid if I > tried to raise the issue again the safety police will go through and > actively remove the 'a's from the remaining useful combinators I still > have. ;) In the mentioned discussion, I proposed to generalize the types of when and unless to when :: Monad m => Bool -> m a -> m () unless :: Monad m => Bool -> m a -> m () which amounts to implement e.g. when by when True m = m >> return () when False m = return () My proposal triggered an outcry by the `safety community' and I dropped it. It seems that adding when_ and unless_ seems to be a compromise everyone can live with. Cheers, Andreas > I do find it particularly obnoxious that I have to round trip through > the monad transformer stack just to rip off a type argument when > couldn't use if it wanted to in the first place. > > Moreover, the 'void' type that actually wound up implemented doesn't > help at all if you only know you have a Monad and don't have the > additional Functor, (e.g. are writing a monad transformer), so even > though void exists you wind up having to use 'do x <- ...; return > ()' in most library code anyways. > > -Edward > > On Fri, Aug 24, 2012 at 5:12 AM, Oren Ben-Kiki > > wrote: > > I understand why the normal signature is: > > when :: Monad m => Bool -> m () -> m () > unless :: Monad m => Bool -> m () -> m () > > But why isn't there also: > > when_ :: Monad m => Bool -> m a -> m () > unless_ :: Monad m => Bool -> m a -> m () > > That is, I agree that results shouldn't be discarded "by default", > but it should be easy to get rid of them if they are unneeded. > > Thanks, > > Oren Ben-Kiki -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.abel at ifi.lmu.de http://www2.tcs.ifi.lmu.de/~abel/ From igloo at earth.li Sun Aug 26 22:38:41 2012 From: igloo at earth.li (Ian Lynagh) Date: Sun, 26 Aug 2012 21:38:41 +0100 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> <20120822211929.GA1135@matrix.chaos.earth.li> Message-ID: <20120826203841.GA16095@matrix.chaos.earth.li> On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote: > > deprecate, but not remove bitSize this iteration, and make a separate > class FiniteBits for things with a finite, fixed number of bits: > > > class Bits b => FiniteBits b where > > finiteBitSize :: b -> Int > > finiteBitSize = bitSize Isn't giving that default implementation a bad idea? Any instance that uses it wiill just break when the deprecated bitSize is removed. Thanks Ian From lemming at henning-thielemann.de Sun Aug 26 22:53:56 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sun, 26 Aug 2012 22:53:56 +0200 (CEST) Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: <20120826203841.GA16095@matrix.chaos.earth.li> References: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> <20120822211929.GA1135@matrix.chaos.earth.li> <20120826203841.GA16095@matrix.chaos.earth.li> Message-ID: On Sun, 26 Aug 2012, Ian Lynagh wrote: > On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote: >> >> deprecate, but not remove bitSize this iteration, and make a separate >> class FiniteBits for things with a finite, fixed number of bits: >> >>> class Bits b => FiniteBits b where >>> finiteBitSize :: b -> Int >>> finiteBitSize = bitSize Bit size is always finite in strict data types, isn't it? I suggest a name containing "Fixed". From ekmett at gmail.com Mon Aug 27 17:21:25 2012 From: ekmett at gmail.com (Edward Kmett) Date: Mon, 27 Aug 2012 11:21:25 -0400 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: <20120826203841.GA16095@matrix.chaos.earth.li> References: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> <20120822211929.GA1135@matrix.chaos.earth.li> <20120826203841.GA16095@matrix.chaos.earth.li> Message-ID: Fair enough. Sent from my iPhone On Aug 26, 2012, at 4:38 PM, Ian Lynagh wrote: > On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote: >> >> deprecate, but not remove bitSize this iteration, and make a separate >> class FiniteBits for things with a finite, fixed number of bits: >> >>> class Bits b => FiniteBits b where >>> finiteBitSize :: b -> Int >>> finiteBitSize = bitSize > > Isn't giving that default implementation a bad idea? Any instance that > uses it wiill just break when the deprecated bitSize is removed. > > > Thanks > Ian > > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries From ekmett at gmail.com Mon Aug 27 17:22:23 2012 From: ekmett at gmail.com (Edward Kmett) Date: Mon, 27 Aug 2012 11:22:23 -0400 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> <20120822211929.GA1135@matrix.chaos.earth.li> <20120826203841.GA16095@matrix.chaos.earth.li> Message-ID: <2BB80026-EC0E-4BC7-A35B-7DCBF18AC312@gmail.com> FixedBits? Sent from my iPhone On Aug 26, 2012, at 4:53 PM, Henning Thielemann wrote: > > On Sun, 26 Aug 2012, Ian Lynagh wrote: > >> On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote: >>> >>> deprecate, but not remove bitSize this iteration, and make a separate >>> class FiniteBits for things with a finite, fixed number of bits: >>> >>>> class Bits b => FiniteBits b where >>>> finiteBitSize :: b -> Int >>>> finiteBitSize = bitSize > > > Bit size is always finite in strict data types, isn't it? I suggest a name containing "Fixed". > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries From simonpj at microsoft.com Tue Aug 28 11:26:10 2012 From: simonpj at microsoft.com (Simon Peyton-Jones) Date: Tue, 28 Aug 2012 09:26:10 +0000 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> Message-ID: <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> Mark, and HP folk, Geoff, Simon M, and I have just realised that ? vector (which we would like to be included in HP) depends on primitive ? And primitive is a Terrible Name for a package. Really unacceptably bad. If you look at what?s in primitive it has a bunch of fairly simple wrappers round basic types: ? Data.Primitive.Array defined (another) Array type, wrapping Array#. But it?s not the same as the Array type in Data.Array ? There?s an Addr type, which is like the Foreign.Ptr type, but un-parameterised. ? There?s a ByteArray type, wrapping Array# ? There?s a Prim class, with operations like sizeOf#, alignment#, and so on. Roman is the maintainer. Roman, are you happy to be in that position? What should we do about this? There has been NO discussion of this API. Possibilities ? Adopt the package with a new name, like vector-prim or vector-internal, implying that it?s for people doing vector-stuff, rather than for end users. (And say that in the docs.) ? Absorb it into the vector package, which is currently its only client (we think). ? Absorb it into the base package. But we are generally trying to reduce base not increase it. We don?t have a strong opinion, except that baking a package into HP called simply ?primitive? seems Wrong. Very sorry for not bringing this up before... only just realised Simon From: haskell-platform-bounces at projects.haskell.org [mailto:haskell-platform-bounces at projects.haskell.org] On Behalf Of Mark Lentczner Sent: 22 August 2012 15:33 To: haskell-platform at projects.haskell.org; Haskell Libraries Subject: Re: HP 2012.4.0.0 -- Call for Proposals Thank you, Yitz, for the wiki maintenance! vector and time-extras - these should be updated by the proposers as they have been "reproposed" async, vector, and time-extras - I think these all need to be updated to reflect the current discussion period. While required by the process, I'd urge proposers to link to the specific version of the package under consideration. While the proposal is for inclusion of the package going forward (hence evolving versions over time), it really helps API discussions to pin them to a particular version. If discussion causes you to update a package, then the proposal discussion can "re-vector" to the new version. Please split discussion of particular proposals off from this thread. Lastly, just to be clear, the dates I set out are the dates by which I need proposals handled and decided in order to get the release out on schedule. The proposal process is not tied to releases, and can continue aysnc from release if any proposal needs time-extra. - Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Tue Aug 28 11:31:05 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue, 28 Aug 2012 11:31:05 +0200 (CEST) Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> Message-ID: On Tue, 28 Aug 2012, Simon Peyton-Jones wrote: > What should we do about this?? There has been NO discussion of this API.? Possibilities > > ????????? Adopt the package with a new name, like vector-prim or vector-internal, implying that it?s for > people doing vector-stuff, rather than for end users.? (And say that in the docs.) +1 > ????????? Absorb it into the vector package, which is currently its only client (we think). -1 because I think it could be useful for alternative packages (like storablevector, but it does not use 'primitive' currently) > ????????? Absorb it into the base package.? But we are generally trying to reduce base not increase it. -1 From ivan.miljenovic at gmail.com Tue Aug 28 12:07:25 2012 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Tue, 28 Aug 2012 20:07:25 +1000 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> Message-ID: On 28 August 2012 19:26, Simon Peyton-Jones wrote: > Mark, and HP folk, > > > > Geoff, Simon M, and I have just realised that > > ? vector (which we would like to be included in HP) depends on > primitive > > ? And primitive is a Terrible Name for a package. Really > unacceptably bad. > > > > If you look at what?s in primitive it has a bunch of fairly simple wrappers > round basic types: > > ? Data.Primitive.Array defined (another) Array type, wrapping > Array#. But it?s not the same as the Array type in Data.Array > > ? There?s an Addr type, which is like the Foreign.Ptr type, but > un-parameterised. > > ? There?s a ByteArray type, wrapping Array# > > ? There?s a Prim class, with operations like sizeOf#, alignment#, > and so on. > > > > Roman is the maintainer. Roman, are you happy to be in that position? > > > > What should we do about this? There has been NO discussion of this API. > Possibilities > > ? Adopt the package with a new name, like vector-prim or > vector-internal, implying that it?s for people doing vector-stuff, rather > than for end users. (And say that in the docs.) There are quite a few packages that seem to use primitive: http://packdeps.haskellers.com/reverse/primitive Admittedly, my quick sample of those packages makes it seem like they only use primitive _for_ dealing with vector (as in all the packages I looked at also had vector as a dep). > > ? Absorb it into the vector package, which is currently its only > client (we think). > > ? Absorb it into the base package. But we are generally trying to > reduce base not increase it. > > > > We don?t have a strong opinion, except that baking a package into HP called > simply ?primitive? seems Wrong. > > > > Very sorry for not bringing this up before... only just realised > > > > Simon > > > > From: haskell-platform-bounces at projects.haskell.org > [mailto:haskell-platform-bounces at projects.haskell.org] On Behalf Of Mark > Lentczner > Sent: 22 August 2012 15:33 > To: haskell-platform at projects.haskell.org; Haskell Libraries > Subject: Re: HP 2012.4.0.0 -- Call for Proposals > > > > Thank you, Yitz, for the wiki maintenance! > > > > vector and time-extras - these should be updated by the proposers as they > have been "reproposed" > > async, vector, and time-extras - I think these all need to be updated to > reflect the current discussion period. > > > > While required by the process, I'd urge proposers to link to the specific > version of the package under consideration. While the proposal is for > inclusion of the package going forward (hence evolving versions over time), > it really helps API discussions to pin them to a particular version. If > discussion causes you to update a package, then the proposal discussion can > "re-vector" to the new version. > > > > Please split discussion of particular proposals off from this thread. > > > > Lastly, just to be clear, the dates I set out are the dates by which I need > proposals handled and decided in order to get the release out on schedule. > The proposal process is not tied to releases, and can continue aysnc from > release if any proposal needs time-extra. > > > > - Mark > > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From simonpj at microsoft.com Tue Aug 28 12:41:55 2012 From: simonpj at microsoft.com (Simon Peyton-Jones) Date: Tue, 28 Aug 2012 10:41:55 +0000 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> Message-ID: <59543203684B2244980D7E4057D5FBC13799FB09@DB3EX14MBXC312.europe.corp.microsoft.com> PS: One other point ? If we adopt primitive (perhaps with a new name), can we get rid of any stuff in base? From: haskell-platform-bounces at projects.haskell.org [mailto:haskell-platform-bounces at projects.haskell.org] On Behalf Of Simon Peyton-Jones Sent: 28 August 2012 10:26 To: Mark Lentczner; haskell-platform at projects.haskell.org; Haskell Libraries Cc: Geoffrey Mainland; Manuel Chakravarty; Roman Leshchinskiy; Ben Lippmeier (benl at ouroborus.net) Subject: RE: HP 2012.4.0.0 -- Call for Proposals Mark, and HP folk, Geoff, Simon M, and I have just realised that ? vector (which we would like to be included in HP) depends on primitive ? And primitive is a Terrible Name for a package. Really unacceptably bad. If you look at what?s in primitive it has a bunch of fairly simple wrappers round basic types: ? Data.Primitive.Array defined (another) Array type, wrapping Array#. But it?s not the same as the Array type in Data.Array ? There?s an Addr type, which is like the Foreign.Ptr type, but un-parameterised. ? There?s a ByteArray type, wrapping Array# ? There?s a Prim class, with operations like sizeOf#, alignment#, and so on. Roman is the maintainer. Roman, are you happy to be in that position? What should we do about this? There has been NO discussion of this API. Possibilities ? Adopt the package with a new name, like vector-prim or vector-internal, implying that it?s for people doing vector-stuff, rather than for end users. (And say that in the docs.) ? Absorb it into the vector package, which is currently its only client (we think). ? Absorb it into the base package. But we are generally trying to reduce base not increase it. We don?t have a strong opinion, except that baking a package into HP called simply ?primitive? seems Wrong. Very sorry for not bringing this up before... only just realised Simon From: haskell-platform-bounces at projects.haskell.org [mailto:haskell-platform-bounces at projects.haskell.org] On Behalf Of Mark Lentczner Sent: 22 August 2012 15:33 To: haskell-platform at projects.haskell.org; Haskell Libraries Subject: Re: HP 2012.4.0.0 -- Call for Proposals Thank you, Yitz, for the wiki maintenance! vector and time-extras - these should be updated by the proposers as they have been "reproposed" async, vector, and time-extras - I think these all need to be updated to reflect the current discussion period. While required by the process, I'd urge proposers to link to the specific version of the package under consideration. While the proposal is for inclusion of the package going forward (hence evolving versions over time), it really helps API discussions to pin them to a particular version. If discussion causes you to update a package, then the proposal discussion can "re-vector" to the new version. Please split discussion of particular proposals off from this thread. Lastly, just to be clear, the dates I set out are the dates by which I need proposals handled and decided in order to get the release out on schedule. The proposal process is not tied to releases, and can continue aysnc from release if any proposal needs time-extra. - Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg at gregorycollins.net Tue Aug 28 14:06:32 2012 From: greg at gregorycollins.net (Gregory Collins) Date: Tue, 28 Aug 2012 14:06:32 +0200 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> Message-ID: On Tue, Aug 28, 2012 at 12:07 PM, Ivan Lazar Miljenovic < ivan.miljenovic at gmail.com> wrote: > On 28 August 2012 19:26, Simon Peyton-Jones > wrote:Admittedly, my quick sample of those packages makes it seem like they > only use primitive _for_ dealing with vector (as in all the packages I > looked at also had vector as a dep). > I use primitive for its MutableArray directly inside the hashtables package if the bounds checking is turned off (the default): https://github.com/gregorycollins/hashtables/blob/master/src/Data/HashTable/Internal/Array.hs, and also for MutableByteArray: https://github.com/gregorycollins/hashtables/blob/master/src/Data/HashTable/Internal/IntArray.hs The types from primitive have less overhead than vector, which is important for some of my use cases. G -- Gregory Collins -------------- next part -------------- An HTML attachment was scrubbed... URL: From haskell at benmachine.co.uk Tue Aug 28 18:07:44 2012 From: haskell at benmachine.co.uk (Ben Millwood) Date: Tue, 28 Aug 2012 17:07:44 +0100 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> <20120822211929.GA1135@matrix.chaos.earth.li> <20120826203841.GA16095@matrix.chaos.earth.li> Message-ID: Wouldn't it be possible to have an instance Bits ByteString, or Vector Bool or something, where the bitsize would depend on the bytestring length, and hence wouldn't be fixed? (although if we're catering for that sort of use, the docs will need to be changed) On Sun, Aug 26, 2012 at 9:53 PM, Henning Thielemann wrote: > > On Sun, 26 Aug 2012, Ian Lynagh wrote: > >> On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote: >>> >>> >>> deprecate, but not remove bitSize this iteration, and make a separate >>> class FiniteBits for things with a finite, fixed number of bits: >>> >>>> class Bits b => FiniteBits b where >>>> finiteBitSize :: b -> Int >>>> finiteBitSize = bitSize > > > > Bit size is always finite in strict data types, isn't it? I suggest a name > containing "Fixed". > > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries From thomas.dubuisson at gmail.com Tue Aug 28 18:18:34 2012 From: thomas.dubuisson at gmail.com (Thomas DuBuisson) Date: Tue, 28 Aug 2012 09:18:34 -0700 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> <20120822211929.GA1135@matrix.chaos.earth.li> <20120826203841.GA16095@matrix.chaos.earth.li> Message-ID: On Tue, Aug 28, 2012 at 9:07 AM, Ben Millwood wrote: > Wouldn't it be possible to have an instance Bits ByteString, or Vector > Bool or something, where the bitsize would depend on the bytestring > length, and hence wouldn't be fixed? You mean like NumLazyByteString [1]? Not only possible but its done at least once (poorly) and deprecated. [1] hackage.haskell.org/packages/archive/NumLazyByteString/0.0.0.1/doc/html/src/Data-ByteString-Lazy-Num.html > > (although if we're catering for that sort of use, the docs will need > to be changed) > > On Sun, Aug 26, 2012 at 9:53 PM, Henning Thielemann > wrote: >> >> On Sun, 26 Aug 2012, Ian Lynagh wrote: >> >>> On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote: >>>> >>>> >>>> deprecate, but not remove bitSize this iteration, and make a separate >>>> class FiniteBits for things with a finite, fixed number of bits: >>>> >>>>> class Bits b => FiniteBits b where >>>>> finiteBitSize :: b -> Int >>>>> finiteBitSize = bitSize >> >> >> >> Bit size is always finite in strict data types, isn't it? I suggest a name >> containing "Fixed". >> >> >> _______________________________________________ >> Libraries mailing list >> Libraries at haskell.org >> http://www.haskell.org/mailman/listinfo/libraries > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries From ekmett at gmail.com Tue Aug 28 19:18:24 2012 From: ekmett at gmail.com (Edward Kmett) Date: Tue, 28 Aug 2012 13:18:24 -0400 Subject: Proposal: Add hasBitSize to Data.Bits.Bits In-Reply-To: References: <0C6F0EF7-1A9F-4E4D-A49F-E0D2A4B72FD6@gmail.com> <20120822211929.GA1135@matrix.chaos.earth.li> <20120826203841.GA16095@matrix.chaos.earth.li> Message-ID: The problem is that right now bitSize is deliberately excluded from looking at its argument to determine the number of bits in it. You _really_ want a different combinator. Almost every user of bitSize is passing it undefined, not a real value. On Tue, Aug 28, 2012 at 12:07 PM, Ben Millwood wrote: > Wouldn't it be possible to have an instance Bits ByteString, or Vector > Bool or something, where the bitsize would depend on the bytestring > length, and hence wouldn't be fixed? > > (although if we're catering for that sort of use, the docs will need > to be changed) > > On Sun, Aug 26, 2012 at 9:53 PM, Henning Thielemann > wrote: > > > > On Sun, 26 Aug 2012, Ian Lynagh wrote: > > > >> On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote: > >>> > >>> > >>> deprecate, but not remove bitSize this iteration, and make a separate > >>> class FiniteBits for things with a finite, fixed number of bits: > >>> > >>>> class Bits b => FiniteBits b where > >>>> finiteBitSize :: b -> Int > >>>> finiteBitSize = bitSize > > > > > > > > Bit size is always finite in strict data types, isn't it? I suggest a > name > > containing "Fixed". > > > > > > _______________________________________________ > > Libraries mailing list > > Libraries at haskell.org > > http://www.haskell.org/mailman/listinfo/libraries > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rl at cse.unsw.edu.au Tue Aug 28 21:58:15 2012 From: rl at cse.unsw.edu.au (Roman Leshchinskiy) Date: Tue, 28 Aug 2012 20:58:15 +0100 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> Message-ID: <125D31BE-384C-4A34-BB30-7D85050DFBEB@cse.unsw.edu.au> On 28/08/2012, at 10:26, Simon Peyton-Jones wrote: > Geoff, Simon M, and I have just realised that > ? vector (which we would like to be included in HP) depends on primitive > ? And primitive is a Terrible Name for a package. Really unacceptably bad. Hmm, I'm not sure I agree :-) Could you please explain why it's so terrible? It provides wrappers around (mostly) GHC primitives which aren't exposed elsewhere in an easily usable manner. I find it quite useful and really, primitive seemed like the most logical name for this, especially since it started out as a wrapper around ghc-prim (which, I assume, is an abbreviation for "GHC's primitive package"). I'm not really sure why it is worse than, say, binary. Or vector, for that matter. > If you look at what?s in primitive it has a bunch of fairly simple wrappers round basic types: > ? Data.Primitive.Array defined (another) Array type, wrapping Array#. But it?s not the same as the Array type in Data.Array No, because Data.Array is much more heavy weight among other things. > ? There?s an Addr type, which is like the Foreign.Ptr type, but un-parameterised. > ? There?s a ByteArray type, wrapping Array# Nitpick: ByteArray#, not Array#. > ? There?s a Prim class, with operations like sizeOf#, alignment#, and so on. Actually, the main operations on Prim are readByteArray, writeByteArray, indexByteArray and similar operations on Addr. The methods typically won't be called directly and are only exported so that new instances can be defined. The reason for having sizeOf# rather than sizeOf as a method is to avoid boxing in generic code but sizeOf is what end-user code should use typically. There are also wrappers for MutVar#, a generic interface to ST and IO, the MachDeps module and a few other things. It will grow in the future. > Roman is the maintainer. Roman, are you happy to be in that position? Yes, of course. > What should we do about this? There has been NO discussion of this API. Possibilities As an aside, there has been no real discussion of vector, either, which makes me rather sad. I don't use the platform but I thought that if vector is proposed/included, I would get a review of the API and, hopefully, suggestions how to improve it which would be more than worth the additional work. > ? Adopt the package with a new name, like vector-prim or vector-internal, implying that it?s for people doing vector-stuff, rather than for end users. (And say that in the docs.) It is actually for end users rather than for people doing vector stuff which is why it's a separate package. So I wouldn't want to do this. > ? Absorb it into the vector package, which is currently its only client (we think). Definitely not this. I had what I consider good reasons for making it a separate package when I implemented it. Also, vector is not the only client AFAIK. > ? Absorb it into the base package. But we are generally trying to reduce base not increase it. Nor this, really. In any case, if a lot of people really want to rename it I'd be ok with that provided I like the new name but frankly, I don't really see the point. The package is 3 years old and this is the first time anybody has complained about the name. If it is to be renamed, though, then I would really find it useful to have agreed upon guidelines on what constitutes a Terrible Name so that I can try to avoid picking one in the future. Roman From duncan.coutts at googlemail.com Tue Aug 28 22:43:13 2012 From: duncan.coutts at googlemail.com (Duncan Coutts) Date: Tue, 28 Aug 2012 21:43:13 +0100 Subject: Proposal: unsnoc, unsafeInit and unsafeLast for the bytestring library In-Reply-To: <4F7B0DB6.7040006@gmail.com> References: <4F79748E.20201@gmail.com> <4F7B0DB6.7040006@gmail.com> Message-ID: <1346186593.20025.83.camel@dunky.localdomain> On Tue, 2012-04-03 at 21:48 +0700, Mikhail Vorozhtsov wrote: > On 04/03/2012 08:50 PM, Simon Meier wrote: > > 2012/4/3 Duncan Coutts: > [snip] > > @mikkhail: Note that at least the runtime for > > Data.ByteString.Lazy.Char8 is wrong. It should be O(n/c) instead of > > O(1). > Fixed. Ok, I've applied this but with a simpler implementation of unsnoc for lazy bytestrings. The proposed implementation tries to work using a single traversal of the list of chunks, but it doesn't actually achieve this since it builds a chain of closures that's equivalent to the list of chunks. Doing it by accumulating and reversing would be equivalent. Given that we cannot actually avoid making two traversals I've gone for the simplest implementation: just call init and last. Duncan From johan.tibell at gmail.com Tue Aug 28 22:43:48 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Tue, 28 Aug 2012 13:43:48 -0700 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> Message-ID: On Tue, Aug 28, 2012 at 2:26 AM, Simon Peyton-Jones wrote: > ? Absorb it into the vector package, which is currently its only > client (we think). We definitely need a library like primitive to share code among other libraries. I think that package might as well be primitive. To my knowledge there are at least three, nearly-identical wrappers of the GHC array primops: one primitive (used by vector), one in text, and one in unordered-containers. The reason that these libraries cannot use the array or bytestring libraries as wrappers over Array# and ByteArray# is that design trade-offs made in these two libraries are not always what you want: * Arrays are too big and use a (relatively) inefficient indexing scheme. * ByteStrings are too big and also have a somewhat inefficient indexing schemes. They're also pinned. -- Johan From igloo at earth.li Tue Aug 28 23:08:33 2012 From: igloo at earth.li (Ian Lynagh) Date: Tue, 28 Aug 2012 22:08:33 +0100 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <125D31BE-384C-4A34-BB30-7D85050DFBEB@cse.unsw.edu.au> References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> <125D31BE-384C-4A34-BB30-7D85050DFBEB@cse.unsw.edu.au> Message-ID: <20120828210833.GA5175@matrix.chaos.earth.li> On Tue, Aug 28, 2012 at 08:58:15PM +0100, Roman Leshchinskiy wrote: > On 28/08/2012, at 10:26, Simon Peyton-Jones wrote: > > > Geoff, Simon M, and I have just realised that > > ? vector (which we would like to be included in HP) depends on primitive > > ? And primitive is a Terrible Name for a package. Really unacceptably bad. > > Hmm, I'm not sure I agree :-) > > Could you please explain why it's so terrible? I can't speak for Simon, but I've always thought it overly-generic. Given the description starts "This package provides wrappers for primitive array operations from GHC.Prim." and that it was (AIUI) created as a base upon which to build 'vector', I would suggest that one of array-primitive primitive-array vector-primitive primitive-vector would be a better name. I don't know enough about it to know whether 'array' or 'primitive' would be better, and I don't know if there is precedent for whether 'primitive' should come first or last. > I'm not really sure why it is worse than, say, binary. Or vector, for > that matter. Hopefully, binary and vector are the obvious, natural APIs for their tasks. If vector only supported vectors or Ints, for example, then I think that it ought to be renamed int-vector. But seeing as it has a "Vector a" type, and offers the expected functions such as map :: (a -> b) -> Vector a -> Vector b the name appears appropriate to me (at least, based on a very cursory look). > In any case, if a lot of people really want to rename it I'd be ok with that provided I like the new name but frankly, I don't really see the point. The package is 3 years old and this is the first time anybody has complained about the name. No-one asked me before :-) Actually, I did suggest having admins approve new package names when Hackage was first created, but the people doing the work didn't think it would be a problem. And to be fair, the handful of times I know of a naming issue being raised, I think the maintainer has been happy (or at least willing) to rename. > If it is to be renamed, though, then I would really find it useful to > have agreed upon guidelines on what constitutes a Terrible Name so > that I can try to avoid picking one in the future. It would very much have to be a guideline as opposed to a rule, but I'd suggest something like: A package should not use a descriptive name that another package might be equally- or more-deserving-of. Thanks Ian From rl at cse.unsw.edu.au Wed Aug 29 09:56:59 2012 From: rl at cse.unsw.edu.au (Roman Leshchinskiy) Date: Wed, 29 Aug 2012 08:56:59 +0100 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <20120828210833.GA5175@matrix.chaos.earth.li> References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> <125D31BE-384C-4A34-BB30-7D85050DFBEB@cse.unsw.edu.au> <20120828210833.GA5175@matrix.chaos.earth.li> Message-ID: Ian Lynagh wrote: > On Tue, Aug 28, 2012 at 08:58:15PM +0100, Roman Leshchinskiy wrote: >> On 28/08/2012, at 10:26, Simon Peyton-Jones wrote: >> >> > Geoff, Simon M, and I have just realised that >> > ? vector (which we would like to be included in HP) depends on >> primitive >> > ? And primitive is a Terrible Name for a package. Really >> unacceptably bad. >> >> Hmm, I'm not sure I agree :-) >> >> Could you please explain why it's so terrible? > > I can't speak for Simon, but I've always thought it overly-generic. > > Given the description starts "This package provides wrappers for > primitive array operations from GHC.Prim." Yes, this description is quite outdated. Thanks for bringing it to my attention! > and that it was (AIUI) > created as a base upon which to build 'vector', I'm really not sure where this impression comes from. Vector isn't even mentioned in either the docs or the name :-) > I would suggest that > one of > array-primitive > primitive-array > vector-primitive > primitive-vector > would be a better name. I don't know enough about it to know whether > 'array' or 'primitive' would be better, and I don't know if there is > precedent for whether 'primitive' should come first or last. None of these describe what the package does since it contains a lot more than just array primitives. >> I'm not really sure why it is worse than, say, binary. Or vector, for >> that matter. > > Hopefully, binary and vector are the obvious, natural APIs for their > tasks. Well, binary's name is quite general and only vaguely related to its task. Don't get me wrong, I think it's a perfectly fine name, I just don't see how primitive is any worse. >> If it is to be renamed, though, then I would really find it useful to >> have agreed upon guidelines on what constitutes a Terrible Name so >> that I can try to avoid picking one in the future. > > It would very much have to be a guideline as opposed to a rule, but I'd > suggest something like: > > A package should not use a descriptive name that another package > might be equally- or more-deserving-of. To me, this reads as "packages should not use descriptive names" since there is almost always another package that does roughly the same thing. In the specific case of primitive, though, I'm actually having trouble finding another package on Hackage which would want to use the name. Roman From simonpj at microsoft.com Wed Aug 29 09:59:41 2012 From: simonpj at microsoft.com (Simon Peyton-Jones) Date: Wed, 29 Aug 2012 07:59:41 +0000 Subject: HP 2012.4.0.0 -- Call for Proposals In-Reply-To: <125D31BE-384C-4A34-BB30-7D85050DFBEB@cse.unsw.edu.au> References: <5033AA21.8070703@gmail.com> <5034BDFE.80004@gmail.com> <59543203684B2244980D7E4057D5FBC13799F9E0@DB3EX14MBXC312.europe.corp.microsoft.com> <125D31BE-384C-4A34-BB30-7D85050DFBEB@cse.unsw.edu.au> Message-ID: <59543203684B2244980D7E4057D5FBC1379B2873@DB3EX14MBXC312.europe.corp.microsoft.com> | > * And primitive is a Terrible Name for a package. Really | unacceptably bad. | | Hmm, I'm not sure I agree :-) | | Could you please explain why it's so terrible? | I would really find it useful to have agreed upon guidelines on what | constitutes a Terrible Name so that I can try to avoid picking one in | the future. Firstly, this is a matter for the libraries list and the Haskell Platform team. Just because I think it's a bad name doesn't mean that it *is*. GHC is happy to go with whatever the HP team decide; we'd just like it to be a conscious decision. Making it conscious was the point of our message. Why do I think it's a poor name? Because "primitive" conveys no information to me about its actual content except that it's, well, somehow primitive. "ghc-prim" isn't much better, but at least it declares that it's a GHC internal thing and no one else need bother with it. Likewise we have "integer-simple" and "integer-gmp", which say something about their content. So the guideline is: convey as much information as possible in the package name. Names like "basic-array" or "basic-vector" would convey a lot more information. Still, if HP team are happy with "primitive" (and changing it does have costs), then so be it. | It is actually for end users rather than for people doing vector stuff | which is why it's a separate package. So I wouldn't want to do this. Aha! Clearly I had misunderstood -- the name didn't sound end-user like to me! | > * Absorb it into the vector package, which is currently its | only client (we think). | | Definitely not this. I had what I consider good reasons for making it a | separate package when I implemented it. Great. Perhaps it would help to articulate those reasons? Even in the cabal file? Being explicitly told the cohesive unity in the mind of the package author, is really really useful. I'm not disputing that it's a useful package, or a well designed one. I just want the HP team to explicitly consider, bless it, and suggest changes if they think they are necessary. Simon From ekmett at gmail.com Wed Aug 29 19:34:46 2012 From: ekmett at gmail.com (Edward Kmett) Date: Wed, 29 Aug 2012 13:34:46 -0400 Subject: Proposal: Allow gunfold for Data.Map, Data.IntMap, etc. Message-ID: I would like to propose improving the Data instances for a number of currently completely opaque data types in the containers package, by using virtual constructors. The instance for Data.Map already uses fromList for gfoldl, it just stops there. Extending it to be able to gunfold and mention the name of that constructor would enable generic traversal libraries like uniplate, etc. to work over the contents of the Map, rather than bailing out in fear or crashing at the sight of a mkNoRepType. An example of the changes for Data.Map are highlighted below. instance (Data k, Data a, Ord k) => Data (Map k a) where gfoldl f z m = z fromList `f` toList m toConstr _ = fromListConstr gunfold k z c = case constrIndex c of 1 -> k (z fromList) _ -> error "gunfold" dataTypeOf _ = mapDataType dataCast2 f = gcast2 f fromListConstr :: Constr fromListConstr = mkConstr mapDataType "fromList" [] Prefix mapDataType :: DataType mapDataType = mkDataType "Data.Map.Map" [fromListConstr] I've used this approach for years on my own libraries to great effect. Discussion Period: 3 Weeks (I added a week for ICFP) -Edward -------------- next part -------------- An HTML attachment was scrubbed... URL: From fox at ucw.cz Wed Aug 29 21:24:53 2012 From: fox at ucw.cz (Milan Straka) Date: Wed, 29 Aug 2012 21:24:53 +0200 Subject: Proposal: Allow gunfold for Data.Map, Data.IntMap, etc. In-Reply-To: References: Message-ID: <20120829192453.GA8846@auryn.cz> Hi Edward, > I would like to propose improving the Data instances for a number of > currently completely opaque data types in the containers package, by using > virtual constructors. > > The instance for Data.Map already uses fromList for gfoldl, it just stops > there. > > Extending it to be able to gunfold and mention the name of that constructor > would enable generic traversal libraries like uniplate, etc. to work over > the contents of the Map, rather than bailing out in fear or crashing at the > sight of a mkNoRepType. > > An example of the changes for Data.Map are highlighted below. > > instance (Data k, Data a, Ord k) => Data (Map k a) where > gfoldl f z m = z fromList `f` toList m > toConstr _ = fromListConstr > gunfold k z c = case constrIndex c of > 1 -> k (z fromList) > _ -> error "gunfold" > dataTypeOf _ = mapDataType > dataCast2 f = gcast2 f > > fromListConstr :: Constr > fromListConstr = mkConstr mapDataType "fromList" [] Prefix > > mapDataType :: DataType > mapDataType = mkDataType "Data.Map.Map" [fromListConstr] > > I've used this approach for years on my own libraries to great effect. +1 here. I am not very familiar with the Data instances -- is it true that the parameter of the `fromList` in the Data instance will often be sorted (i.e., result of `toList` or `filter . toList`)? If so, we could use fromMaybeAscList which would look like fromMaybeAscList list | isDistinctAsc list = fromDistinctAscList list | otherwise = fromList list There is a big gain in using a linear-time fromDistinctAscList over O(N log N) fromList, but there is a linear-time check and the list must be kept around until isDistinctAsc finishes. Cheers, Milan From ekmett at gmail.com Thu Aug 30 01:54:57 2012 From: ekmett at gmail.com (Edward Kmett) Date: Wed, 29 Aug 2012 19:54:57 -0400 Subject: Proposal: Allow gunfold for Data.Map, Data.IntMap, etc. In-Reply-To: <20120829192453.GA8846@auryn.cz> References: <20120829192453.GA8846@auryn.cz> Message-ID: On Wed, Aug 29, 2012 at 3:24 PM, Milan Straka wrote: > Hi Edward, > > > I would like to propose improving the Data instances for a number of > > currently completely opaque data types in the containers package, by > using > > virtual constructors. > > > > The instance for Data.Map already uses fromList for gfoldl, it just stops > > there. > > > > Extending it to be able to gunfold and mention the name of that > constructor > > would enable generic traversal libraries like uniplate, etc. to work over > > the contents of the Map, rather than bailing out in fear or crashing at > the > > sight of a mkNoRepType. > > > > An example of the changes for Data.Map are highlighted below. > > > > instance (Data k, Data a, Ord k) => Data (Map k a) where > > gfoldl f z m = z fromList `f` toList m > > toConstr _ = fromListConstr > > gunfold k z c = case constrIndex c of > > 1 -> k (z fromList) > > _ -> error "gunfold" > > dataTypeOf _ = mapDataType > > dataCast2 f = gcast2 f > > > > fromListConstr :: Constr > > fromListConstr = mkConstr mapDataType "fromList" [] Prefix > > > > mapDataType :: DataType > > mapDataType = mkDataType "Data.Map.Map" [fromListConstr] > > > > I've used this approach for years on my own libraries to great effect. > > +1 here. > > I am not very familiar with the Data instances -- is it true that the > parameter of the `fromList` in the Data instance will often be sorted > (i.e., result of `toList` or `filter . toList`)? If so, we could use > fromMaybeAscList which would look like > fromMaybeAscList list | isDistinctAsc list = fromDistinctAscList list > | otherwise = fromList list > There is a big gain in using a linear-time fromDistinctAscList over O(N > log N) fromList, but there is a linear-time check and the list must be > kept around until isDistinctAsc finishes. > The users of Data.Data could in theory do anything they want to the keys, but I do confess for most scenarios they'll come back to you ordered. Hrmm. A more nuanced fromList construction could definitely help, though I suppose that could apply in the general case as well. We should be able to fuse this "try to construct linearly, but fall back on N-log-N" version of fromList in one pass even for normal uses of fromList. e.g. assume that you are constructing a sorted tree until you find a key out of order, then take the tree you've built so far and union it appropriately with the slower constructed fromList of the remainder. That way you don't have to retain the storage for both the list and the map, and we only force the list once. -Edward -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Thu Aug 30 02:02:35 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Wed, 29 Aug 2012 17:02:35 -0700 Subject: Proposal: Allow gunfold for Data.Map, Data.IntMap, etc. In-Reply-To: References: <20120829192453.GA8846@auryn.cz> Message-ID: On Wed, Aug 29, 2012 at 4:54 PM, Edward Kmett wrote: > We should be able to fuse this "try to construct linearly, but fall back on > N-log-N" version of fromList in one pass even for normal uses of fromList. > > e.g. assume that you are constructing a sorted tree until you find a key out > of order, then take the tree you've built so far and union it appropriately > with the slower constructed fromList of the remainder. That way you don't > have to retain the storage for both the list and the map, and we only force > the list once. Could you instead of falling back to the slower fromList just keep building new trees and then union them all in the end. Real world data is often is semi-sorted order. I guess we would need to detect some worst case scenarios (i.e. sorted in reverse order) and fall back to the slower fromList in those cases. -- Johan From ekmett at gmail.com Thu Aug 30 02:57:53 2012 From: ekmett at gmail.com (Edward Kmett) Date: Wed, 29 Aug 2012 20:57:53 -0400 Subject: Proposal: Allow gunfold for Data.Map, Data.IntMap, etc. In-Reply-To: References: <20120829192453.GA8846@auryn.cz> Message-ID: This might pay off as well, but I am leery that its a rather tricky balancing act and will take a lot of profiling to find the right balance in practical performance vs. asymptotic bounds. Should we split the notion of improving the performance of fromList into a separate project/proposal that simply exposes synergies with this one? -Edward On Wed, Aug 29, 2012 at 8:02 PM, Johan Tibell wrote: > On Wed, Aug 29, 2012 at 4:54 PM, Edward Kmett wrote: > > We should be able to fuse this "try to construct linearly, but fall back > on > > N-log-N" version of fromList in one pass even for normal uses of > fromList. > > > > e.g. assume that you are constructing a sorted tree until you find a key > out > > of order, then take the tree you've built so far and union it > appropriately > > with the slower constructed fromList of the remainder. That way you don't > > have to retain the storage for both the list and the map, and we only > force > > the list once. > > Could you instead of falling back to the slower fromList just keep > building new trees and then union them all in the end. Real world data > is often is semi-sorted order. I guess we would need to detect some > worst case scenarios (i.e. sorted in reverse order) and fall back to > the slower fromList in those cases. > > -- Johan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Thu Aug 30 03:06:25 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Wed, 29 Aug 2012 18:06:25 -0700 Subject: Proposal: Allow gunfold for Data.Map, Data.IntMap, etc. In-Reply-To: References: <20120829192453.GA8846@auryn.cz> Message-ID: On Wed, Aug 29, 2012 at 5:57 PM, Edward Kmett wrote: > This might pay off as well, but I am leery that its a rather tricky > balancing act and will take a lot of profiling to find the right balance in > practical performance vs. asymptotic bounds. > > Should we split the notion of improving the performance of fromList into a > separate project/proposal > that simply exposes synergies with this one? Sure. Lets continue this thread on its original topic. I'm +1 on the proposal. From johan.tibell at gmail.com Thu Aug 30 03:33:44 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Wed, 29 Aug 2012 18:33:44 -0700 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) Message-ID: Hi all, After reading the Safe Haskell paper today, I got the impression that no one actually wants the .Safe modules currently in vector. If vector was to be made Safe Haskell friendly, we should instead add .Unsafe modules (and have the rest of the modules declared Trustworthy). Having .Unsafe modules is better than having .Safe modules, because * there are many more safe functions than unsafe functions, and * Haskell is by default safe, so having modules called .Safe is a bit like having modules called .Pure. There's precedence for having .Unsafe modules in e.g. bytestring. If that's the case, and if Roman agrees, I suggest we release a new major version that * removes all the .Safe modules [1], * adds new .Unsafe modules, and * marks the functions that are now exported through the .Unsafe modules deprecated in their original (non-.Unsafe) location. I suggest that the deprecation doesn't involve an actual deprecation pragma in this release [2], but instead just a comment. A future major release could add the deprecation pragma and another major release after that could remove the actual functions. Actually removing functions causes huge Hackage churn so I suggest that we don't do that until the new .Unsafe modules have been around for a long time. 1. Normally I would suggest a deprecation period before removing functions from an API, but I just searched through all of Hackage and there's only a single package (bitvec) that makes use of the .Safe API 2. While deprecation pragmas sound good in theory there isn't much library authors can do to make the warning go away. An author can migrate to the new API, but in practice authors need to support a couple of releases of each library. Cheers, Johan From mark.lentczner at gmail.com Thu Aug 30 04:07:31 2012 From: mark.lentczner at gmail.com (Mark Lentczner) Date: Wed, 29 Aug 2012 19:07:31 -0700 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: As the Mighty Morphin' Power Rangers say: "Let's do this!" - Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From ekmett at gmail.com Thu Aug 30 05:01:19 2012 From: ekmett at gmail.com (Edward Kmett) Date: Wed, 29 Aug 2012 23:01:19 -0400 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: +1 On Wed, Aug 29, 2012 at 9:33 PM, Johan Tibell wrote: > Hi all, > > After reading the Safe Haskell paper today, I got the impression that > no one actually wants the .Safe modules currently in vector. If vector > was to be made Safe Haskell friendly, we should instead add .Unsafe > modules (and have the rest of the modules declared Trustworthy). > Having .Unsafe modules is better than having .Safe modules, because > > * there are many more safe functions than unsafe functions, and > * Haskell is by default safe, so having modules called .Safe is a bit > like having modules called .Pure. There's precedence for having > .Unsafe modules in e.g. bytestring. > > If that's the case, and if Roman agrees, I suggest we release a new > major version that > > * removes all the .Safe modules [1], > * adds new .Unsafe modules, and > * marks the functions that are now exported through the .Unsafe > modules deprecated in their original (non-.Unsafe) location. > > I suggest that the deprecation doesn't involve an actual deprecation > pragma in this release [2], but instead just a comment. A future major > release could add the deprecation pragma and another major release > after that could remove the actual functions. > > Actually removing functions causes huge Hackage churn so I suggest > that we don't do that until the new .Unsafe modules have been around > for a long time. > > 1. Normally I would suggest a deprecation period before removing > functions from an API, but I just searched through all of Hackage and > there's only a single package (bitvec) that makes use of the .Safe API > > 2. While deprecation pragmas sound good in theory there isn't much > library authors can do to make the warning go away. An author can > migrate to the new API, but in practice authors need to support a > couple of releases of each library. > > Cheers, > Johan > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ezyang at MIT.EDU Thu Aug 30 05:29:54 2012 From: ezyang at MIT.EDU (Edward Z. Yang) Date: Wed, 29 Aug 2012 23:29:54 -0400 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: <1346297385-sup-1878@javelin> +1 Cheers, Edward Excerpts from Johan Tibell's message of Wed Aug 29 21:33:44 -0400 2012: > Hi all, > > After reading the Safe Haskell paper today, I got the impression that > no one actually wants the .Safe modules currently in vector. If vector > was to be made Safe Haskell friendly, we should instead add .Unsafe > modules (and have the rest of the modules declared Trustworthy). > Having .Unsafe modules is better than having .Safe modules, because > > * there are many more safe functions than unsafe functions, and > * Haskell is by default safe, so having modules called .Safe is a bit > like having modules called .Pure. There's precedence for having > .Unsafe modules in e.g. bytestring. > > If that's the case, and if Roman agrees, I suggest we release a new > major version that > > * removes all the .Safe modules [1], > * adds new .Unsafe modules, and > * marks the functions that are now exported through the .Unsafe > modules deprecated in their original (non-.Unsafe) location. > > I suggest that the deprecation doesn't involve an actual deprecation > pragma in this release [2], but instead just a comment. A future major > release could add the deprecation pragma and another major release > after that could remove the actual functions. > > Actually removing functions causes huge Hackage churn so I suggest > that we don't do that until the new .Unsafe modules have been around > for a long time. > > 1. Normally I would suggest a deprecation period before removing > functions from an API, but I just searched through all of Hackage and > there's only a single package (bitvec) that makes use of the .Safe API > > 2. While deprecation pragmas sound good in theory there isn't much > library authors can do to make the warning go away. An author can > migrate to the new API, but in practice authors need to support a > couple of releases of each library. > > Cheers, > Johan > From lemming at henning-thielemann.de Thu Aug 30 10:12:03 2012 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Thu, 30 Aug 2012 10:12:03 +0200 (CEST) Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: On Wed, 29 Aug 2012, Johan Tibell wrote: > Hi all, > > After reading the Safe Haskell paper today, I got the impression that > no one actually wants the .Safe modules currently in vector. If vector > was to be made Safe Haskell friendly, we should instead add .Unsafe > modules (and have the rest of the modules declared Trustworthy). > Having .Unsafe modules is better than having .Safe modules, because > > * there are many more safe functions than unsafe functions, and > * Haskell is by default safe, so having modules called .Safe is a bit > like having modules called .Pure. There's precedence for having > .Unsafe modules in e.g. bytestring. > > If that's the case, and if Roman agrees, I suggest we release a new > major version that > > * removes all the .Safe modules [1], > * adds new .Unsafe modules, and > * marks the functions that are now exported through the .Unsafe > modules deprecated in their original (non-.Unsafe) location. +1 From fox at ucw.cz Thu Aug 30 10:27:52 2012 From: fox at ucw.cz (Milan Straka) Date: Thu, 30 Aug 2012 10:27:52 +0200 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: <20120830082752.GA11177@auryn.cz> Hi, > After reading the Safe Haskell paper today, I got the impression that > no one actually wants the .Safe modules currently in vector. If vector > was to be made Safe Haskell friendly, we should instead add .Unsafe > modules (and have the rest of the modules declared Trustworthy). > Having .Unsafe modules is better than having .Safe modules, because > > * there are many more safe functions than unsafe functions, and > * Haskell is by default safe, so having modules called .Safe is a bit > like having modules called .Pure. There's precedence for having > .Unsafe modules in e.g. bytestring. > > If that's the case, and if Roman agrees, I suggest we release a new > major version that > > * removes all the .Safe modules [1], > * adds new .Unsafe modules, and > * marks the functions that are now exported through the .Unsafe > modules deprecated in their original (non-.Unsafe) location. +1 from me. Milan From rl at cse.unsw.edu.au Thu Aug 30 12:09:45 2012 From: rl at cse.unsw.edu.au (Roman Leshchinskiy) Date: Thu, 30 Aug 2012 11:09:45 +0100 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: Johan Tibell wrote: > > If that's the case, and if Roman agrees, I suggest we release a new > major version that > > * removes all the .Safe modules [1], > * adds new .Unsafe modules, and > * marks the functions that are now exported through the .Unsafe > modules deprecated in their original (non-.Unsafe) location. > > I suggest that the deprecation doesn't involve an actual deprecation > pragma in this release [2], but instead just a comment. A future major > release could add the deprecation pragma and another major release > after that could remove the actual functions. As I said earlier, I will definitely remove the .Safe modules. I'm not particularly keen on adding .Unsafe modules but in the scheme you're proposing, they'll just reexport a few functions and are (hopefully) easy to generate automatically so if there really is demand for it, I'll add them. Although I'd like to point out that with these scheme, vector won't have any SafeHaskell-safe modules so I'm not entirely sure what the point is, given that the entire discussion was because people objected to removing support for SafeHaskell. A caveat: I will only add the .Unsafe modules if they are generated automatically. I *hope* that's easy to do but can't make any promises as to how long it will take at this point. If someone else wants to have a go at automatic generation, I'll gladly accept patches. However, I'm not sure how to add the deprecation comments. I'll end up with this: module Foo (unsafeFoo) where unsafeFoo :: Very Long Type unsafeFoo = ... module Foo.Unsafe(unsafeFoo) where import Foo How do I make Haddock say that unsafeFoo is deprecated in the docs for Foo but not in the docs for Foo.Unsafe? Or is this impossible and will I have to do this? module Foo (unsafeFoo) where -- | (Deprecated) Very long comment unsafeFoo :: Very Long Type unsafeFoo = ... module Foo.Unsafe(unsafeFoo) where import qualified Foo -- | Very long comment unsafeFoo :: Very Long Type {-# INLINE unsafeFoo #-} unsafeFoo = Foo.unsafeFoo Last question: do the +1 comments mean "yes, sounds good" or "yes, this is something I will use"? Roman From byorgey at seas.upenn.edu Thu Aug 30 15:50:54 2012 From: byorgey at seas.upenn.edu (Brent Yorgey) Date: Thu, 30 Aug 2012 09:50:54 -0400 Subject: Proposal: Allow gunfold for Data.Map, Data.IntMap, etc. In-Reply-To: References: <20120829192453.GA8846@auryn.cz> Message-ID: <20120830135054.GA26357@seas.upenn.edu> On Wed, Aug 29, 2012 at 06:06:25PM -0700, Johan Tibell wrote: > On Wed, Aug 29, 2012 at 5:57 PM, Edward Kmett wrote: > > This might pay off as well, but I am leery that its a rather tricky > > balancing act and will take a lot of profiling to find the right balance in > > practical performance vs. asymptotic bounds. > > > > Should we split the notion of improving the performance of fromList into a > > separate project/proposal > > that simply exposes synergies with this one? > > Sure. Lets continue this thread on its original topic. I'm +1 on the > proposal. +1 from me too. A smarter fromList also sounds cool but I agree that should be a separate proposal, if only to avoid derailing this one. -Brent From johan.tibell at gmail.com Thu Aug 30 16:16:58 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Thu, 30 Aug 2012 07:16:58 -0700 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: On Thu, Aug 30, 2012 at 3:09 AM, Roman Leshchinskiy wrote: > As I said earlier, I will definitely remove the .Safe modules. I'm not > particularly keen on adding .Unsafe modules but in the scheme you're > proposing, they'll just reexport a few functions and are (hopefully) easy > to generate automatically so if there really is demand for it, I'll add > them. Although I'd like to point out that with these scheme, vector won't > have any SafeHaskell-safe modules so I'm not entirely sure what the point > is, given > that the entire discussion was because people objected to removing support > for SafeHaskell. My main interest is having the .Safe modules removed. I wanted to present a compromise that'd allow people that care about Safe Haskell to still use vector. I'm hoping that having .Unsafe modules will be less work than having .Safe modules. My intention was to move from: * M - Unsafe * M.Safe - Trustworthy to: * M - Trustworthy * M.Unsafe - Unsafe I just had a look at Data.Vector and the haddock docs claim that it's Safe-inferred. So I guess I don't understand the current setup even. Why aren't the M modules Unsafe, given that they use IO in their implementation? > A caveat: I will only add the .Unsafe modules if they are generated > automatically. I *hope* that's easy to do but can't make any promises as > to how long it will take at this point. If someone else wants to have a go > at automatic generation, I'll gladly accept patches. Fair enough. Could you remove the .Safe modules before that? > Or is this impossible and will I have to do this? > > > module Foo (unsafeFoo) where > > -- | (Deprecated) Very long comment > unsafeFoo :: Very Long Type > unsafeFoo = ... > > > module Foo.Unsafe(unsafeFoo) where > import qualified Foo > > -- | Very long comment > unsafeFoo :: Very Long Type > {-# INLINE unsafeFoo #-} > unsafeFoo = Foo.unsafeFoo I'm afraid so. > Last question: do the +1 comments mean "yes, sounds good" or "yes, this is > something I will use"? For me it is "removed the .Safe modules please". -- Johan From wren at freegeek.org Thu Aug 30 19:04:43 2012 From: wren at freegeek.org (wren ng thornton) Date: Thu, 30 Aug 2012 13:04:43 -0400 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: <503F9D2B.7080906@freegeek.org> On 8/30/12 10:16 AM, Johan Tibell wrote: > On Thu, Aug 30, 2012 at 3:09 AM, Roman Leshchinskiy wrote: >> As I said earlier, I will definitely remove the .Safe modules. I'm not >> particularly keen on adding .Unsafe modules but in the scheme you're >> proposing, they'll just reexport a few functions and are (hopefully) easy >> to generate automatically so if there really is demand for it, I'll add >> them. Although I'd like to point out that with these scheme, vector won't >> have any SafeHaskell-safe modules so I'm not entirely sure what the point >> is, given >> that the entire discussion was because people objected to removing support >> for SafeHaskell. > > My main interest is having the .Safe modules removed. I'm +1 to this part. As you say, having .Safe modules is like having .Pure modules: utter foolishness for Haskell. I'm all for momentum towards Safe Haskell. But I'd really rather not revisit our previous discussion on that matter. I'd say we should: (1) add vector to the Platform, sans .Safe modules (2) move the less objective/objectionable packages towards Safe Haskell, in order to instill that as a virtue and to get some empirical data about how users interact with Safe Haskell (3) revisit the Safe Haskell + vector issues once Safe Haskell is more popular and we have some better ideas what the practical arguments are (as opposed to just the theoretical ones). -- Live well, ~wren From haskell at benmachine.co.uk Thu Aug 30 20:37:53 2012 From: haskell at benmachine.co.uk (Ben Millwood) Date: Thu, 30 Aug 2012 19:37:53 +0100 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: <503F9D2B.7080906@freegeek.org> References: <503F9D2B.7080906@freegeek.org> Message-ID: On Thu, Aug 30, 2012 at 6:04 PM, wren ng thornton wrote: > > I'm all for momentum towards Safe Haskell. But I'd really rather not revisit > our previous discussion on that matter. I'd say we should: > > (1) add vector to the Platform, sans .Safe modules > (2) move the less objective/objectionable packages towards Safe Haskell, in > order to instill that as a virtue and to get some empirical data about how > users interact with Safe Haskell > (3) revisit the Safe Haskell + vector issues once Safe Haskell is more > popular and we have some better ideas what the practical arguments are (as > opposed to just the theoretical ones). Agreed. Let's get vector into the Platform as if Safe Haskell never existed, and revisit it later if it becomes something that we need. From qdunkan at gmail.com Thu Aug 30 21:01:59 2012 From: qdunkan at gmail.com (Evan Laforge) Date: Thu, 30 Aug 2012 12:01:59 -0700 Subject: Data.Graph Message-ID: I just fixed a bug in my program that came about because the same graph constructed in different orders compared inequal. E.g.: buildG (0, 2) [(0, 1), (0, 2)] /= buildG (0, 2) [(0, 2), (0, 1)] It seems to me that these should compare equal. This was easy for me to do since I wrap Graph in a newtype, but it's hard to do for Graph itself, since it's defined as a type synonym over Data.Array. Do people agree that (==) is incorrect for Data.Graph, or is there a legitimate difference between the two graphs? If people agree, what can be done to fix Data.Graph? Should be add Data.Graph2 that is defined as a real type and start anew from there? In general, it seems to me Data.Graph is very basic and has not received any love for a long time. It's a thin wrapper over Data.Array, which is one of the more error-prone ornery APIs out there. To use it I wound up writing lots of little utility functions to do things like add or remove edges which were fiddly and error prone. I just noticed a package graph-wrapper, with the description "A wrapper around the standard Data.Graph with a less awkward interface", so I guess I'm not the only person to have felt that way. Wouldn't it be nice to start taking steps toward having a graph library in the stdlib that people actually like? From fox at ucw.cz Thu Aug 30 21:45:03 2012 From: fox at ucw.cz (Milan Straka) Date: Thu, 30 Aug 2012 21:45:03 +0200 Subject: Data.Graph In-Reply-To: References: Message-ID: <20120830194503.GA14062@auryn.cz> Hi Evan, > I just fixed a bug in my program that came about because the same > graph constructed in different orders compared inequal. E.g.: > > buildG (0, 2) [(0, 1), (0, 2)] /= buildG (0, 2) [(0, 2), (0, 1)] > > It seems to me that these should compare equal. This was easy for me > to do since I wrap Graph in a newtype, but it's hard to do for Graph > itself, since it's defined as a type synonym over Data.Array. > > Do people agree that (==) is incorrect for Data.Graph, or is there a > legitimate difference between the two graphs? If people agree, what > can be done to fix Data.Graph? Should be add Data.Graph2 that is > defined as a real type and start anew from there? > > In general, it seems to me Data.Graph is very basic and has not > received any love for a long time. It's a thin wrapper over > Data.Array, which is one of the more error-prone ornery APIs out > there. To use it I wound up writing lots of little utility functions > to do things like add or remove edges which were fiddly and error > prone. I just noticed a package graph-wrapper, with the description > "A wrapper around the standard Data.Graph with a less awkward > interface", so I guess I'm not the only person to have felt that way. > > Wouldn't it be nice to start taking steps toward having a graph > library in the stdlib that people actually like? As far as I know, Data.Graph has not been given any attention in quite some time. I do not know whether someone is using it. As one of the maintainers of containers, I can say that no-one is working on it and you are even the first who had any comments about Data.Graph in quite some time. There is widely used library fgl, which is even in Haskell Platform, and that definitely is being used. Maybe we should separate Data.Graph (and probably Data.Tree) into a separate package? Any thoughts? Cheers, Milan From thomas.dubuisson at gmail.com Thu Aug 30 22:23:53 2012 From: thomas.dubuisson at gmail.com (Thomas DuBuisson) Date: Thu, 30 Aug 2012 13:23:53 -0700 Subject: Data.Graph In-Reply-To: <20120830194503.GA14062@auryn.cz> References: <20120830194503.GA14062@auryn.cz> Message-ID: > As far as I know, Data.Graph has not been given any attention in quite > some time. I do not know whether someone is using it. Yes, Data.Graph is in use in at least one serious compiler/research project. > Maybe we should separate Data.Graph (and probably Data.Tree) into > a separate package? Any thoughts? I don't see a reason to separate out Data.Graph unless being in containers somehow a) significantly increases the lag time from patch to new release, or b) frequently causes major version bumps to 'containers' that causes headaches non-Data.Graph users. > > Cheers, > Milan > > _______________________________________________ > Libraries mailing list > Libraries at haskell.org > http://www.haskell.org/mailman/listinfo/libraries From Christian.Maeder at dfki.de Fri Aug 31 09:35:58 2012 From: Christian.Maeder at dfki.de (Christian Maeder) Date: Fri, 31 Aug 2012 09:35:58 +0200 Subject: Data.Graph In-Reply-To: References: Message-ID: <5040695E.30507@dfki.de> Am 30.08.2012 21:01, schrieb Evan Laforge: > I just fixed a bug in my program that came about because the same > graph constructed in different orders compared inequal. E.g.: > > buildG (0, 2) [(0, 1), (0, 2)] /= buildG (0, 2) [(0, 2), (0, 1)] > > It seems to me that these should compare equal. This was easy for me > to do since I wrap Graph in a newtype, but it's hard to do for Graph > itself, since it's defined as a type synonym over Data.Array. > > Do people agree that (==) is incorrect for Data.Graph, or is there a > legitimate difference between the two graphs? If people agree, what > can be done to fix Data.Graph? Should be add Data.Graph2 that is > defined as a real type and start anew from there? Is the difference caused by using a list of successors [Vertex] instead? If so, I think, Data.Graph is correct! fgl uses a list, too. Cheers C. > > In general, it seems to me Data.Graph is very basic and has not > received any love for a long time. It's a thin wrapper over > Data.Array, which is one of the more error-prone ornery APIs out > there. To use it I wound up writing lots of little utility functions > to do things like add or remove edges which were fiddly and error > prone. I just noticed a package graph-wrapper, with the description > "A wrapper around the standard Data.Graph with a less awkward > interface", so I guess I'm not the only person to have felt that way. > > Wouldn't it be nice to start taking steps toward having a graph > library in the stdlib that people actually like? > From nad at chalmers.se Fri Aug 31 13:57:56 2012 From: nad at chalmers.se (Nils Anders Danielsson) Date: Fri, 31 Aug 2012 13:57:56 +0200 Subject: Data.Graph In-Reply-To: <20120830194503.GA14062@auryn.cz> References: <20120830194503.GA14062@auryn.cz> Message-ID: <5040A6C4.2010804@chalmers.se> On 2012-08-30 21:45, Milan Straka wrote: > As far as I know, Data.Graph has not been given any attention in quite > some time. I do not know whether someone is using it. Agda uses Data.Graph to compute strongly connected components. -- /NAD From marlowsd at gmail.com Fri Aug 31 14:29:35 2012 From: marlowsd at gmail.com (Simon Marlow) Date: Fri, 31 Aug 2012 13:29:35 +0100 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: <5040AE2F.8050806@gmail.com> On 30/08/2012 02:33, Johan Tibell wrote: > Hi all, > > After reading the Safe Haskell paper today, I got the impression that > no one actually wants the .Safe modules currently in vector. If vector > was to be made Safe Haskell friendly, we should instead add .Unsafe > modules (and have the rest of the modules declared Trustworthy). > Having .Unsafe modules is better than having .Safe modules, because > > * there are many more safe functions than unsafe functions, and > * Haskell is by default safe, so having modules called .Safe is a bit > like having modules called .Pure. There's precedence for having > .Unsafe modules in e.g. bytestring. > > If that's the case, and if Roman agrees, I suggest we release a new > major version that > > * removes all the .Safe modules [1], > * adds new .Unsafe modules, and > * marks the functions that are now exported through the .Unsafe > modules deprecated in their original (non-.Unsafe) location. +1 from me, although when we discussed doing this previously Roman was not keen. > I suggest that the deprecation doesn't involve an actual deprecation > pragma in this release [2], but instead just a comment. A future major > release could add the deprecation pragma and another major release > after that could remove the actual functions. Why not a deprecation pragma initially? That's like adding another level of "soft deprecation"; how long before we also need "extra-soft deprecation" and "ultra-soft deprecation"? (I feel a bog-roll analogy coming on :-) > 1. Normally I would suggest a deprecation period before removing > functions from an API, but I just searched through all of Hackage and > there's only a single package (bitvec) that makes use of the .Safe API We also have: Data.Array.IO.Safe Control.Monad.ST.Safe Foreign.Marshal.Safe and I think all of these are in the same state: the unsafe APIs in the non-Safe modules are currently deprecated, and the .Safe modules can be removed at some time in the future. Cheers, Simon From marlowsd at gmail.com Fri Aug 31 14:33:19 2012 From: marlowsd at gmail.com (Simon Marlow) Date: Fri, 31 Aug 2012 13:33:19 +0100 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: <5040AF0F.7000300@gmail.com> On 30/08/2012 15:16, Johan Tibell wrote: > On Thu, Aug 30, 2012 at 3:09 AM, Roman Leshchinskiy wrote: >> As I said earlier, I will definitely remove the .Safe modules. I'm not >> particularly keen on adding .Unsafe modules but in the scheme you're >> proposing, they'll just reexport a few functions and are (hopefully) easy >> to generate automatically so if there really is demand for it, I'll add >> them. Although I'd like to point out that with these scheme, vector won't >> have any SafeHaskell-safe modules so I'm not entirely sure what the point >> is, given >> that the entire discussion was because people objected to removing support >> for SafeHaskell. > > My main interest is having the .Safe modules removed. I wanted to > present a compromise that'd allow people that care about Safe Haskell > to still use vector. I'm hoping that having .Unsafe modules will be > less work than having .Safe modules. > > My intention was to move from: > > * M - Unsafe > * M.Safe - Trustworthy > > to: > > * M - Trustworthy > * M.Unsafe - Unsafe > > I just had a look at Data.Vector and the haddock docs claim that it's > Safe-inferred. I think that's a bug in Haddock that has since been fixed. Whoever generated that documentation needs to update to a newer version of Haddock. Cheers, Simon From twanvl at gmail.com Fri Aug 31 15:05:28 2012 From: twanvl at gmail.com (Twan van Laarhoven) Date: Fri, 31 Aug 2012 15:05:28 +0200 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: References: Message-ID: <5040B698.3070909@gmail.com> On 30/08/12 03:33, Johan Tibell wrote: > * removes all the .Safe modules [1], > * adds new .Unsafe modules, and > * marks the functions that are now exported through the .Unsafe > modules deprecated in their original (non-.Unsafe) location. Is there a particular reason for first deprecating the functions exported from Data.Vector, instead of just removing them from their original location? By removing the Data.Vector.Safe module you already break some existing code, with the easy fix of moving to import Data.Vector. Moving the the unsafe functions to Data.Vector.Unsafe would introduce similar breakage, with a similarly easy fix of adding an import declaration. Twan From johan.tibell at gmail.com Fri Aug 31 20:01:40 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Fri, 31 Aug 2012 11:01:40 -0700 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: <5040AE2F.8050806@gmail.com> References: <5040AE2F.8050806@gmail.com> Message-ID: On Fri, Aug 31, 2012 at 5:29 AM, Simon Marlow wrote: > Why not a deprecation pragma initially? That's like adding another level of > "soft deprecation"; how long before we also need "extra-soft deprecation" > and "ultra-soft deprecation"? (I feel a bog-roll analogy coming on :-) Because libraries need to support not only the last release of vector but also a few versions back. The reason is the following: If * Package P1 depends on package P2 <= A.B.C and P3 <= X.Y.Z. * Package P2 depends on package P3 <= X.Y.Z. * A new major release of package P3, X.Y.Z+1, that moves some functions to a new module and leaves behind deprecated re-exports, is released. * A new release of P2, A.B.C+1, that adds some new functions (unrelated to the changes in P3) is made. This release uses the new P3 API in order to get rid of deprecation messages, and thus have to depend on P3 == X.Y.Z+1. * P1 wants to use the new P2 API and thus depends on P2 == A.B.C+1. * P1 no longer builds due to its dependency chain contains incompatible constraints on P3. We've seen this on Hackage in the past. Introducing lower bounds on the latest release of a package creates a "but" through Hackage between packages that has an upper bound that excludes the new release and packages that have a lower bound that includes it. Breakage ensues. This last happened with the deepseq package I think. Authors can work around the problem with CPP, but it's ugly and annoying. My preference is to have a soft deprecation (i.e. comments) of an API, wait for a period of time, add pragmas to catch the last non-updaters, make the braking change. -- Johan From johan.tibell at gmail.com Fri Aug 31 20:03:15 2012 From: johan.tibell at gmail.com (Johan Tibell) Date: Fri, 31 Aug 2012 11:03:15 -0700 Subject: Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package) In-Reply-To: <5040B698.3070909@gmail.com> References: <5040B698.3070909@gmail.com> Message-ID: On Fri, Aug 31, 2012 at 6:05 AM, Twan van Laarhoven wrote: > On 30/08/12 03:33, Johan Tibell wrote: >> >> * removes all the .Safe modules [1], >> * adds new .Unsafe modules, and >> * marks the functions that are now exported through the .Unsafe >> modules deprecated in their original (non-.Unsafe) location. > > > Is there a particular reason for first deprecating the functions exported > from Data.Vector, instead of just removing them from their original > location? By removing the Data.Vector.Safe module you already break some > existing code, with the easy fix of moving to import Data.Vector. Moving the > the unsafe functions to Data.Vector.Unsafe would introduce similar breakage, > with a similarly easy fix of adding an import declaration. See my answer to Simon about deprecation. The difference between removing the .Safe modules and moving to .Unsafe is that no one uses the Safe API but plenty of people use the unsafe* functions. -- Johan