Thomas Girod wrote:
> Hi there.
> 
> I'm trying to define a generic graph type here and don't understand on
> one error I get. Here I come.
> 
> module Graph
>      where
> 
> class (Eq n, Eq e) => Topo a n e where
>     empty    :: a
>     nodes    :: a -> [n]
>     edges    :: a -> [e]

This does not work without functional dependencies. Try:

 class (Eq n, Eq e) => Topo a n e | a -> n e where

HTH Christian

P.S. Integer comes in via defaulting (of 0 or 1)
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to