Last active
January 1, 2016 11:38
-
-
Save NathanHowell/8138977 to your computer and use it in GitHub Desktop.
GNTD regressions in GHC HEAD. This typechecks on 7.6.3 but not on 7.7.20131217 unless ImpredicativeTypes are enabled.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1 of 1] Compiling Repro ( repro.hs, interpreted ) | |
repro.hs:24:13: | |
Cannot instantiate unification variable ‛b0’ | |
with a type involving foralls: | |
(forall r. (a1 -> IO r) -> IO r) -> DecodeAST a1 | |
Perhaps you want ImpredicativeTypes | |
In the expression: | |
GHC.Prim.coerce | |
(anyContToM :: | |
(forall (r :: *). (a -> IO r) -> IO r) | |
-> AnyContT (StateT DecodeState IO) a) :: | |
forall (a :: *). | |
(forall (r :: *). (a -> IO r) -> IO r) -> DecodeAST a | |
In an equation for ‛anyContToM’: | |
anyContToM | |
= GHC.Prim.coerce | |
(anyContToM :: | |
(forall (r :: *). (a -> IO r) -> IO r) | |
-> AnyContT (StateT DecodeState IO) a) :: | |
forall (a :: *). | |
(forall (r :: *). (a -> IO r) -> IO r) -> DecodeAST a | |
Failed, modules loaded: none. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE RankNTypes #-} | |
-- Uncomment to compile on GHC 7.8 | |
-- {-# LANGUAGE ImpredicativeTypes #-} | |
module Repro where | |
import Control.Monad.Trans.Cont | |
import Control.Monad.Trans.State.Lazy | |
newtype AnyContT m a = AnyContT { unAnyContT :: forall r . ContT r m a } | |
class MonadAnyCont b m where | |
anyContToM :: (forall r . (a -> b r) -> b r) -> m a | |
instance MonadAnyCont b (AnyContT m) where | |
anyContToM _ = error "foo" | |
data DecodeState = DecodeState | |
newtype DecodeAST a = DecodeAST { unDecodeAST :: AnyContT (StateT DecodeState IO) a } | |
deriving (MonadAnyCont IO) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment