[Haskell-cafe] Re: Proposal: TypeDirectedNameResolution
Colin Paul Adams
colin at colina.demon.co.uk
Tue Jul 28 13:16:22 EDT 2009
>>>>> "Ryan" == Ryan Ingram <ryani.spam at gmail.com> writes:
Ryan> Along those lines, what about being able to elide class
Ryan> names when they can be unambiguously determined from the
Ryan> functions defined?
Ryan> instance _ [] where fmap = map pure x = [x] fs <*> xs = [ f
Ryan> x | f <- fs, x <- xs ] return x = [x] m >>= f = concatMap f
Ryan> m
Ryan> This would define Functor, Applicative, and Monad for [].
What happens if I define a class Foo with a method named fmap? If this
were in scope then Functor would no longer be defined for [].
Could this situation cause a problem?
--
Colin Adams
Preston Lancashire
More information about the Haskell-Cafe
mailing list