The worst piece of syntax in Haskell

Ashley Yakeley ashley at semantic.org
Tue Feb 21 18:54:32 EST 2006


Sebastian Sylvan wrote:

>>Not quite the same complaint, but I've always been bothered by the
>>inconsistent use of "=>". I would prefer "A => B" to mean "if A, then
>>B". Accordingly:
>>
>>   class Monad m <= MonadPlus m
> 
> 
> By your definition, couldn't what we have now (class Monad m =>
> MonadPlus m) be read as "If m is in the Monad class, then the class
> MonadPlus can be defined for m thusly:...", which seems pretty clear
> to me.

Not to me. It's like saying "If f is a piece of furniture, then the set 
of chairs can be defined for f thusly", which seems equally unclear to me.

If m is in the Monad class... then what? It's not necessarily in the 
MonadPlus class. No useful inference can be drawn this way. What we mean 
to say instead is "if m is in the MonadPlus class, then it is in the 
Monad class".

-- 
Ashley Yakeley



More information about the Haskell-prime mailing list