[GHC] #7927: Error in 'lift' line causes the 'impossible' to happen

GHC cvs-ghc at haskell.org
Fri May 24 10:04:51 CEST 2013


#7927: Error in 'lift' line causes the 'impossible' to happen
---------------------------------+------------------------------------------
  Reporter:  MitchellSalad       |          Owner:                
      Type:  bug                 |         Status:  closed        
  Priority:  normal              |      Milestone:                
 Component:  Compiler            |        Version:  7.6.3         
Resolution:  duplicate           |       Keywords:                
        Os:  Linux               |   Architecture:  x86_64 (amd64)
   Failure:  Compile-time crash  |     Difficulty:  Unknown       
  Testcase:                      |      Blockedby:                
  Blocking:                      |        Related:                
---------------------------------+------------------------------------------
Changes (by simonpj):

  * status:  new => closed
  * difficulty:  => Unknown
  * resolution:  => duplicate


Old description:

> import Control.Monad.Trans.Class (lift)
> import Control.Monad.Trans.Maybe (MaybeT)
>
> foo :: MaybeT IO ()
> foo = lift putStrLn "foo"
>
> --------
>
> This code caused the following output from GHC:
>
> Couldn't match kind `* -> *' with `*'
>     Expected type: [Char] -> MaybeT IO ()
>       Actual type: [Char] -> MaybeT IO ()
>     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
> <<details unavailable>>
>
> --------
>
> The line should of course be 'lift $ putStrLn "foo"'. Apologies if this
> is a duplicate bug.

New description:

 {{{
 import Control.Monad.Trans.Class (lift)
 import Control.Monad.Trans.Maybe (MaybeT)

 foo :: MaybeT IO ()
 foo = lift putStrLn "foo"
 }}}

 This code caused the following output from GHC:
 {{{
 Couldn't match kind `* -> *' with `*'
     Expected type: [Char] -> MaybeT IO ()
       Actual type: [Char] -> MaybeT IO ()
     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
 <<details unavailable>>
 }}}

 The line should of course be `lift $ putStrLn "foo"`. Apologies if this is
 a duplicate bug.

--

Comment:

 Yes I think it's a dup of some combination of #7920, #7905, #7696, #7513.
 (There are some more; search Trac for "kindFunResult".)

 Works in HEAD:
 {{{
 T7927.hs:7:7:
     Couldn't match type ‛(->) String’ with ‛[Char]’
     Expected type: [Char] -> MaybeT IO ()
       Actual type: t0 ((->) String) (MaybeT IO ())
     The function ‛lift’ is applied to two arguments,
     but its type ‛(String -> MaybeT IO ())
                   -> t0 ((->) String) (MaybeT IO ())’
     has only one
     In the expression: lift putStrLn "foo"
     In an equation for ‛foo’: foo = lift putStrLn "foo"

 T7927.hs:7:12:
     Couldn't match type ‛IO ()’ with ‛MaybeT IO ()’
     Expected type: String -> MaybeT IO ()
       Actual type: String -> IO ()
     In the first argument of ‛lift’, namely ‛putStrLn’
     In the expression: lift putStrLn "foo"
 }}}


 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7927#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list