Hello Eduard, Friday, July 31, 2009, 10:26:08 AM, you wrote:
>>> instance Num a => Num [a] where ... > But why then the following snippet doesn't cause ambiguity: > deep_fmap (++"a") "b" // -> "ba" > deep_fmap (++"a") ["b"] // -> ["ba"] > deep_fmap (++"a") [["b"]] // -> [["ba"]] because it doesn't involve any instances. if you will declare class Appendable a where (++) :: a -> a -> a instance Appendable String ... instance Appendable a => Appendable [a] ... instance IsString [a] ... -- class IsString, like class Num, defines conversion rules for string constants you will get into the same trouble -- Best regards, Bulat mailto:[email protected] _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
