id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
1865,GHCi debugger crashes with :print,cdsmith@…,,"To reproduce:

1. Enter the following code into a source file:

{{{
{-# LANGUAGE NoMonomorphismRestriction #-}

d (i, j) = i + j

dmerge xs     [] = xs
dmerge []     ys = ys
dmerge (x:xs) (y:ys) | d x <  d y = x : dmerge xs     (y:ys)
                     | d x == d y = x : dmerge xs     ys
                     | otherwise  = y : dmerge (x:xs) ys

pairs xs = head xs : pairs (tail xs `dmerge` map (\(i,j) -> (i+1,j+1)) xs
                                    `dmerge` map (\(i,j) -> (i,  j+1)) xs)

allpairs = pairs [(1,2)]
}}}

2. Start ghci, and pass this file as a parameter.

3. Type `:print allpairs`

GHCi will crash.

{{{
cdsmith@devtools:~/haskell/projects/euler$ ghci -ignore-dot-ghci BugTest.hs
GHCi, version 6.9.20071101: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( BugTest.hs, interpreted )
Ok, modules loaded: Main.
*Main> :print allpairs
*** Exception: ghci/Debugger.hs:84:11-72: Irrefutable pattern failed for pattern Data.Maybe.Just subst

ghc-6.9.20071101: panic! (the 'impossible' happened)
  (GHC version 6.9.20071101 for i386-unknown-linux):
        ghci/Debugger.hs:84:11-72: Irrefutable pattern failed for pattern Data.Maybe.Just subst


Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
}}}

Note that it does not crash without the LANGUAGE directive, so this appears to have something to do with the polymorphic type.

{{{
cdsmith@devtools:~/haskell/projects/euler$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.9.20071101
}}}",bug,closed,normal,6.8.2,GHCi,6.9,duplicate,,,Unknown/Multiple,Unknown/Multiple,,Unknown,,,,
