
#10281: Type error with Rank-n-types -------------------------------------+------------------------------------- Reporter: rhjl | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.1 checker) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | Peirce_eq_LEM.hs Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rhjl): Thank you for your explanations! I think that I now understand the issue. I find your explanation of impredicative polymorphism better than the one given in the GHC manual: This means that you can call a polymorphic function at a polymorphic type, and parameterise data structures over polymorphic types. The hint about `newtype` wrappers also helped me to adjust the module to work with `RankNTypes`. I did not realise that `newtype` wrappers hide the polymorphism of the type they wrap. I think that a remark of this sort in the section on rank-n-types of the GHC manual would also help. By the way: this issue with impredicative instantiations precludes the use of `($)` and `(.)` to get rid of excessive parenthesis in certain situations. Is there a workaround? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10281#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler