I donβt quite understand why this works perfectly:
[9223372036854775809..9223372036854775815] :: [Integer]
These are integers that are greater than maxBound :: Int. However, these are the type signatures of the two most important functions Enum:
toEnum :: Int -> a
fromEnum :: a -> Int
As you can see, they have Intwhich is limited.
So why did it work?
Clarification:
The point of my question is this: not enumFromTodefined in terms of toEnumand fromEnum? And since these two only work on regular Ints, how enumFromTo(for which ..is syntactic sugar) work for Integers?
source
share