23 Oct
2001
23 Oct
'01
11:32 p.m.
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