[Haskell-cafe] deriving

PR Stanley prstanley at ntlworld.com
Mon Apr 7 12:43:10 EDT 2008

>data Bool = False | True
>  deriving (Eq, Or, Show, Read)
>Bool is an instance of Eq, Ord, Show and Read. It is derived form 
>these classes. If that is the meaning of the keyword deriving then 
>wouldn't a different keyword such as from or derivative or even 
>derivation be closer to the semantics of the concept?
>Discuss :-)

>I'm not getting it.  Are you thinking that Bool itself "is derived 
>from these classes", rather than those four instances for Bool?  - Conal

>I am aware that Bool is an instance of Eq, Ord, ... What I'm not 
>sure about is the terminology used here. Deriving, deriving what 
>from Eq, Ord, ...? How about

data Bool = False | True
         from (Eq, Ord, Show, Read)

although I have a feeling that "from" is already used somewhere in Haskell.


More information about the Haskell-Cafe mailing list