[Haskell-cafe] No Enum for (,), no Enum or Bounded for Either

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Fri Jun 1 18:10:20 UTC 2018


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.

Tom




More information about the Haskell-Cafe mailing list