Discussion: GHC.Generics vs. transformers Sum/Product

GHC.Generics defines the following pleasantly-named types data (f :+: g) a = L1 (f a) | R1 (g a) and data (f :*: g) a = f a :*: g a represent lifted sums and products (analogous to Either and (,), respectively). These types, however, are given very few instances. Most notably, they lack even Functor instances! Entirely equivalent types, with less pleasant names, appear in transformers Data.Functor.Sum and Data.Functor.Product, where they are given plenty of instances. Is there some way to bring these things together, preferably with the names from GHC.Generics and the instances from Data.Functor.Sum and Data.Functor.Product?

On Thu, 18 Feb 2016, David Feuer wrote:
Entirely equivalent types, with less pleasant names, appear in transformers Data.Functor.Sum and Data.Functor.Product, where they are given plenty of instances. Is there some way to bring these things together, preferably with the names from GHC.Generics and the instances from Data.Functor.Sum and Data.Functor.Product?
I prefer the names from 'transformers'. They are Haskell 98, they do not need type-level operators.

Good point. I forgot about that issue. In any case, I think probably most people can agree that the ones in Generics should really have Functor, etc., instances? On Thu, Feb 18, 2016 at 3:27 PM, Henning Thielemann < lemming@henning-thielemann.de> wrote:
On Thu, 18 Feb 2016, David Feuer wrote:
Entirely equivalent types, with less pleasant names, appear in
transformers Data.Functor.Sum and Data.Functor.Product, where they are given plenty of instances. Is there some way to bring these things together, preferably with the names from GHC.Generics and the instances from Data.Functor.Sum and Data.Functor.Product?
I prefer the names from 'transformers'. They are Haskell 98, they do not need type-level operators.

We agreed to take a patch to add the missing instances for GHC.Generics.*
in issue #9043.
-Edward
On Thu, Feb 18, 2016 at 3:32 PM, David Feuer
Good point. I forgot about that issue. In any case, I think probably most people can agree that the ones in Generics should really have Functor, etc., instances?
On Thu, Feb 18, 2016 at 3:27 PM, Henning Thielemann < lemming@henning-thielemann.de> wrote:
On Thu, 18 Feb 2016, David Feuer wrote:
Entirely equivalent types, with less pleasant names, appear in
transformers Data.Functor.Sum and Data.Functor.Product, where they are given plenty of instances. Is there some way to bring these things together, preferably with the names from GHC.Generics and the instances from Data.Functor.Sum and Data.Functor.Product?
I prefer the names from 'transformers'. They are Haskell 98, they do not need type-level operators.
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
participants (3)
-
David Feuer
-
Edward Kmett
-
Henning Thielemann