
2 Jun
2018
2 Jun
'18
5:36 a.m.
Tom Ellis
I'm a bit surprised that whilst `Either` and `(,)` have instances for `Ord`
* `(,)` has no instance for `Enum` * `Either` has no instance for `Enum` or `Bounded`
Is there a particular reason for that? It might be tricky to implement
toEnum :: Int -> a fromEnum :: a -> Int
but in the presence of `Bounded` that should be possible.
You don’t need Bounded to do that. For example, you could start at (0,0) and go out in diamond shaped rings. A more pressing reason is that there are too many possible enumerations, and if we picked one it would probably be the wrong one for most applications. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk