
#14880: GHC panic: updateRole -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.2.2 checker) | Resolution: | Keywords: TypeInType Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #15076 | Differential Rev(s): Phab:D4769 Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Question: is it more efficient to use `closeOverKinds (unionVarSet set1 set2)` than `unionVarSet (closeOverKinds set1) (closeOverKinds set2)`? If so, I think the way `nonDetCmpTypes` is currently implemented is inefficient. We currently have: {{{#!hs nonDetCmpTypes :: [Type] -> [Type] -> Ordering nonDetCmpTypes ts1 ts2 = nonDetCmpTypesX rn_env ts1 ts2 where rn_env = mkRnEnv2 (mkInScopeSet (tyCoVarsOfTypes ts1 `unionVarSet` tyCoVarsOfTypes ts2)) }}} In particular, note this part: {{{#!hs tyCoVarsOfTypes ts1 `unionVarSet` tyCoVarsOfTypes ts2 }}} `tyCoVarsOfTypes` calls `closeOverKinds`, so we're calling `closeOverKinds` once more than is necessary. Perhaps this should be written like this? {{{#!hs tyCoVarsOfTypes (ts1 ++ ts2) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14880#comment:46 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler