Hi, 

I got the following error message with 2.10:

MyFiniteMap.lhs:857: Compiler bug: kind mis-match between
                         `ta1XZ' :: `*' and `Int#' :: `*#'
    Expected: `Int#'
    Inferred: `ta1XZ'
    In the second argument of `put', namely `size'
    In a do statement: `sizePid <- put pjsl size'


But in fact it was not a compiler bug, but a programming error!

This was my code:

    put pjsl (Branch key elt size fm_l fm_r) = 
        do
          sizePid <- put pjsl size
          ...

In this code, put takes an Int as its last argument, but I was
passing an unboxed Int because the datatype is defined like this:


#if __GLASGOW_HASKELL__
#define IF_GHC(a,b) a
#else /* not GHC */
#define IF_GHC(a,b) b
#endif /* not GHC */

data FiniteMap key elt
  = EmptyFM
  | Branch key elt              -- Key and elt stored here
    IF_GHC(Int#,Int{-STRICT-})  -- Size >= 1
    (FiniteMap key elt)         -- Children
    (FiniteMap key elt)


It wasn't difficult at all to spot and fix the problem, but just in
case you wanted to change the error message for these cases.

-------------------------------------------------------------------------------
Fermin J. Reig
PhD student, Department of Computing Science, University of Glasgow
http://www.dcs.gla.ac.uk/~reig



Reply via email to