[Haskell-cafe] Monoid wants a (++) equivalent

Jules Bean jules at jellybean.co.uk
Thu Jul 2 07:46:37 EDT 2009

Ross Paterson wrote:
> On Wed, Jul 01, 2009 at 10:55:39AM -0700, Bryan O'Sullivan wrote:
>> Okay, here's a tentative plan that will help to figure out the answer. I'll
>> build a fiddled base package that rewires the Monoid class to have (++) be the
>> binary operator, and mappend as a synonym for it. I'll import the Monoid (++)
>> into the Prelude. I'll see how much breaks. If that much builds smoothly, I'll
>> see how much of the rest of Hackage builds, both with and without this custom
>> base package. I'll follow up here with the results, along with a suggestion of
>> how acceptable I think the observed level of breakage is.
> Generalizing (++) will break some Haskell 98 code, e.g.
>   append = (++)
> I think that's a show-stopper.

I agree it's an issue; and it's the reason I didn't even suggest it 
myself, favouring a new symbol.

I don't think it's a show stopper, in principle. In principle you can 
imagine a -h98 flag which you pass to compilers which choose a strictly 
h98-compliant prelude as opposed to a slightly generalised newer one.

I'm not the person who would have to maintain that arrangement. I guess 
that's a call for the people who would have to do the work. There is 
already a haskell98 package, I think, which is the first step?


More information about the Haskell-Cafe mailing list