#8603: GHC crashes on some code using StateT monad transformer --------------------------------------------+------------------------------ Reporter: person1729 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Compile-time crash | (amd64) Test Case: Attached | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: --------------------------------------------+------------------------------ Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"8721743e88f4c8c385eb0ceb0ca6804b2143a8fa/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="8721743e88f4c8c385eb0ceb0ca6804b2143a8fa" Re-factor TcCanonical (again), fixes Trac #8603 This is a substantial refactoring of the canonicaliser. The proximate cause was that we were sometimes failing to correctly orient a tyvar/tyvar equality (x ~ y), because the kind of x or y was not fully zonked at the moment we compared them. That in turn led me to look closely at the way that canEvNC (which decomposes equalities) worked. * The big change is that the 'reOrient' and 'classify' functions are gone, along with classify's 'TypeClassifier' return type. Instead the re-orientation is built into canEqNC. When we find a type variable we divert into canEqTyVar, and so on, very much as in TcUnify. * TcCanonical.canEqTyVar, canEqLeafFun, etc now carry a SwapFlag (to reduce duplication), just as in TcUnify; now SwapFlag itself is defined in BasicTypes * I renamed TcSMonad.rewriteCtFlavor to rewriteEvidence, * I added a new specialised version of rewriteEvidence, called TcSMonad.rewriteEqEvidence. It is easier to use, and removes the crafty but brain-mangling higher order casts that we were using before. The result is not exactly simpler, but it's pretty clear and, I think, significantly more efficient. And it fixes Trac #8603! }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8603#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler