Jan-Willem Maessen writes:
 | * Split the Enum class into two.  Possibly "correspondence with Int"
 |   belongs in "Bounded"---but it depends what you think "Bounded"
 |   means.

FWIW I sometimes use a data type for the very purpose of adding bounds
to an open-ended type.

    data Close a
        = Lo
        | Mid a
        | Hi
        deriving (Eq, Ord, Show)

    instance Bounded (Close a) where
        minBound = Lo
        maxBound = Hi

This leads to an Enum instance where pred Hi = Hi, fromEnum Hi = _|_,
etc., which I don't intend to use but is necessary for making Close
Integer an instance of Integral.

- Tom

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to