INLINE pragma bogus

Milan Straka fox at
Fri Sep 24 05:08:16 EDT 2010


> In Data.Map we see
> mapKeysMonotonic :: (k1->k2) -> Map k1 a -> Map k2 a
> mapKeysMonotonic _ Tip = Tip
> mapKeysMonotonic f (Bin sz k x l r) =
>     Bin sz (f k) x (mapKeysMonotonic f l) (mapKeysMonotonic f r)
> {-# INLINE mapKeysMonotonic #-}
> But mapKeysMonotonic is recursive, so it isn't going to get inlined. Lint bleats about this.
> Remove the pragma?

or we could do worker/wrapper transformation which would make
mapKeysMonotonic non-recursive.

> Same for Data.IntMap.submapCmp, which is again recursive.
> Incidentally submapCmp  is a MASSIVE function to put an INLINE pragma on!  Do you really need this much inlining?

I did not put the inlines all over the place, and I happily agree to
remove it :) I will take care of it in the INLINE problem patch.


More information about the Libraries mailing list