[GHC] #9043: Add missing type class instances for data types in GHC.Generics

#9043: Add missing type class instances for data types in GHC.Generics ------------------------------------+------------------------------------- Reporter: ocharles | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- GHC.Generics offers a bunch of data types which have valid instances of various type classes in base, such as Functor. There's no good reason not to have these instances, so they should be added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: ocharles Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by ocharles): * owner: => ocharles -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: ocharles Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by ekmett): Makes a lot of sense to me. The missing `Functor`/`Foldable`/`Traversable` instances for these have bitten me before and the instances are entirely determined by their laws / convention. There are a few other instances that make sense uniformly: e.g. `U1`, `Par1`, `Rec1`, and `(:*:)`, and `M1` can also be made instances of `Applicative`, `Monad`, `MonadZip` in a completely unambiguous way determined by the laws just by lifting them from their parts. `(:.:)` admits an unambiguous `Applicative`, but not the others. It might also make sense to look into making the types in there instances of `Generic` / `Generic1` for bootstrapping purposes, and they are currently missing `Typeable` and `Data` instances as well. The instances probably have to live out mostly where the typeclasses come from rather than in the module itself to avoid cycles, but otherwise I don't see any headaches, and they are entirely determined by the definitions of the classes involved, so there is no bikeshedding opportunity. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by dreixel): * owner: ocharles => dreixel -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by ocharles): * status: new => patch Comment: I have a branch that adds almost all the above mentioned type clasess at https://github.com/ocharles/ghc/tree/generics-instances. I didn't do Data, mostly because I ran out of steam - if people feel strongly about that I can come back and add it. What are the next steps to take? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by ekmett): For the `Data` instances can we just get away with using `DeriveDataTypeable` / standalone deriving? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by hvr): @ocharles I have to nitpick: could you please separate whitespace changes occurring in parts other than the lines you change into a separate commit? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by ocharles): hvr - as mentioned on Github, I was somewhat intending to squash this down into a single commit when I'm done. If you'd like, I could simply omit whitespace changes from this. My editor does it for me, so I sometimes forget it is happening :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by ocharles): Alright, I've responded to some comments and added more instances. Could people please have another look? I wrote out Data instances, but I have never actually used Data.Data, so I may have got that wrong. Is it possible to write Data instances for (:+:) and friends? My initial attempt was no, but I may have missed something. Latest code is at https://github.com/ocharles/ghc/tree/generics-instances (as before). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by ekmett): I'll show you how to write the instances for `(:+:)` and the like on IRC when I get a chance. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by ocharles): Ok, my branch has been updated with the Data instances. I think we're all done here! Here's the final diff that needs reviewing: https://github.com/ocharles/ghc/compare/master...generics-instances If people are happy with this, I will probably rewrite the branch to be a single commit, unless people feel the history here is relevant. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): I'm not following the details here, but if the core-libraries commmitte are happy please turn it into one comment and change to 'patch' status so that Austin can merge it. Thanks! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by hvr): Replying to [comment:10 ocharles]:
If people are happy with this, I will probably rewrite the branch to be a single commit, unless people feel the history here is relevant.
...please put whitespace changes in a separate commit though :-) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by dreixel): I've had a look at this, and all seems fine to me. One caveat however: {{{ instance (Data p, Data (f p), Typeable c, Typeable i, Typeable f) => Data (M1 i c f p) where }}} This `Typeable c` constraint will require changing the generation of `Generic` instances in GHC, because these `c`s are compiler-generated empty datatypes, which currently do not derive `Typeable`. Simon: what's the best way to do this? We need `Typeable` instances for the stuff generated by `mkBindsMetaD` in `TcGenGenerics`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Well I suppose you'd need to derive `Typeable` for these generated data types. Mind you, IIRC now that we have `DataKinds` I think the Generics stuff could be done much more neatly, dramatically reducing the number of generated data types. This is all code you wrote, Pedro, isn't it? So you are definitely free to improve it! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by dreixel): Replying to [comment:14 simonpj]:
Well I suppose you'd need to derive Typeable for these generated data types.
Ok, I'll do that; I hope it doesn't require much plumbing. Replying to [comment:14 simonpj]:
Mind you, IIRC now that we have `DataKinds` I think the Generics stuff could be done much more neatly, dramatically reducing the number of generated data types.
This is all code you wrote, Pedro, isn't it? So you are definitely free to improve it!
Sure. All I'm worried about is backwards-compatibility, and the lack of #6024 doesn't help. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): I'm all for #6024 if you want to tackle that :-)! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by ocharles): I'd be interested in helping tidy up the stuff in GHC.Generics to use data kinds, btw. So dreixel, if that's something that you think is somewhat obvious and wouldn't mind me doing it - just let me know! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by ocharles): Ok folks, I've squashed this down to just two commits now - one with instances and one with whitespace changes. I think we may be all ready to go, and we can derive typeable in a separate commit. It does mean that without that the Data instances are fairly useless. Thoughts? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------ Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by dreixel): Sounds good to me. Please leave the ticket open; it might still take me a few weeks to implementing the changes in GHC, but I think that's not a problem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature | Status: infoneeded request | Milestone: 7.10.1 Priority: normal | Version: 7.8.2 Component: | Keywords: libraries/base | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => infoneeded * milestone: => 7.10.1 Comment: Pedro, any updates on this? Should Ollie's changes be merged or do you have some other plans here? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature | Status: infoneeded request | Milestone: 7.10.1 Priority: normal | Version: 7.8.2 Component: | Keywords: libraries/base | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dreixel): Sorry for the delay; it's still in my to do list. His changes can be merged, though; perhaps it's best to do that earlier rather than later, to avoid conflicts. But please keep the ticket open; I'll close it once I make sure that the datatypes generated when deriving `Generic` have `Typeable` instances. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature | Status: infoneeded request | Milestone: 7.10.1 Priority: normal | Version: 7.8.2 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by dreixel): * cc: core-libraries-committee@… (added) Comment: Just a heads-up: I want to implement the changes described in the following wiki page, which would mean there are no longer internally generated datatypes for which we then need `Typeable` instances: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/GenericDeriving#Am... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:23 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature | Status: infoneeded request | Milestone: 7.10.1 Priority: normal | Version: 7.8.2 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by ekmett): So then we'd just be piggybacking on typeability of Symbols (and instances for MetaCons/MetaData) to get the `Typeable` instance for things like `M1 i c p`? I have vague recollections of Richard mentioning that having every Symbol/Nat be Typeable. I don't recall what came of it though. Do we have that now in HEAD? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:24 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature | Status: infoneeded request | Milestone: 7.10.1 Priority: normal | Version: 7.8.2 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: #8778 Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by dreixel): * related: => #8778 Comment: I think so... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:25 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature | Status: infoneeded request | Milestone: 7.10.1 Priority: normal | Version: 7.8.2 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: 9766 Unknown/Multiple | Related Tickets: #8778 Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by dreixel): * blockedby: => 9766 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:26 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature | Status: infoneeded request | Milestone: 7.10.1 Priority: normal | Version: 7.8.2 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: 9766 Unknown/Multiple | Related Tickets: #8778 Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by bgamari): What can we do to make sure this makes it in for 7.10? Perhaps it would make sense to split out the `Data` and `Typeable` changes so the other instances can be merged independently. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:27 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature | Status: infoneeded request | Milestone: 7.10.1 Priority: normal | Version: 7.8.2 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: 9766 Unknown/Multiple | Related Tickets: #8778 Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: bgamari (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:28 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature | Status: infoneeded request | Milestone: 7.10.1 Priority: normal | Version: 7.8.2 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: 9766 Unknown/Multiple | Related Tickets: #8778 Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dreixel): #9766 is now ready for review. If it all goes well, then this patch can be merged straight after. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:29 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature request | Status: infoneeded Priority: normal | Milestone: 7.12.1 Component: Core Libraries | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 9766 | Blocking: Related Tickets: #8778 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: RyanGlScott (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:31 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: Core Libraries | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 9766 | Blocking: Related Tickets: #8778 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): #9766, which had been blocking this for a while, has been fixed, so there's nothing holding this back at the moment. ocharles, would you be willing to rebase your work on top of `master`? You'll need to make some changes to work with the latest GHC: * `Typeable` instances are now derived automatically for everything, so you can remove those. * `Arity` has been removed from `GHC.Generics` * `GHC.Generics` has added some new datatypes: * `FixityI` was added as a type-level counterpart to `Fixity` (this probably doesn't need any instances) * A new data family (`URec`) was added to support `Generic(1)` instances for unboxed types. The data instances could probably use `Functor`, `Foldable`, and `Traversable` instances (I ''think'' those would be well- kinded, but I'd have to check.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:34 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: Core Libraries | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 9766 | Blocking: Related Tickets: #8778 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): I checked, and it turns out that derived `Traversable` instances for `URec` won't kind-check at the moment. This isn't a fundamental limitation of `Traversable`, however. I've opened #11174 regarding this issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:35 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: Core Libraries | Version: 7.8.2 Resolution: | Keywords: Generics Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 9766 | Blocking: Related Tickets: #8778 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * keywords: => Generics -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:36 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature request | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.8.2 Resolution: | Keywords: Generics Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 9766 | Blocking: Related Tickets: #8778 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by conal): * cc: conal (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:38 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: 8.0.1 Component: Core Libraries | Version: 7.8.2 Resolution: | Keywords: Generics Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 9766 | Blocking: Related Tickets: #8778 | Differential Rev(s): Phab:D1937 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D1937 * milestone: => 8.0.1 Comment: Here is a patch derived from ocharles' branch. Given that this is only a library change I'd be fine with sneaking this in to 8.0.1 if there's no objection. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:39 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics
-------------------------------------+-------------------------------------
Reporter: ocharles | Owner: dreixel
Type: feature request | Status: patch
Priority: normal | Milestone: 8.0.1
Component: Core Libraries | Version: 7.8.2
Resolution: | Keywords: Generics
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: 9766 | Blocking:
Related Tickets: #8778 | Differential Rev(s): Phab:D1937
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature request | Status: merge Priority: normal | Milestone: 8.0.1 Component: Core Libraries | Version: 7.8.2 Resolution: | Keywords: Generics Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 9766 | Blocking: Related Tickets: #8778 | Differential Rev(s): Phab:D1937 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:41 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature request | Status: merge Priority: normal | Milestone: 8.0.1 Component: Core Libraries | Version: 7.8.2 Resolution: | Keywords: Generics Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 9766 | Blocking: Related Tickets: #8778 | Differential Rev(s): Phab:D1937 Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): This patch tirggered the LLVM code gen bug in #11649. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:42 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9043: Add missing type class instances for data types in GHC.Generics -------------------------------------+------------------------------------- Reporter: ocharles | Owner: dreixel Type: feature request | Status: closed Priority: normal | Milestone: 8.0.1 Component: Core Libraries | Version: 7.8.2 Resolution: fixed | Keywords: Generics Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: 9766 | Blocking: Related Tickets: #8778 | Differential Rev(s): Phab:D1937 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9043#comment:43 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC