Proposal: Performance improvements for Data.Set

Ian Lynagh igloo at earth.li
Fri Sep 3 12:26:33 EDT 2010


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  :-)


Other than that, and my standard .Internal comment, looks good.


Thanks
Ian



More information about the Libraries mailing list