logo       

Re: unexpected arithmetic sequence and deriving Enum behaviour: msg#00140

lang.haskell.glasgow.bugs

Subject: Re: unexpected arithmetic sequence and deriving Enum behaviour

Simon,

Laszlo presented some code:

Consider the following code fragment:
data Colour = Red | Black | Blue deriving (Show, Bounded)
instance Enum Colour where

...

and then remarked:

Notice that there is no deriving Enum (which would be an error according to the Report)

You asked:

Why do you say that? Can you give a pointer to the relevant text in the report? I can't see anything wrong here.

I think he was referring to the fact that it is illegal to both *derive* and *define* an instance of a particular class for a type.

Regards,

Stefan


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise