Skip to content

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

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
Edited by Herbert Valerio Riedel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information