diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-12-15 14:26:13 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-12-15 14:33:32 +0000 |
commit | 6eabb6ddb7c53784792ee26b1e0657bde7eee7fb (patch) | |
tree | af17a00ab5a30d1ab9a9a11a4786f0f239fe82b4 /testsuite/tests/polykinds/T7594.hs | |
parent | b8ca64592e331005def4f734e026d5418950e6e1 (diff) | |
download | haskell-6eabb6ddb7c53784792ee26b1e0657bde7eee7fb.tar.gz |
Allow recursive (undecidable) superclasses
This patch fulfils the request in Trac #11067, #10318, and #10592,
by lifting the conservative restrictions on superclass constraints.
These restrictions are there (and have been since Haskell was born) to
ensure that the transitive superclasses of a class constraint is a finite
set. However (a) this restriction is conservative, and can be annoying
when there really is no recursion, and (b) sometimes genuinely recursive
superclasses are useful (see the tickets).
Dimitrios and I worked out that there is actually a relatively simple way
to do the job. It’s described in some detail in
Note [The superclass story] in TcCanonical
Note [Expanding superclasses] in TcType
In brief, the idea is to expand superclasses only finitely, but to
iterate (using a loop that already existed) if there are more
superclasses to explore.
Other small things
- I improved grouping of error messages a bit in TcErrors
- I re-centred the haddock.compiler test, which was at 9.8%
above the norm, and which this patch pushed slightly over
Diffstat (limited to 'testsuite/tests/polykinds/T7594.hs')
-rw-r--r-- | testsuite/tests/polykinds/T7594.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T7594.hs b/testsuite/tests/polykinds/T7594.hs index 18da70342c..ae21956d45 100644 --- a/testsuite/tests/polykinds/T7594.hs +++ b/testsuite/tests/polykinds/T7594.hs @@ -1,11 +1,13 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE Rank2Types #-} + module T7594 where import GHC.Exts (Constraint) |