PDA

View Full Version : instance declaration


davidk01
04-13-2005, 11:58 PM
Suppose I have some class Toona and I would like to declare a Boolean tuple as an instance of Toona. So here is my question. Is this valid haskell code?

instance (Bool u,Bool v) => Toona (u,v) where
{here i define the required functions
that are in the signature of Toona}

davidk01
04-14-2005, 12:10 AM
It is actually invalid code and the way to do it is like this
instance Toona (u,v) where
{functions are defined here and the variables
u and v become actual types when the functions are written down}