Re: Computing the final representation type of a TyCon (Was: Unpack primitive types by default in data)
Johan Tibell <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.cvs.ghc |
|---|---|
| Message-ID | <CAK-tuPYrDVtMAJ4qAbZcQGq3VfPAgSWKQyRxHR+jTWSXOcqotg@mail.gmail.com> |
On Thu, Dec 6, 2012 at 6:06 AM, Simon Peyton-Jones <[email protected]> wrote: > Johan > > Yes broadly that looks like the right kind of thing. > > I think it'd be better to look more like "can_unbox". So first check for a product tycon (ie one data constructor), then deal with newtypes, and *then* do something different, namely check whether the (single) data con has zero or one fields, and recurse. > > Since it's all flag-controlled you could push and I can subsequently edit I did some cleaning to the best of my ability and pushed the result as http://hackage.haskell.org/trac/ghc/changeset/566920c77bce252d807e9a7cc3da862e5817d340 Feel free to edit to your hearts content. I also added a should_compile to the test suite. Cheers, Johan