
21 Nov
2002
21 Nov
'02
2:55 a.m.
G'day all. On Wed, Nov 20, 2002 at 08:44:36PM -0500, Mike T. Machenry wrote:
I am trying to construct an infinate list of pairs of random colors. I am hung up on getting a random color. I have:
data Color = Blue | Red | Green deriving (Eq, Ord, Show)
am I supposed to instantiate a Random class instance from color?
You could derive instances of Enum (and possibly also Bounded) and create random elements that way. Cheers, Andrew Bromage