summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/main/DynFlags.hs1
-rw-r--r--compiler/typecheck/TcType.lhs3
-rw-r--r--docs/users_guide/flags.xml5
3 files changed, 7 insertions, 2 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index e3de00655f..8f6f45dc75 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1658,6 +1658,7 @@ impliedFlags
, (Opt_LiberalTypeSynonyms, turnOn, Opt_ExplicitForAll)
, (Opt_ExistentialQuantification, turnOn, Opt_ExplicitForAll)
, (Opt_PolymorphicComponents, turnOn, Opt_ExplicitForAll)
+ , (Opt_FlexibleInstances, turnOn, Opt_TypeSynonymInstances)
, (Opt_RebindableSyntax, turnOff, Opt_ImplicitPrelude) -- NB: turn off!
diff --git a/compiler/typecheck/TcType.lhs b/compiler/typecheck/TcType.lhs
index 89aba6504f..50ac35ab50 100644
--- a/compiler/typecheck/TcType.lhs
+++ b/compiler/typecheck/TcType.lhs
@@ -956,6 +956,9 @@ tcInstHeadTyAppAllTyVars :: Type -> Bool
-- Used in Haskell-98 mode, for the argument types of an instance head
-- These must be a constructor applied to type variable arguments
tcInstHeadTyAppAllTyVars ty
+ | Just ty' <- tcView ty -- Look through synonyms
+ = tcInstHeadTyAppAllTyVars ty'
+ | otherwise
= case ty of
TyConApp _ tys -> ok tys
FunTy arg res -> ok [arg, res]
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index c8e5dfc1d6..2bcb5e6d93 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -990,8 +990,9 @@
</row>
<row>
<entry><option>-XFlexibleInstances</option></entry>
- <entry>Enable <link linkend="instance-rules">flexible instances</link>.</entry>
- <entry>dynamic</entry>
+ <entry>Enable <link linkend="instance-rules">flexible instances</link>.
+ Implies <option>-XTypeSynonymInstances</option> </entry>
+ <entry>dynamic</entry>
<entry><option>-XNoFlexibleInstances</option></entry>
</row>
<row>