[GHC] #10429: GHC fails to import instance

#10429: GHC fails to import instance -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- The following code compiles in 7.8.4 but fails to compile in 7.10.1. Tagged.hs {{{#!hs module Tagged where import Control.Monad.Trans newtype TaggedT s m b = TagT (m b) instance MonadTrans (TaggedT s) }}} Main.hs {{{#!hs import Control.Monad.Trans.Class import Tagged returnT :: (MonadTrans t) => t m a -> t m a returnT a = undefined f :: TaggedT Int m a -> TaggedT Int m a f = returnT }}} GHC complains {{{ Could not deduce (MonadTrans (TaggedT Int)) arising from a use of ‘returnT’ }}} If I change the import in Main to `Control.Monad.Trans`, 7.10.1 accepts the program. Since the import `Control.Monad.Trans` is actually a folder, the class `MonadTrans` must refer to the definition in `Control.Monad.Trans.Class`, so GHC should find the instance. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10429 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10429: GHC fails to import instance -------------------------------------+------------------------------------- Reporter: crockeea | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => closed * resolution: => invalid Comment: You have two versions of `transformers` installed under 7.10. See http://www.yesodweb.com/blog/2014/09/woes-multiple-package-versions or search Google for "No instance for MonadTrans" for more information. Also see #9611 about improving the error message in this case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10429#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC