[GHC] #12989: ($) can have a more general type

GHC ghc-devs at haskell.org
Fri Dec 16 00:59:24 UTC 2016


#12989: ($) can have a more general type
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 I don't know whether this would be kosher, but one possibility would be to
 skip the kind check on `arg1_ty` in the type checker special case for
 `arg1 $ arg2` and then rewrite the expression into {{{arg1 `good` arg2}}}.
 (Or for that matter, into a direct application `arg1 arg2`.) That would
 never change semantics because it only applies to a saturated application
 of `($)` in the first place.

 You still wouldn't be able to use `($)` with unboxed argument type in a
 higher-order context, but at least you would be able to write things like
 `I# $ x# +# y +# z#`.

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


More information about the ghc-tickets mailing list