Proposal: Performance improvements for Data.Set

Johan Tibell johan.tibell at gmail.com
Fri Sep 3 14:20:55 EDT 2010


On Fri, Sep 3, 2010 at 5:26 PM, Ian Lynagh <igloo at earth.li> wrote:

> On Tue, Aug 31, 2010 at 03:07:41PM +0200, Johan Tibell wrote:
> > Ticket: http://hackage.haskell.org/trac/ghc/ticket/4280
>
> > -size t
> > -  = case t of
> > -      Tip          -> 0
> > -      Bin sz _ _ _ -> sz
> > +size = go
> > +  where
> > +    go Tip            = 0
> > +    go (Bin sz _ _ _) = sz
> > +{-# INLINE size #-}
>
> Perhaps just
>
>    size Tip            = 0
>    size (Bin sz _ _ _) = sz
>
> would suffice  :-)
>

Yes, you're right. This function doesn't actually benefit from W/W as it
doesn't have any higher-order arguments, dictionaries or polymorphic
arguments.

I will take a second pass over all the code after the proposal period is
over. With fresh eyes I might be able to spot more things that could be
fixed/improved.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20100903/3dd1b028/attachment.html


More information about the Libraries mailing list