[GHC] #13689: Data.Either doesn't export INLINABLE short functions like "rights"
GHC
ghc-devs at haskell.org
Fri May 12 15:29:13 UTC 2017
#13689: Data.Either doesn't export INLINABLE short functions like "rights"
-------------------------------------+-------------------------------------
Reporter: varosi | Owner: (none)
Type: bug | Status: infoneeded
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):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by bgamari):
* cc: nomeata (added)
Comment:
CCing Joachim who has thought a great deal about fusion.
I think the simplest option here is to just to do as varosi suggests and
add INLINEABLE pragmas. Yes, we could give `lefts` and `rights` the same
treatment that we give `filter` and give it a "trivial" definition,
alongside some fusible definitions with rules to map one to the other, but
I think this is a lot of complexity for little pay-off.
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.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13689#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list