On Fri, Sep 3, 2010 at 5:26 PM, Ian Lynagh <igloo@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.