[GHC] #13689: Data.Either doesn't export INLINABLE short functions like "rights"

GHC ghc-devs at haskell.org
Fri May 12 21:32:46 UTC 2017


#13689: Data.Either doesn't export INLINABLE short functions like "rights"
-------------------------------------+-------------------------------------
        Reporter:  varosi            |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect API     |  Unknown/Multiple
  annotation                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3576
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Replying to [comment:8 bgamari]:

 > In general this does raise the point though of being careful about
 defining library functions in terms of list comprehensions as they make
 definitions look much smaller than they in fact are. If we make `lefts`
 and `rights` `INLINEABLE` then we also ought to look for other functions
 in `base` defined in terms of comprehensions.

 I don't think the unfoldings are any bigger than they need to be, but
 you're right; we need to think about `INLINABLE` annotations when we might
 not otherwise. I believe the inliner gives a bonus when it sees things
 that are mentioned in `RULES`. If we don't do so already, we should surely
 give a similar bonus when deciding whether to export an unfolding.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13689#comment:16>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list