logo       

RE: Yet another External Core bug: msg#00060

lang.haskell.glasgow.bugs

Subject: RE: Yet another External Core bug

| The attached file (generated by running ghc -fext-core on the Fibheaps
| benchmark from the nofib suite) fails to typecheck:
|
| $ ghc -dcore-lint Fibheaps.hcr
|
| Couldn't match `#' against `*'
| Expected kind: #
| Inferred kind: *
| When checking kinds in `GHC.Prim.(->) (GHC.Prim.State# s)'

I've found what's going on here. Here is the comment from the
definition of the type constructor for (->):

funTyCon = mkFunTyCon funTyConName
(mkArrowKinds [liftedTypeKind, liftedTypeKind]
liftedTypeKind)
-- You might think that (->) should have type (? -> ? -> *), and
you'd be right
-- But if we do that we get kind errors when saying
-- instance Control.Arrow (->)
-- becuase the expected kind is (*->*->*). The trouble is that
the
-- expected/actual stuff in the unifier does not go
contra-variant, whereas
-- the kind sub-typing does. Sigh. It really only matters if
you use (->) in
-- a prefix way, thus: (->) Int# Int#. And this is unusual.


In short, it's really a bug, but not a particularly easy one to fix.
Rumination required. But it probably only happens on a few programs,
right?

S


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise