[GHC] #13603: Can't resolve levity polymorphic superclass

#13603: Can't resolve levity polymorphic superclass -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple LevityPolymorphism, TypeInType | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This works {{{#!hs {-# Language PolyKinds, TypeInType #-} import GHC.Exts (TYPE, RuntimeRep) class A (a :: TYPE rep) class A a => B (a :: TYPE rep) instance A b => A (a -> (b :: TYPE rep)) instance B b => B (a -> b) }}} but the moment you add (`b :: TYPE rep`) to the last line it stops working {{{#!hs -- t3I7.hs:9:10-40: error: … -- • Could not deduce (A b) -- arising from the superclasses of an instance declaration -- from the context: B b -- bound by the instance declaration at /tmp/t3I7.hs:9:10-40 -- • In the instance declaration for ‘B (a -> b)’ -- Compilation failed. {-# Language PolyKinds, TypeInType #-} import GHC.Exts (TYPE, RuntimeRep) class A (a :: TYPE rep) class A a => B (a :: TYPE rep) instance A b => A (a -> (b :: TYPE rep)) instance B b => B (a -> (b :: TYPE rep)) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13603 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13603: Can't resolve levity polymorphic superclass -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | LevityPolymorphism, TypeInType 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 goldfire): Seems to be fixed in HEAD; I can't reproduce. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13603#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13603: Can't resolve levity polymorphic superclass -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | LevityPolymorphism, TypeInType Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3489 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D3489 * milestone: => 8.2.1 Comment: It works in GHC 8.2 too! Commit b207b536ded40156f9adb168565ca78e1eef2c74 (Generalize kind of the (->) tycon) was what fixed it. I've added a regression test in Phab:D3489. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13603#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13603: Can't resolve levity polymorphic superclass -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | LevityPolymorphism, TypeInType Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3489 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Fantastic, I have to get the latest version -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13603#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13603: Can't resolve levity polymorphic superclass
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
| LevityPolymorphism, TypeInType
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3489
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott

#13603: Can't resolve levity polymorphic superclass -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | LevityPolymorphism, TypeInType Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T13603 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3489 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * testcase: => typecheck/should_compile/T13603 * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13603#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13603: Can't resolve levity polymorphic superclass -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | LevityPolymorphism, TypeInType Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T13603 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3489 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: comment:4 merged in 1bc7429d921ae8a1c82773b9c6dde0395d1514d4. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13603#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13603: Can't resolve levity polymorphic superclass -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | LevityPolymorphism, TypeInType Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T13603 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3489 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Out of curiosity, can any of those `TYPE rep` annotations be omitted in ''HEAD'' while retaining levity polymorphism? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13603#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13603: Can't resolve levity polymorphic superclass -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | LevityPolymorphism, TypeInType Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T13603 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3489 Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): I doubt it. Levity polymorphism is opt-in. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13603#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC