Implement UnliftedNewtypes proposal
The unlifted newtypes proposal is described here: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0013-unlifted-newtypes.rst
I am going to be working on it.
Trac metadata
Trac field | Value |
---|---|
Version | 8.4.3 |
Type | Task |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |
- Show closed items
Relates to
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Ömer Sinan Ağacan mentioned in issue #1311 (closed)
mentioned in issue #1311 (closed)
- Andrew Martin changed milestone to %8.6.1
changed milestone to %8.6.1
- Andrew Martin changed weight to 5
changed weight to 5
- Andrew Martin added Ttask Trac import labels
added Ttask Trac import labels
- Developer
(Does case of keywords even matter?)
- Ben Gamari changed milestone to %8.8.1
changed milestone to %8.8.1
- Maintainer
These won't be addressed in GHC 8.6.
Question: Would it be possible to introduce UnliftedNewtypes in one of the following releases (something like 8.6.3?)?
I have a use-case where levity-polymorphism would help, but it crucially relies on having levity polymorphic newtypes.
- Developer
No, new releases are for bug fixes. 8.8 will not be a very long time away. I don't even think the feature is implemented yet.
- Author Developer
We will definitely need to wait until 8.8. I've made some attempts at it on https://phabricator.haskell.org/D4777, but it still doesn't work right.
- Maintainer
Trac metadata
Trac field Value Related - → #1311 (closed) - Developer
- Developer
Trac metadata
Trac field Value Differential revisions - → D477 - Developer
- Ömer Sinan Ağacan changed milestone to %8.10.1
changed milestone to %8.10.1
- Maintainer
Bumping milestones of low-priority tickets.
just for motivation: I am still very much looking forward to this feature :) But I understand that there might be other priorities.
- Author Developer
This feature is nearly complete, but it has to wait for 8.10 since the 8.8 branch has already been cut. At this point, I'm just fixing little problems and documenting the implementation better. I'm looking forward to having this as well.
- Ryan Scott added ghc proposal label
added ghc proposal label
- Developer
What's the status on this? I would like for 8.10 to have:
#if WORD_SIZE_IN_BITS == 32 newtype Int# = Int# Int32# newtype Word# = Word# Word32# #elif WORD_SIZE_IN_BITS == 64 newtype Int# = Int# Int64# newtype Word# = Word# Word64# #else # error unsupported native word size #endif
I have a few preliminary things to tackle, but after that I would be blocked on this.
- Author Developer
This will certainly make it into 8.10. The MR is at !364 (closed). There is a single outstanding regression at the point.
- Author Developer
Ryan Scott figured out what caused the regression. This will likely get merged later today. Also, might I add, I'm very happy to see that someone has come up with a use for this extension that I didn't consider when writing the proposal. I guess this means that the kind of
Word#
would vary by platform and that you'd wantWordRep
as a type synonym:#if WORD_SIZE_IN_BITS == 32 type WordRep = 'Word32Rep #elif WORD_SIZE_IN_BITS == 64 type WordRep = 'Word64Rep #else error unsupported native word size #endif
I look forward to seeing an MR for this stuff. cc me when you put something up.
- Andrew Martin mentioned in commit 414e9735
mentioned in commit 414e9735
- Andrew Martin mentioned in commit effdd948
mentioned in commit effdd948
- Maintainer
Fixed in effdd948.
Testsuite-tests... well, there are too many to list here in a compact fashion. Just look at the commit diff :)
- Ryan Scott closed
closed
- Ryan Scott added UnliftedNewtypes label
added UnliftedNewtypes label
- Ben Gamari added Pnormal label
added Pnormal label