Closed tmcgilchrist closed 6 years ago
Thanks Tim!
I think this might be problematic though, it looks like the singletons library switched its export of natval from GHC.TypeLits
to GHC.TypeNats
in version 2.4. So This is going to pull in different definitions depending on which compiler one is using.
The TypeNats one has existed for long enough, so maybe we should just swap to that for all the compilers.
So digging through base looks like GHC.TypeNats
came in Since: base-4.10.0.0
, which means ghc 8.2.1 and above 1.
I didn't see this PR, but i fixed everything to build with 8.4.3 in #75
Thanks guys.
I'm still a bit iffy on using the Natural version in 8.2 and above, and the Integer version in 7.10 and 8.0; but I'm not sure there's a great way around that apart from dropping support for the older ones.
I'll merge the other PR. I would prefer to use Natural going forwards.
:+1:
A few changes in here:
natVal
On the last point I'm not entirely convinced I've chosen the right source of
natVal
. An example of the compile error is:with the two type signatures being:
GHC.TypeLits.natVal :: forall n proxy. KnownNat n => proxy n -> Integer
Data.Singletons.TypeLits.natVal :: KnownNat n => proxy n -> Natural
The change to
Natural
insingletons
causes some issues in the test cases, which is why the tests useGHC.TypeLits.natVal
rather than the singletons version.