• David Feuer's avatar
    Inline partially-applied wrappers · 2be364ac
    David Feuer authored
    Suppose we have
    
    ```
    data Node a = Node2 !Int a a | Node3 !Int a a a
    instance Traversable Node where
      traverse f (Node2 s x y) = Node2 s <$> f x <*> f y
      ...
    
    ```
    
    Since `Node2` is partially applied, we wouldn't inline its
    wrapper.  The result was that we'd box up the `Int#` to put
    the box in the closure passed to `fmap`. We now allow the wrapper
    to inline when partially applied, so GHC stores the `Int#`
    directly in the closure.
    
    Reviewers: rwbarton, mpickering, simonpj, austin, bgamari
    
    Reviewed By: simonpj, bgamari
    
    Subscribers: mpickering, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2891
    
    GHC Trac Issues: #12990
    2be364ac
all.T 17.2 KB