Hi John,
Here is the case I was talking about (transformers + 'global-optimize'):
> import Control.Monad.Trans.Class (lift)
> import Control.Monad.Trans.Error
> x :: ErrorT String IO ()
> x = lift (print "hello") >> return ()
> main = runErrorT x
This code fails to compile with 'global-optimize' enabled:
Collected Compilation...
-- TypeAnalyzeMethods
-- BoxifyProgram
-- Boxy WorkWrap
Stack:
transformProgram: Simplify-SuperSimplify after Boxy WorkWrap
jhc: E.TypeCheck.getType: (EPi x20202872::Jhc.Prim.IO.State_ Jhc.Prim.IO.RealWorld::*::# (EAp Jhc@.Box.*::* (EVar x20202872::Jhc.Prim.IO.State_ Jhc.Prim.IO.RealWorld::*::#)),#,Jhc@.Box.*::*)
My original code (which is still too big) fails with very similar error.
However, if you change line:
> x = lift (print "hello") >> return ()
to:
> x = lift (print "hello")
then it is compiled successfully.
Thanks!