[Haskell-cafe] classes inheritance seems not to work.

asker spamisnothx-askme at yahoo.es
Sun Feb 19 11:49:49 EST 2006










Looks like I finally subscribed to the list, sorry if this message is
duplicated:
 
 
Hi,
 
I'm trying to make three haskell classes 
and an instance this way:
 ------------------------------------------------------------------------------

class (Eq a) => Graph a where
    vert :: [a]
    ady  :: a -> [a]
    
class (Graph a) => Paths a where
    gps    :: a -> a -> [[a]]
    

class (Paths a) => Minimum a where
    mgps   :: a -> a -> [a]
    
instance Minimum Char where
    vert = ['a' .. 'f'] -- This is the line of the error message.

    ady 'a' = ['b', 'c']
    ady 'b' = ['d', 'c', 'e']
    ady 'd' = ['f']
    gps = bepgr -- bepgr is defined and implemented in other code's part
    mgps = head gps
------------------------------------------------------------------------------


 
When I try to run this I get: "ERROR: 
filepath:line -No member vert in class "Minimum"" I don't know why does this 
happen, am I doing something wrong?
 
Thank you.


--
View this message in context: http://www.nabble.com/classes-inheritance-seems-not-to-work.-t1148006.html#a3018001
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20060219/cb1b89fc/attachment.htm


More information about the Haskell-Cafe mailing list