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

GHC ghc-devs at haskell.org
Fri May 12 15:17:15 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:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 I have confirmed that these two indeed don't have an unfolding in 8.0.2,
 {{{#!hs
 2155eed1475edba07fc3c0eac3a8a1c2
   rights :: [Either a b] -> [b]
   {- Arity: 1, HasNoCafRefs, Strictness: <S,1*U>,
      Unfolding: (\ @ a @ b (x :: [Either a b]) -> rights1 @ a @ b x) -}
 39075b0896f5b6036d022994b88a19f9
   rights1 :: [Either a b] -> [b]
   {- Arity: 1, HasNoCafRefs, Strictness: <S,1*U> -}
 }}}

 Moreover, this,
 {{{#!hs
 import Data.Either

 main = print $ sum $ rights [ Right i | i <- [1..500] ]
 }}}

 exhibits a call to `rights1`. It seems we really do need an explicit
 `INLINABLE` here.

 Thanks for pointing this out, varosi.

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


More information about the ghc-tickets mailing list