Hi Bas,
Hello,
Now that we have DefaultSignatures, why is it not allowed to have
multiple default method implementations, as in:
{-# LANGUAGE DefaultSignatures #-}
class Foo a where
foo :: a
foo = error "foo"
default foo :: Num a => a
foo = 1
GHC complains: "Conflicting definitions for `foo'"
The following use of multiple default signatures also gives the same error:
class Foo a where
foo :: a
default foo :: Fractional a => a
foo = 0.5
default foo :: Num a => a
foo = 1
Couldn't GHC always pick the most specific default method, just as it
does with instances when OverlappingInstances is enabled?
Regards,
Bas
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users