Bug: GHC hangs rather than reporting an occurs check error

Hi all, I've found a case where GHC will hang (consuming more and more memory) when it should report an occurs check error. The test case is at http://fushizen.net/~bd/kaos-ghc.loop.tgz - the error in question is that the arguments in the StateT instance for HOLift are reversed like so: diff --git a/src/Kaos/KaosM.hs b/src/Kaos/KaosM.hs index ec4e69a..268250a 100644 --- a/src/Kaos/KaosM.hs +++ b/src/Kaos/KaosM.hs @@ -88,7 +88,7 @@ genlift' unbox box f m = box $ \s -> f (unbox m s) class HOLift m b | m -> b where genlift :: (forall r'. b r' -> b r') -> (forall r. m r -> m r) -instance HOLift m (StateT s m) where +instance HOLift (StateT s m) m where genlift = genlift' runStateT StateT instance (HOLift m b, KaosDiagM r b) => KaosDiagM r m where Thanks, Bryan Donlan

On Thu, Mar 20, 2008 at 2:38 AM, Bryan Donlan
Hi all,
I've found a case where GHC will hang (consuming more and more memory) when it should report an occurs check error. The test case is at http://fushizen.net/~bd/kaos-ghc.loop.tgz - the error in question is that the arguments in the StateT instance for HOLift are reversed like so:
Forgot to mention this, but I'm using GHC 6.8.2 on ubuntu hardy.

On Thu, Mar 20, 2008 at 02:38:56AM -0400, Bryan Donlan wrote:
This gives me "403 Forbidden". Thanks Ian

On Thu, Mar 20, 2008 at 10:43 AM, Ian Lynagh
On Thu, Mar 20, 2008 at 02:38:56AM -0400, Bryan Donlan wrote:
This gives me "403 Forbidden".

On Thu, Mar 20, 2008 at 02:38:56AM -0400, Bryan Donlan wrote:
I've found a case where GHC will hang (consuming more and more memory) when it should report an occurs check error. The test case is at http://fushizen.net/~bd/kaos-ghc.loop.tgz - the error in question is that the arguments in the StateT instance for HOLift are reversed like so:
-instance HOLift m (StateT s m) where +instance HOLift (StateT s m) m where
I haven't looked at this in detail, but you have enabled the UndecidableInstances extension, so it's not necessarily a bug if the type checker goes into a loop. Thanks Ian
participants (2)
-
Bryan Donlan
-
Ian Lynagh