[GHC] #14542: Renamer / typechecker hang (UndecidableSuperClasses)
GHC
ghc-devs at haskell.org
Wed Nov 29 13:03:39 UTC 2017
#14542: Renamer / typechecker hang (UndecidableSuperClasses)
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.3
Resolution: | Keywords:
| UndecidableSuperClasses
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
Well, every given `(Category p)` constraint will give rise to four
superclasses
{{{
class (Functor p, Dom p ~ Op p, Cod p ~ Nat p (->), Ob (Op p) ~ Ob p) =>
Category (p :: Cat i) where
}}}
That `Functor p` constraint will give rise to two `(Category (Dom p),
Category (Cod p))` constraints.
{{{
class (Category (Dom f), Category (Cod f)) => Functor (f :: i -> j) where
}}}
And so on. So in each round of superclass expansion we get double the
number of constraints. Result: exponential blowup.
So I'd say this is expected bahaviour.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14542#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list