[GHC] #2044: "Can't unify" error in debugger

GHC trac at galois.com
Sun Apr 6 23:14:58 EDT 2008


#2044: "Can't unify" error in debugger
--------------------+-------------------------------------------------------
 Reporter:  r6144   |          Owner:  simonpj
     Type:  bug     |         Status:  new    
 Priority:  normal  |      Milestone:  6.8.3  
Component:  GHCi    |        Version:  6.8.2  
 Severity:  normal  |     Resolution:         
 Keywords:          |     Difficulty:  Unknown
 Testcase:          |   Architecture:  x86    
       Os:  Linux   |  
--------------------+-------------------------------------------------------
Comment (by r6144):

 -XImpredicativeTypes (implied by -fglasgow-exts) appears to be necessary
 for array1.hs as well as igloo's simpler example.

 To make the original array1.hs compile with GHC 6.9.20080323, I have to
 expand the do statements involving polymorphic lambda-bound variables,
 e.g. "do { w <- writeRandoms ; return (newArray_ (0,n-1) >>= w) }" into
 "writeRandoms >>= \w -> return (newArray_ (0,n-1) >>= w)".  If I
 understand correctly, -XImpredicativeTypes allows w to be polymorphic.

 After this modification, array1.hs (called array1-orig.hs below) compiles,
 but the original problem persists:

 {{{
 [haskell]$ ~/apps/ghc-6.9.20080323/bin/ghci
 GHCi, version 6.9.20080323: http://www.haskell.org/ghc/  :? for help
 Loading package base ... linking ... done.
 Prelude> :load array1-orig.hs
 [1 of 1] Compiling Main             ( array1-orig.hs, interpreted )
 Ok, modules loaded: Main.
 *Main> :break rsRandomArray
 Breakpoint 0 activated at array1-orig.hs:(32,0)-(43,86)
 *Main> main
 Loading package array-0.1 ... linking ... done.
 Loading package old-locale-1.0 ... linking ... done.
 Loading package old-time-1.0 ... linking ... done.
 Loading package random-1.0 ... linking ... done.
 Array 1: array Stopped at array1-orig.hs:(32,0)-(43,86)
 _result :: ST s (UArray Idx Double) = _
 [array1-orig.hs:(32,0)-(43,86)] *Main> :step
 Stopped at array1-orig.hs:32:21-53
 ghc-6.9.20080323: panic! (the 'impossible' happened)
   (GHC version 6.9.20080323 for i386-unknown-linux):
         Can't unify

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

 [array1-orig.hs:32:21-53] *Main> :quit
 Leaving GHCi.
 [
 }}}

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


More information about the Glasgow-haskell-bugs mailing list