I'm somewhat neutral on the proposal.

On the plus side, generalizing Category fits with the current goal of having base export one version of each combinator.

On the minus side, Category is far less used than the other abstractions we're bringing into Prelude in 7.10.

Utimately? I'm ever so slightly in the 'we shouldn't do it' camp --  a very weak -1 -- from the standpoint that Category is currently PolyKinded, which is incredibly useful, and so far, nothing we export or are planning to export from Prelude is.

It is currently very easy to propose the new Prelude we're building to the folks on the Haskell' committee for standardization going forward.

With PolyKinds that becomes a rather bigger leap. Now, having implemented PolyKinds in another compiler, they aren't too hard, just slightly tricky, so that may be a thing we do want to do eventually, but I'd have a hard time putting it forward for standardization with a straight face today.

I'd feel a bit more comfortable getting through the current wave of generalization for 7.10, then revisiting if we should do this for 7.12 once the community has had a chance to adapt.

If there was a huge upswell of support for this we could do it, but so far the response has been one of measured indifference.

-Edward


On Mon, Jun 16, 2014 at 5:09 AM, Erik Hesselink <hesselink@gmail.com> wrote:
On Sun, Jun 15, 2014 at 4:13 PM, Herbert Valerio Riedel <hvr@gnu.org> wrote:

> I wonder if Haskell could be extended to be able to write something like
>
>   import Data.Category
>
> and have the more general versions of (.) and id automatically shadow
> the monomorphic versions brought in scope by the Prelude.

We use a custom prelude that almost gives us this. You have to do:

{-# LANGUAGE NoImplicitPrelude #-}

import Prelude.Polymorphic

This gives us Foldable/Traversable/Category polymorphic variants of
the prelude functions. It's been a pretty good experience. The largest
problem, as Edward already mentioned, are the re-exports of
Control.Monad from the mtl package.

I'm -1 on making (.) polymorphic by default though. The errors can be
kind of intimidating for the beginning Haskeller. Let's first see how
it goes with Foldable/Traversable in the prelude...

Erik
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://www.haskell.org/mailman/listinfo/libraries