diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs
index febdf2f6d4b383d8e3d61bdf3e64b07574fb9800..0fc692eadbbbd6cd7353f76832089d556e8de195 100644
--- a/compiler/typecheck/FamInst.hs
+++ b/compiler/typecheck/FamInst.hs
@@ -570,16 +570,16 @@ unusedInjectiveVarsErr unused_tyvars errorBuilder tyfamEqn
= if not (null tyVars)
then text "Injective type variable" <> plural tyVars <+>
pprQuotedList tyVars <+> doOrDoes tyVars <+>
- text "not appear on injective position."
+ text "not appear on the right-hand side."
else empty
kiVarsSDoc
= if not (null kiVars)
then text "Injective kind variable" <> plural kiVars <+>
pprQuotedList kiVars <+> isOrAre kiVars <+>
- text "not inferable from the RHS type variables."
+ text "not inferrable from the RHS type variables."
else empty
in tyVarsSDoc $$ kiVarsSDoc $$
- text "In the RHS of type family equation:"
+ text "In the type family equation:"
-- | Build error message for equation that has a type family call at the top
-- level of RHS
diff --git a/testsuite/tests/ghci/scripts/T6018ghcifail.stderr b/testsuite/tests/ghci/scripts/T6018ghcifail.stderr
index e3a330e88e534bffca5a3119e1fb72ac40c0241c..d90dcce8975a65a6c713504f27d78274e966331d 100644
--- a/testsuite/tests/ghci/scripts/T6018ghcifail.stderr
+++ b/testsuite/tests/ghci/scripts/T6018ghcifail.stderr
@@ -22,14 +22,14 @@
:40:15: error:
Type family equation violates injectivity annotation.
- Injective type variable ‘b’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘b’ does not appear on the right-hand side.
+ In the type family equation:
J Int b c = Char
:44:15: error:
Type family equation violates injectivity annotation.
- Injective type variable ‘n’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘n’ does not appear on the right-hand side.
+ In the type family equation:
K ('S n) m = 'S m
:49:15: error:
@@ -39,27 +39,27 @@
:55:41: error:
Type family equation violates injectivity annotation.
- Injective kind variable ‘k’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective kind variable ‘k’ is not inferrable from the RHS type variables.
+ In the type family equation:
PolyKindVarsF '[] = '[]
:60:15: error:
Type family equation violates injectivity annotation.
- Injective kind variable ‘k1’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective kind variable ‘k1’ is not inferrable from the RHS type variables.
+ In the type family equation:
PolyKindVars '[] = '[]
:64:15: error:
Type family equation violates injectivity annotation.
- Injective kind variable ‘k’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective kind variable ‘k’ is not inferrable from the RHS type variables.
+ In the type family equation:
forall (k :: BOX) (a :: k) (b :: k). Fc a b = Int
:68:15: error:
Type family equation violates injectivity annotation.
- Injective type variables ‘a’, ‘b’ do not appear on injective position.
- Injective kind variable ‘k’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective type variables ‘a’, ‘b’ do not appear on the right-hand side.
+ Injective kind variable ‘k’ is not inferrable from the RHS type variables.
+ In the type family equation:
forall (k :: BOX) (a :: k) (b :: k). Gc a b = Int
:81:15: error:
@@ -95,8 +95,8 @@
:104:15: error:
Type family equation violates injectivity annotation.
- Injective type variable ‘b’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘b’ does not appear on the right-hand side.
+ In the type family equation:
G4 a b = [a]
:107:15: error:
@@ -106,6 +106,6 @@
:111:15: error:
Type family equation violates injectivity annotation.
- Injective type variable ‘a’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘a’ does not appear on the right-hand side.
+ In the type family equation:
G6 [a] = [HF1 a]
diff --git a/testsuite/tests/typecheck/should_fail/T6018fail.stderr b/testsuite/tests/typecheck/should_fail/T6018fail.stderr
index 2e0267a3b8317904b073df6456e9b9afa0d0b672..cb8d8abb6e80228a686d7b6c94733cb5c05a0a3d 100644
--- a/testsuite/tests/typecheck/should_fail/T6018fail.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6018fail.stderr
@@ -42,14 +42,14 @@ T6018fail.hs:37:15: error:
T6018fail.hs:42:15: error:
Type family equation violates injectivity annotation.
- Injective type variable ‘b’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘b’ does not appear on the right-hand side.
+ In the type family equation:
J Int b c = Char
T6018fail.hs:46:15: error:
Type family equation violates injectivity annotation.
- Injective type variable ‘n’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘n’ does not appear on the right-hand side.
+ In the type family equation:
K ('S n) m = 'S m
T6018fail.hs:51:15: error:
@@ -59,27 +59,27 @@ T6018fail.hs:51:15: error:
T6018fail.hs:59:10: error:
Type family equation violates injectivity annotation.
- Injective kind variable ‘k’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective kind variable ‘k’ is not inferrable from the RHS type variables.
+ In the type family equation:
PolyKindVarsF '[] = '[]
T6018fail.hs:62:15: error:
Type family equation violates injectivity annotation.
- Injective kind variable ‘k1’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective kind variable ‘k1’ is not inferrable from the RHS type variables.
+ In the type family equation:
PolyKindVars '[] = '[]
T6018fail.hs:66:15: error:
Type family equation violates injectivity annotation.
- Injective kind variable ‘k’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective kind variable ‘k’ is not inferrable from the RHS type variables.
+ In the type family equation:
forall (k :: BOX) (a :: k) (b :: k). Fc a b = Int
T6018fail.hs:70:15: error:
Type family equation violates injectivity annotation.
- Injective type variables ‘a’, ‘b’ do not appear on injective position.
- Injective kind variable ‘k’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective type variables ‘a’, ‘b’ do not appear on the right-hand side.
+ Injective kind variable ‘k’ is not inferrable from the RHS type variables.
+ In the type family equation:
forall (k :: BOX) (a :: k) (b :: k). Gc a b = Int
T6018fail.hs:75:15: error:
@@ -115,8 +115,8 @@ T6018fail.hs:103:15: error:
T6018fail.hs:106:15: error:
Type family equation violates injectivity annotation.
- Injective type variable ‘b’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘b’ does not appear on the right-hand side.
+ In the type family equation:
G4 a b = [a]
T6018fail.hs:110:15: error:
@@ -126,15 +126,15 @@ T6018fail.hs:110:15: error:
T6018fail.hs:113:15: error:
Type family equation violates injectivity annotation.
- Injective type variable ‘a’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘a’ does not appear on the right-hand side.
+ In the type family equation:
G6 [a] = [HF1 a]
T6018fail.hs:118:15: error:
Type family equation violates injectivity annotation.
- Injective type variable ‘c’ does not appear on injective position.
- Injective kind variable ‘k’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective type variable ‘c’ does not appear on the right-hand side.
+ Injective kind variable ‘k’ is not inferrable from the RHS type variables.
+ In the type family equation:
forall (k :: BOX) a b (c :: k). G7 a b c = [G7a a b c]
T6018fail.hs:129:1: error:
diff --git a/testsuite/tests/typecheck/should_fail/T6018failclosed.stderr b/testsuite/tests/typecheck/should_fail/T6018failclosed.stderr
index 452022d6ed8991027113686452ab20ee636458e4..e8fcef8896d72dd6d041fd7b19b8385248d34e9d 100644
--- a/testsuite/tests/typecheck/should_fail/T6018failclosed.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6018failclosed.stderr
@@ -23,9 +23,9 @@ T6018failclosed.hs:19:5:
T6018failclosed.hs:25:5:
Type family equation violates injectivity annotation.
- Injective type variable ‘b’ does not appear on injective position.
- Injective kind variable ‘k’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective type variable ‘b’ does not appear on the right-hand side.
+ Injective kind variable ‘k’ is not inferrable from the RHS type variables.
+ In the type family equation:
forall (k :: BOX) (k1 :: BOX) (b :: k) (c :: k1).
JClosed Int b c = Char
In the equations for closed type family ‘JClosed’
@@ -33,8 +33,8 @@ T6018failclosed.hs:25:5:
T6018failclosed.hs:30:5:
Type family equation violates injectivity annotation.
- Injective type variable ‘n’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘n’ does not appear on the right-hand side.
+ In the type family equation:
KClosed ('S n) m = 'S m
In the equations for closed type family ‘KClosed’
In the type family declaration for ‘KClosed’
@@ -62,8 +62,8 @@ T6018failclosed.hs:43:5:
T6018failclosed.hs:50:3:
Type family equation violates injectivity annotation.
- Injective type variable ‘a’ does not appear on injective position.
- In the RHS of type family equation:
+ Injective type variable ‘a’ does not appear on the right-hand side.
+ In the type family equation:
E2 a = 'False
In the equations for closed type family ‘E2’
In the type family declaration for ‘E2’
@@ -77,8 +77,8 @@ T6018failclosed.hs:61:3:
T6018failclosed.hs:66:5:
Type family equation violates injectivity annotation.
- Injective kind variable ‘k’ is not inferable from the RHS type variables.
- In the RHS of type family equation:
+ Injective kind variable ‘k’ is not inferrable from the RHS type variables.
+ In the type family equation:
forall (k :: BOX) (a :: k) (b :: k). Gc a b = Int
In the equations for closed type family ‘Gc’
In the type family declaration for ‘Gc’