Skip to content

Panic (on woefully incorrect code)

The following (very wrong) code causes a panic. The haskeline hackage package is required.

import System.Console.Haskeline
import Control.Monad.State.Strict

main = runStateT (runInputT settings loop) 0
   where 
       loop = do
         minput <- lift getInputLine "% "
         loop

settings :: Settings (StateT Int IO)
settings = setComplete comp defaultSettings
comp _ = do
  n <- get
  put (n+1)
  return ("", [Completion (show n) "" True])

The error:

[1 of 1] Compiling Main             ( test.hs, test.o )

test.hs:7:20:
    Couldn't match kind `* -> *' with `*'
    Expected type: [Char] -> InputT m0 (Maybe String)
      Actual type: [Char] -> InputT m0 (Maybe String)
    Kind incompatibility when matching types:
      [Char] :: * -> *
      [Char] :: *
    The function `lift'ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.3 for x86_64-unknown-linux):
        kindFunResult ghc-prim:GHC.Prim.*{(w) tc 34d}

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

PS: It was not clear to me whether to call this a compile-time crash or not. All I know is that the 'impossible' happened. :)

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler
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