kindFunResult panic when type checking wrongly-kinded function
While working on some writing about recursion schemes and morphisms, I wrote the following well-known catamorphism:
import Control.Arrow
newtype Fix f = Fix { unFix :: f (Fix f) }
bottomUp f = unFix >>> fmap (bottomUp f) >>> Fix >>> f
On a lark, I decided to reverse the direction of the arrows in the above statement and see what the typechecker had to say about it:
nonsense f = unFix <<< fmap (nonsense f) <<< Fix <<< f
This function is (I think) not well-kinded, but during type checking (both from ghci and ghc) I get the following error:
ghc: panic! (the 'impossible' happened)
(GHC version 7.6.3 for i386-apple-darwin):
kindFunResult
<<details unavailable>>
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
I am running 32-bit GHC 7.6.3 (from the Haskell Platform) on an x86_64 machine running OS X 10.9. I have attached the output of ghc -v.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |