Add instance Data a => Data (ZipList a) to base

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Add instance Data a => Data (ZipList a) to base

Mario
I'm surprised this is missing. All newtypes exported from
Control.Applicative share the same issue, with the exception of Const.


_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Add instance Data a => Data (ZipList a) to base

Oleg Grenrus
+1

ZipList should be no-brainer. Someone should write a patch.

GHC seems to generate instances like below just fine for wrapper things too,
though how often `m a` is actually Data? Well probably often enough.

newtype WrappedMonad m a = WrapMonad { unwrapMonad :: m a }
   deriving (Data)

-- instance [safe] (Typeable m, Typeable a, Data (m a)) =>
--                 Data (WrappedMonad m a)

- Oleg

On 3.11.2019 16.28, Mario wrote:
> I'm surprised this is missing. All newtypes exported from
> Control.Applicative share the same issue, with the exception of Const.
>
>
> _______________________________________________
> Libraries mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Add instance Data a => Data (ZipList a) to base

David Feuer
In reply to this post by Mario
I don't think we really need to go through the proposal process to add a Data instance when we already have a Generic instance or vice versa.

On Sun, Nov 3, 2019, 9:29 AM Mario <[hidden email]> wrote:
I'm surprised this is missing. All newtypes exported from
Control.Applicative share the same issue, with the exception of Const.


_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Add instance Data a => Data (ZipList a) to base

Mario Blažević
On 2019-11-04 10:23 a.m., David Feuer wrote:
> I don't think we really need to go through the proposal process to add a
> Data instance when we already have a Generic instance or vice versa.

What should I do instead? Open an issue? The bug tracker link on Hackage
is broken, BTW. It works without the last path component.

http://ghc.haskell.org/trac/ghc/newticket?component=libraries/base
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Add instance Data a => Data (ZipList a) to base

Edward Kmett-2
You can consider this email a judgment from the base maintainer on the CLC that it is okay to add these missing Data instances. 

That should be enough to not get the issue thrown out of the ghc issue tracker.

We already had the discussions in the CLC back a couple of years ago approving adding missing common instances when uniquely defined. These seem to have been missed in the previous passes.

Now we just need a patch.

-Edward

On Mon, Nov 4, 2019 at 10:29 AM Mario Blažević <[hidden email]> wrote:
On 2019-11-04 10:23 a.m., David Feuer wrote:
> I don't think we really need to go through the proposal process to add a
> Data instance when we already have a Generic instance or vice versa.

What should I do instead? Open an issue? The bug tracker link on Hackage
is broken, BTW. It works without the last path component.

http://ghc.haskell.org/trac/ghc/newticket?component=libraries/base
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries