[Haskell-cafe] classes inheritance seems not to work.
asker
spamisnothx-askme at yahoo.es
Sat Feb 18 16:47:21 EST 2006
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#a3010358
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/20060218/3f5af4dc/attachment.htm
More information about the Haskell-Cafe
mailing list