[GHC] #10753: Type checker fails to recognize equality

#10753: Type checker fails to recognize equality -------------------------------------+------------------------------------- Reporter: ljli | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- {{{#!hs {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE KindSignatures #-} module Test where import qualified Control.Monad.State as S class HasConns (m :: * -> *) where type Conn m foo :: (HasConns m, Monad m) => S.StateT (Conn m) m () foo = do _ <- S.get return () }}} This fails to compile with GHC 7.10.2: {{{ Could not deduce (S.MonadState (Conn m) (S.StateT (Conn m) m)) arising from a use of ‘S.get’ from the context (HasConns m, Monad m) bound by the type signature for foo :: (HasConns m, Monad m) => S.StateT (Conn m) m () }}} It compiles with GHC 7.8.4, though. Adding "Conn m ~ Conn m" to the type context of foo lets it compile again. This seems not right to me. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10753 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10753: Type checker fails to recognize equality -------------------------------------+------------------------------------- Reporter: ljli | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.2 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Yes this is a bug, actually a dup of #10340. Sadly the fix was not straightforward and won't end up in 7.10. I hope you can work around it meanwhile. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10753#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10753: Type checker fails to recognize equality -------------------------------------+------------------------------------- Reporter: ljli | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.2 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: indexed- valid program | types/should_compile/T10753 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => indexed-types/should_compile/T10753 * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10753#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10753: Type checker fails to recognize equality
-------------------------------------+-------------------------------------
Reporter: ljli | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.10.2
checker) |
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: GHC rejects | Test Case: indexed-
valid program | types/should_compile/T10753
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones
participants (1)
-
GHC