Skip to content

kindFunResult in monad transformer

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
}
Trac metadata
Trac field Value
Version 7.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information