Re: patch applied (packages/containers): Remove the rest of base to leave a "containers" package

Quoting Ian Lynagh
Wed Aug 1 15:38:31 PDT 2007 Ian Lynagh
* Remove the rest of base to leave a "containers" package
There may be a case for treating the constructor classes (in Data.Foldable and Data.Traversable) differently from the concrete container types (Data.Set et al). For example, to accomodate the instances for Array in the current setup, one of array and containers must depend on the other, although they are not otherwise related. ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.

On Sat, 2007-08-04 at 14:26 +0100, ross@soi.city.ac.uk wrote:
Quoting Ian Lynagh
: Wed Aug 1 15:38:31 PDT 2007 Ian Lynagh
* Remove the rest of base to leave a "containers" package There may be a case for treating the constructor classes (in Data.Foldable and Data.Traversable) differently from the concrete container types (Data.Set et al). For example, to accomodate the instances for Array in the current setup, one of array and containers must depend on the other, although they are not otherwise related.
I'd certainly argue for this too, the classes should be lower down the package tree than the instances, otherwise it discourages people from making their data types instances of these useful classes. Same argument applies to deriving generics support; that now requires depending on the generic package, even if it's no functions from it are used. Duncan

Hello Duncan, Saturday, August 4, 2007, 5:44:24 PM, you wrote:
I'd certainly argue for this too, the classes should be lower down the package tree than the instances, otherwise it discourages people from making their data types instances of these useful classes.
Same argument applies to deriving generics support; that now requires depending on the generic package, even if it's no functions from it are used.
"lower down" - ok, but not in base if possible. base can't be upgraded without upgrading ghc and anything contained here is almost dead for timely improvements -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
"lower down" - ok, but not in base if possible. base can't be upgraded without upgrading ghc and anything contained here is almost dead for timely improvements
Is it time to take Prelude and many classes out of base so they can be upgraded too, maybe a 'prelude', maybe a 'base-classes' package? Of course naming will be difficult and once base has shrunk enough, maybe it should be called something other than "base" then, although that's not necessary. Arguing for Prelude is if something in the library needs to be fixed up for Haskell-prime compliance sometime (the only change that seems likely to happen to Prelude!). On the other hand many of the standard classes and instances are currently defined in a way that is tangled amongst the un-upgradable code, so problems with those standard instances (like http://hackage.haskell.org/trac/ghc/ticket/1579 maybe) might not actually be fixable anyway without more-extensive refactoring work. Also arguing against taking Prelude out of base is if base is supposed to support some compilers that can't handle Prelude not being available! Packages consisting of only classes are mostly good, but they require the types they refer to and default implementations. Not much of a problem - class-default implementations probably shouldn't be too complicated. Isaac

On Sat, Aug 04, 2007 at 02:26:38PM +0100, Ross Paterson wrote:
Quoting Ian Lynagh
: Wed Aug 1 15:38:31 PDT 2007 Ian Lynagh
* Remove the rest of base to leave a "containers" package There may be a case for treating the constructor classes (in Data.Foldable and Data.Traversable) differently from the concrete container types (Data.Set et al).
OK, I've put them back in base for the time being.
For example, to accomodate the instances for Array in the current setup, one of array and containers must depend on the other, although they are not otherwise related.
Data.Graph uses Data.Array.ST (for GHC at least), so containers depends on array anyway. It might be possible to make this a conditional dependency with cabal configs, but I don't know if there are other deps, and I'm not sure why hugs doesn't use the ST version anyway. Thanks Ian
participants (5)
-
Bulat Ziganshin
-
Duncan Coutts
-
Ian Lynagh
-
Isaac Dupree
-
ross@soi.city.ac.uk