[GHC] #10423: Can't infer Monad n from (Monad m, m ~ n)

#10423: Can't infer Monad n from (Monad m, m ~ n) -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 (Type checker) | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- This looks like a regression in GHC HEAD. {{{ Test/SmallCheck/Property.hs:187:10: Could not deduce (Monad n) arising from the superclasses of an instance declaration from the context: (Monad m, m ~ n) bound by the instance declaration at Test/SmallCheck/Property.hs:187:10-52 Possible fix: add (Monad n) to the context of the instance declaration In the instance declaration for ‘Testable n (Property m)’ }}} The code is here: https://github.com/feuerbach/smallcheck/blob/v1.1.1/Test/SmallCheck/Property... Originally reported here: https://github.com/feuerbach/smallcheck/issues/28 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10423 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10423: Can't infer Monad n from (Monad m, m ~ n) -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): This is my fault, fallout from my removal of "silent superclasses". I understand what is happening here. It is clearly a bug. I think that if you replace {{{ instance (Monad m, m ~ n) => Testable n (Property m) where }}} by putting `Monad n` in the context, thus {{{ instance (Monad n, m ~ n) => Testable n (Property m) where }}} it'll probably work. It'll be a couple of weeks before I can actually fix it. Thanks very much for the report. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10423#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10423: Can't infer Monad n from (Monad m, m ~ n)
-------------------------------------+-------------------------------------
Reporter: Feuerbach | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.11
checker) | Keywords:
Resolution: | Architecture:
Operating System: Unknown/Multiple | Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10423: Can't infer Monad n from (Monad m, m ~ n)
-------------------------------------+-------------------------------------
Reporter: Feuerbach | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.11
checker) | Keywords:
Resolution: | Architecture:
Operating System: Unknown/Multiple | Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10423: Can't infer Monad n from (Monad m, m ~ n) -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | typecheck/should_compile/T10423 Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => typecheck/should_compile/T10423 * resolution: => fixed Comment: Fixed, thank you. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10423#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC