Opened 21 months ago

Last modified 20 months ago

#10774 new bug

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: 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 (3)

comment:1 Changed 21 months ago by hvr

Description: modified (diff)

comment:2 Changed 20 months ago by thoughtpolice


Milestone renamed

comment:3 Changed 20 months 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.

Note: See TracTickets for help on using tickets.