[GHC] #7802: kindFunResult in monad transformer

#7802: kindFunResult in monad transformer -------------------------------+-------------------------------------------- Reporter: tobsan | Owner: Type: bug | Status: new Priority: normal | Component: Compiler (Type checker) Version: 7.6.1 | Keywords: Os: Linux | Architecture: x86_64 (amd64) Failure: Compile-time crash | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- This is probably related to the existing (fixed?) bug(s) about kindFunResult, but better safe than sorry. I was writing a brainfuck interpreter, and tried changing this code: {{{ getptrval = gets mem >>= \a -> gets ptr >>= lift . readArray a }}} to this (which probably wouldn't even work): {{{ getptrval = liftM2 (lift . readArray) (gets ptr) (gets mem) }}} which gives this error message from GHC: {{{ Brainfuck.hs:53:21:ghc: panic! (the 'impossible' happened) (GHC version 7.6.1 for x86_64-unknown-linux): kindFunResult <<details unavailable>> }}} Related type information: {{{ type BFMonad a = StateT BFState IO a data BFState = BF { pc, ptr :: Int, mem :: IOUArray Int Int, program :: UArray Int Char } }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7802 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7802: kindFunResult in monad transformer -------------------------------+-------------------------------------------- Reporter: tobsan | Owner: Type: bug | Status: closed Priority: normal | Component: Compiler (Type checker) Version: 7.6.1 | Resolution: duplicate Keywords: | Os: Linux Architecture: x86_64 (amd64) | Failure: Compile-time crash Blockedby: | Blocking: Related: | -------------------------------+-------------------------------------------- Changes (by monoidal): * status: new => closed * resolution: => duplicate Comment: Thanks for the report. In fact "getptrval = liftM2 lift" is enough to trigger panic in GHC 7.6. This is fixed in the development version (bugs #7368, #7441). [You might have wanted something like `liftM2 (\a b -> lift (readArray a b)) (gets mem) (gets ptr)` but I did not check whether that works.] -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7802#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC