Opened 4 years ago

Closed 18 months ago

#10774 closed bug (duplicate)

Use `Natural` rather than `Integer` in `GHC.TypeLits`

Reported by: hvr Owned by:
Priority: normal Milestone:
Component: libraries/base Version: 7.10.2
Keywords: TypeLits Natural Cc: diatchki, ekmett
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #13181 Differential Rev(s):
Wiki Page:

Description (last modified by hvr)

When the numeric type-literals were implement via GHC.TypeLits there was no Natural type in base yet. But since GHC 7.10 we finally have Natural available in base!

Specifically, the following 3 type-signatures in GHC.TypeLits contain Integers that ought rather be Naturals:

someNatVal :: Integer -> Maybe SomeNat

natVal :: forall n proxy. KnownNat n => proxy n -> Integer

natVal' :: forall n. KnownNat n => Proxy# n -> Integer

Change History (4)

comment:1 Changed 4 years ago by hvr

Description: modified (diff)

comment:2 Changed 4 years ago by thoughtpolice


Milestone renamed

comment:3 Changed 4 years ago by goldfire

Milestone: 8.0.1

Just went to fix this. But it has to wait until we won't use GHCs < 7.10 for bootstrapping. (I could make it all work without waiting, but it would be ugly. Far better to wait.)

(There is no milestone 8.2. Or would it be 8.4?)

We could also just change the interfaces while still storing Integers internally. But that would have performance implications.

comment:4 Changed 18 months ago by RyanGlScott

Resolution: duplicate
Status: newclosed

I believe this was fixed in #13181, so I'll close this as a duplicate.

Note: See TracTickets for help on using tickets.