seq as type class method
Duncan Coutts
duncan.coutts at googlemail.com
Mon Nov 9 11:41:10 EST 2009
On Mon, 2009-11-09 at 12:19 +0000, Henning Thielemann wrote:
> On Mon, 9 Nov 2009, Neil Mitchell wrote:
>
> >> | -- | This makes GHC's optimiser happier; it sometimes produces really bad
> >> | -- code for single-method dictionaries
> >> | --
> >> | unlifted_dummy :: a
> >> | unlifted_dummy = error "unlifted_dummy"
> >>
> >> If you have such cases, please please boil it down and file it as a bug. We should get *better* code not worse for
> >> single-method dictionaries.
> >
> > I benchmarked this when doing the Uniplate work - 1-member classes
> > gave a noticeable performance benefit over 2 or more members. I think
> > it was 6% or so in my setup, and as a result Uniplate has a single
> > member type class.
>
> I assume the case in stream-fusion:Data.Stream was vice versa: A one
> member class seemed to make performance worse .Thus they added a dummy
> method.
I believe Roman reported the problem at the time and I think that it got
fixed.
Duncan
More information about the Libraries
mailing list