Wed, 24 Oct 2001 10:32:07 +1300
Jan-Willem Maessen writes:
| * Split the Enum class into two. Possibly "correspondence with Int"
| belongs in "Bounded"---but it depends what you think "Bounded"
FWIW I sometimes use a data type for the very purpose of adding bounds
to an open-ended type.
data Close a
| Mid a
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.