You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- GHC does not yet perform a worker-wrapper transformation on
-- unboxed sums automatically. That seems likely to happen at some
-- point (possibly as early as GHC 8.6) but for now we do it manually.
lookup k m =caselookup# k m of
(# (##) |#) ->Nothing
(#| a #) ->Just a
{-# INLINE lookup #-}
This means that these functions can only be inlined when they are applied to all their arguments too! For example lookup will not be inlined in this code
foo = lookup k . bar
Therefore it may be useful to reduce the arity of lookup and similar functions at least by one, e.g.
lookup k = \m -> case lookup# k m of …
The text was updated successfully, but these errors were encountered:
Many functions are currently defined with all their arguments on the LHS, e.g.
unordered-containers/Data/HashMap/Internal.hs
Lines 587 to 594 in 42a25db
This means that these functions can only be inlined when they are applied to all their arguments too! For example
lookup
will not be inlined in this codeTherefore it may be useful to reduce the arity of
lookup
and similar functions at least by one, e.g.The text was updated successfully, but these errors were encountered: