[GHC] #10774: Use `Natural` rather than `Integer` in `GHC.TypeLits`

GHC ghc-devs at haskell.org
Sat Aug 15 08:23:53 UTC 2015


#10774: Use `Natural` rather than `Integer` in `GHC.TypeLits`
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       Component:  libraries/base    |                 Version:  7.10.2
      Resolution:                    |                Keywords:  TypeLits
                                     |  Natural
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------
Description changed by hvr:

Old description:

> 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` cpmtaom
> `Integer` that ought rather be `Natural`s:
>
> {{{#!hs
> someNatVal :: Integer -> Maybe SomeNat
>
> natVal :: forall n proxy. KnownNat n => proxy n -> Integer
>
> natVal' :: forall n. KnownNat n => Proxy# n -> Integer
> }}}

New description:

 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
 `Integer`s that ought rather be `Natural`s:

 {{{#!hs
 someNatVal :: Integer -> Maybe SomeNat

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

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

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10774#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list