[GHC] #12989: ($) can have a more general type
GHC
ghc-devs at haskell.org
Tue Dec 20 10:57:42 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) | Keywords:
Resolution: | LevityPolymorphism
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by simonpj):
* keywords: => LevityPolymorphism
Comment:
Worth reading our [https://www.microsoft.com/en-us/research/publication
/levity-polymorphism/ levity polymorphism paper].
`good` is OK because no value of type `a` is manipulated by the code for
`good` (see the paper). NB: care is needed during optimisation: eta
expansion (to get `bad`) is not allowed.
So, yes, perhaps `($)` could be defied like `good`, as an arity-1
function. Then it could have the more generous type.
I'll add this to the levity-polymorphism pile; see
[wiki:LevityPolymorphism]
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12989#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list