[GHC] #10390: Constraint order must match with RankNTypes

#10390: Constraint order must match with RankNTypes -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.8.4 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- In the following code, GHC will not compile unless the constraints on the higher-rank function have the same *order* as the method declaration in `ApPair`. {{{#!hs {-# LANGUAGE RankNTypes #-} class ApPair r where apPair :: (forall a . (ApPair a, Num a) => Maybe a) -> Maybe r instance (ApPair a, ApPair b) => ApPair (a,b) where apPair = apPair' apPair' :: (ApPair b, ApPair c) => (forall a . (ApPair a, Num a) => Maybe a) -> Maybe (b,c) apPair' f = let (Just a) = apPair f (Just b) = apPair f in Just $ (a, b) }}} That is, the following does *not* compile: {{{#!hs apPair' :: (ApPair b, ApPair c) => (forall a . (Num a, ApPair a) => Maybe a) -> Maybe (b,c) apPair' f = let (Just a) = apPair f (Just b) = apPair f in Just $ (a, b) }}} GHC probably shouldn't care about lexical matching when checking constraints. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10390 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10390: Constraint order must match with RankNTypes
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner:
Type: bug | Status: new
Priority: low | Milestone:
Component: Compiler | Version: 7.8.4
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10390: Constraint order must match with RankNTypes -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: closed Priority: low | Milestone: 7.10.3 Component: Compiler | Version: 7.8.4 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T10390 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * testcase: => typecheck/should_compile/T10390 * resolution: => fixed * milestone: => 7.10.3 Comment: Already fixed. Milestone should really be 7.10.1 or 7.10.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10390#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC