
#10443: Regression in forall typechecking
-------------------------------------+-------------------------------------
Reporter: alanz | Owner:
Type: bug | Status: new
Priority: high | Milestone: 7.10.2
Component: Compiler | Version: 7.10.1
(Type checker) | Operating System: Unknown/Multiple
Keywords: | Type of failure: GHC rejects
Architecture: | valid program
Unknown/Multiple | Blocked By:
Test Case: | Related Tickets:
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
The following bug showed up when trying to install ghc-mod against the
current ghc-7.10 branch
Ths code below, from
https://github.com/DanielG/ghc-
mod/blob/b52c0a5d767282369f2748c5ec070b802ed8e23c/Language/Haskell/GhcMod/Monad/Types.hs#L346
{{{#!hs
instance (MonadBaseControl IO m) => MonadBaseControl IO (GhcModT m) where
type StM (GhcModT m) a =
StM (StateT GhcModState
(ErrorT GhcModError
(JournalT GhcModLog
(ReaderT GhcModEnv m) ) ) ) a
liftBaseWith f = GhcModT . liftBaseWith $ \runInBase ->
f $ runInBase . unGhcModT
restoreM = GhcModT . restoreM
{-# INLINE liftBaseWith #-}
{-# INLINE restoreM #-}
}}}
Which compiles fine with GHC 7.10.1 now has the error
{{{
Language/Haskell/GhcMod/Monad/Types.hs:346:13:
Couldn't match expected type ‘StateT
GhcModState
(ErrorT GhcModError (JournalT
GhcModLog (ReaderT GhcModEnv m)))
a1
-> IO (StM m (Either GhcModError (a1,
GhcModState), GhcModLog))’
with actual type ‘forall a2.
StateT
GhcModState
(ErrorT GhcModError (JournalT
GhcModLog (ReaderT GhcModEnv m)))
a2
-> IO
(StM
(StateT
GhcModState
(ErrorT
GhcModError
(JournalT GhcModLog
(ReaderT GhcModEnv m))))
a2)’
Relevant bindings include
runInBase :: forall a.
StateT
GhcModState
(ErrorT GhcModError (JournalT GhcModLog (ReaderT
GhcModEnv m)))
a
-> IO
(StM
(StateT
GhcModState
(ErrorT GhcModError (JournalT GhcModLog
(ReaderT GhcModEnv m))))
a)
(bound at Language/Haskell/GhcMod/Monad/Types.hs:345:48)
f :: RunInBase (GhcModT m) IO -> IO a
(bound at Language/Haskell/GhcMod/Monad/Types.hs:345:18)
liftBaseWith :: (RunInBase (GhcModT m) IO -> IO a) -> GhcModT m a
(bound at Language/Haskell/GhcMod/Monad/Types.hs:345:5)
In the first argument of ‘(.)’, namely ‘runInBase’
In the second argument of ‘($)’, namely ‘runInBase . unGhcModT’
}}}
A laborious git bisect tracked it down to
{{{
681d82c0d44f06f0b958b75778c30b0910df982b is the first bad commit
commit 681d82c0d44f06f0b958b75778c30b0910df982b
Author: Simon Peyton Jones