Commit 55ca1085 authored by Richard Eisenberg's avatar Richard Eisenberg Committed by Marge Bot

Fix #17405 by not checking imported equations

Previously, we checked all imported type family equations
for injectivity. This is very silly. Now, we check only
for conflicts.

Before I could even imagine doing the fix, I needed to untangle
several functions that were (in my opinion) overly complicated.
It's still not quite as perfect as I'd like, but it's good enough
for now.

Test case: typecheck/should_compile/T17405
parent fa25c8c4
Pipeline #12523 failed with stages
in 297 minutes and 25 seconds
This diff is collapsed.
......@@ -50,7 +50,7 @@ import TcEnv ( tcInitTidyEnv, tcInitOpenTidyEnv )
import FunDeps
import FamInstEnv ( isDominatedBy, injectiveBranches,
InjectivityCheckResult(..) )
import FamInst ( makeInjectivityErrors )
import FamInst
import Name
import VarEnv
import VarSet
......@@ -2031,8 +2031,8 @@ checkValidCoAxiom ax@(CoAxiom { co_ax_tc = fam_tc, co_ax_branches = branches })
; let conflicts =
fst $ foldl' (gather_conflicts inj prev_branches cur_branch)
([], 0) prev_branches
; mapM_ (\(err, span) -> setSrcSpan span $ addErr err)
(makeInjectivityErrors dflags ax cur_branch inj conflicts) }
; reportConflictingInjectivityErrs fam_tc conflicts cur_branch
; reportInjectivityErrors dflags ax cur_branch inj }
| otherwise
= return ()
......
......@@ -202,7 +202,7 @@ pprCoAxiom ax@(CoAxiom { co_ax_tc = tc, co_ax_branches = branches })
2 (vcat (map (pprCoAxBranchUser tc) (fromBranches branches)))
pprCoAxBranchUser :: TyCon -> CoAxBranch -> SDoc
-- Used when printing injectivity errors (FamInst.makeInjectivityErrors)
-- Used when printing injectivity errors (FamInst.reportInjectivityErrors)
-- and inaccessible branches (TcValidity.inaccessibleCoAxBranch)
-- This happens in error messages: don't print the RHS of a data
-- family axiom, which is meaningless to a user
......
......@@ -895,6 +895,13 @@ conditions hold:
There are subtleties here. See Note [Coverage condition for injective type families]
in FamInst.
Check (1) must be done for all family instances (transitively) imported. Other
checks (2-4) should be done just for locally written equations, as they are checks
involving just a single equation, not about interactions. Doing the other checks for
imported equations led to #17405, as the behavior of check (4) depends on
-XUndecidableInstances (see Note [Coverage condition for injective type families] in
FamInst), which may vary between modules.
See also Note [Injective type families] in TyCon
-}
......
......@@ -49,6 +49,8 @@ module Util (
changeLast,
whenNonEmpty,
-- * Tuples
fstOf3, sndOf3, thdOf3,
firstM, first3M, secondM,
......@@ -137,6 +139,7 @@ import Data.Data
import Data.IORef ( IORef, newIORef, atomicModifyIORef' )
import System.IO.Unsafe ( unsafePerformIO )
import Data.List hiding (group)
import Data.List.NonEmpty ( NonEmpty(..) )
import GHC.Exts
import GHC.Stack (HasCallStack)
......@@ -610,6 +613,10 @@ changeLast [] _ = panic "changeLast"
changeLast [_] x = [x]
changeLast (x:xs) x' = x : changeLast xs x'
whenNonEmpty :: Applicative m => [a] -> (NonEmpty a -> m ()) -> m ()
whenNonEmpty [] _ = pure ()
whenNonEmpty (x:xs) f = f (x :| xs)
{-
************************************************************************
* *
......
......@@ -7,11 +7,12 @@ T8165_fail1.hs:17:12: error:
• In the newtype declaration for ‘MyInt’
T8165_fail1.hs:25:8: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
S Int = Char -- Defined at T8165_fail1.hs:25:8
S WrappedInt = S Int -- Defined at T8165_fail1.hs:28:12
T8165_fail1.hs:28:12: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation cannot be a type family:
S WrappedInt = S Int -- Defined at T8165_fail1.hs:28:12
<interactive>:10:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
F Char Bool Int = Int -- Defined at <interactive>:10:15
F Bool Int Char = Int -- Defined at <interactive>:11:15
<interactive>:16:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
I Int Char Bool = Bool -- Defined at <interactive>:16:15
I Int Int Int = Bool -- Defined at <interactive>:17:15
<interactive>:26:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation cannot be a type family:
IdProxy a = Id a -- Defined at <interactive>:26:15
<interactive>:34:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation is a bare type variable
but these LHS type and kind patterns are not bare variables: ‘'Z’
P 'Z m = m -- Defined at <interactive>:34:15
<interactive>:40:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type variable ‘b’ cannot be inferred from the right-hand side.
In the type family equation:
J Int b c = Char -- Defined at <interactive>:40:15
<interactive>:44:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type variable ‘n’ cannot be inferred from the right-hand side.
In the type family equation:
K ('S n) m = 'S m -- Defined at <interactive>:44:15
<interactive>:49:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation cannot be a type family:
L a = MaybeSyn a -- Defined at <interactive>:49:15
<interactive>:55:41: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type/kind variable ‘k1’
cannot be inferred from the right-hand side.
In the type family equation:
......@@ -46,7 +48,7 @@
-- Defined at <interactive>:55:41
<interactive>:60:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type/kind variable ‘k1’
cannot be inferred from the right-hand side.
In the type family equation:
......@@ -54,14 +56,14 @@
-- Defined at <interactive>:60:15
<interactive>:64:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type/kind variable ‘k’ cannot be inferred from the right-hand side.
In the type family equation:
forall k (a :: k) (b :: k).
Fc @k a b = Int -- Defined at <interactive>:64:15
<interactive>:68:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type/kind variables ‘k’, ‘a’, ‘b’
cannot be inferred from the right-hand side.
In the type family equation:
......@@ -69,49 +71,54 @@
Gc @k a b = Int -- Defined at <interactive>:68:15
<interactive>:81:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
F1 [a] = Maybe (GF1 a) -- Defined at <interactive>:81:15
F1 (Maybe a) = Maybe (GF2 a) -- Defined at <interactive>:82:15
<interactive>:85:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation is a bare type variable
but these LHS type and kind patterns are not bare variables: ‘[a]’
W1 [a] = a -- Defined at <interactive>:85:15
<interactive>:88:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation cannot be a type family:
W2 [a] = W2 a -- Defined at <interactive>:88:15
<interactive>:92:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
Z1 [a] = (a, a) -- Defined at <interactive>:92:15
Z1 (Maybe b) = (b, [b]) -- Defined at <interactive>:93:15
<interactive>:96:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
G1 [a] = [a] -- Defined at <interactive>:96:15
G1 (Maybe b) = [(b, b)] -- Defined at <interactive>:97:15
<interactive>:100:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
G3 a Int = (a, Int) -- Defined at <interactive>:100:15
G3 a Bool = (Bool, a) -- Defined at <interactive>:101:15
<interactive>:104:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type variable ‘b’ cannot be inferred from the right-hand side.
In the type family equation:
G4 a b = [a] -- Defined at <interactive>:104:15
<interactive>:107:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
G5 [a] = [GF1 a] -- Defined at <interactive>:107:15
G5 Int = [Bool] -- Defined at <interactive>:108:15
<interactive>:111:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type variable ‘a’ cannot be inferred from the right-hand side.
In the type family equation:
G6 [a] = [HF1 a] -- Defined at <interactive>:111:15
{-# LANGUAGE TypeFamilyDependencies, UndecidableInstances #-}
module T17405a where
data D a
type family F a = r | r -> a
type instance F (D a) = D (F a)
{-# LANGUAGE TypeFamilyDependencies #-}
module T17405b where
type family F2 a
type instance F2 Int = Bool
module T17405c where
import T17405a
import T17405b
......@@ -293,3 +293,4 @@ test('T16632', normal, compile, ['-Wunused-type-patterns -fdiagnostics-show-care
test('T16828', normal, compile, [''])
test('T17008b', normal, compile, [''])
test('T17056', normal, compile, [''])
test('T17405', normal, multimod_compile, ['T17405c', '-v0'])
T6018th.hs:98:4: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
H Int Int Int = Bool -- Defined at T6018th.hs:98:4
H Int Char Bool = Bool -- Defined at T6018th.hs:98:4
T10836.hs:5:5: error:
Type family equations violate injectivity annotation:
Foo Int = Int -- Defined at T10836.hs:5:5
Foo Bool = Int -- Defined at T10836.hs:6:5
In the equations for closed type family ‘Foo’
In the type family declaration for ‘Foo’
• Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
Foo Int = Int -- Defined at T10836.hs:5:5
Foo Bool = Int -- Defined at T10836.hs:6:5
• In the equations for closed type family ‘Foo’
In the type family declaration for ‘Foo’
T10836.hs:9:5: error:
Type family equations violate injectivity annotation:
Bar Int = Int -- Defined at T10836.hs:9:5
Bar Bool = Int -- Defined at T10836.hs:10:5
In the equations for closed type family ‘Bar’
In the type family declaration for ‘Bar’
• Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
Bar Int = Int -- Defined at T10836.hs:9:5
Bar Bool = Int -- Defined at T10836.hs:10:5
• In the equations for closed type family ‘Bar’
In the type family declaration for ‘Bar’
T12430.hs:6:3: error:
• Type family equation violates injectivity annotation.
• Type family equation violates the family's injectivity annotation.
Type variable ‘x’ cannot be inferred from the right-hand side.
In the type family equation:
F x = C x -- Defined at T12430.hs:6:3
......
T16512b.hs:6:3: error:
• Type family equation violates injectivity annotation.
• Type family equation violates the family's injectivity annotation.
Type variable ‘a’ cannot be inferred from the right-hand side.
Using UndecidableInstances might help
In the type family equation:
......
......@@ -5,60 +5,65 @@
[5 of 5] Compiling T6018fail ( T6018fail.hs, T6018fail.o )
T6018Afail.hs:9:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
G Char Bool Int = Int -- Defined at T6018Afail.hs:9:15
G Bool Int Char = Int -- Defined at T6018fail.hs:17:15
T6018Cfail.hs:8:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
T6018Bfail.H Char Bool Int = Int -- Defined at T6018Cfail.hs:8:15
T6018Bfail.H Bool Int Char = Int -- Defined at T6018Dfail.hs:7:15
T6018fail.hs:15:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
F Bool Int Char = Int -- Defined at T6018fail.hs:15:15
F Char Bool Int = Int -- Defined at T6018fail.hs:14:15
T6018fail.hs:21:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
I Int Int Int = Bool -- Defined at T6018fail.hs:21:15
I Int Char Bool = Bool -- Defined at T6018fail.hs:20:15
T6018fail.hs:30:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation cannot be a type family:
IdProxy a = Id a -- Defined at T6018fail.hs:30:15
T6018fail.hs:38:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation is a bare type variable
but these LHS type and kind patterns are not bare variables: ‘'Z’
P 'Z m = m -- Defined at T6018fail.hs:38:15
T6018fail.hs:39:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
P ('S n) m = 'S (P n m) -- Defined at T6018fail.hs:39:15
P 'Z m = m -- Defined at T6018fail.hs:38:15
T6018fail.hs:44:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type variable ‘b’ cannot be inferred from the right-hand side.
In the type family equation:
J Int b c = Char -- Defined at T6018fail.hs:44:15
T6018fail.hs:48:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type variable ‘n’ cannot be inferred from the right-hand side.
In the type family equation:
K ('S n) m = 'S m -- Defined at T6018fail.hs:48:15
T6018fail.hs:53:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation cannot be a type family:
L a = MaybeSyn a -- Defined at T6018fail.hs:53:15
T6018fail.hs:61:10: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type/kind variable ‘k1’
cannot be inferred from the right-hand side.
In the type family equation:
......@@ -66,7 +71,7 @@ T6018fail.hs:61:10: error:
-- Defined at T6018fail.hs:61:10
T6018fail.hs:64:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type/kind variable ‘k1’
cannot be inferred from the right-hand side.
In the type family equation:
......@@ -74,14 +79,14 @@ T6018fail.hs:64:15: error:
-- Defined at T6018fail.hs:64:15
T6018fail.hs:68:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type/kind variable ‘k’ cannot be inferred from the right-hand side.
In the type family equation:
forall k (a :: k) (b :: k).
Fc @k a b = Int -- Defined at T6018fail.hs:68:15
T6018fail.hs:72:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type/kind variables ‘k’, ‘a’, ‘b’
cannot be inferred from the right-hand side.
In the type family equation:
......@@ -89,55 +94,60 @@ T6018fail.hs:72:15: error:
Gc @k a b = Int -- Defined at T6018fail.hs:72:15
T6018fail.hs:76:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
F1 [a] = Maybe (GF1 a) -- Defined at T6018fail.hs:76:15
F1 (Maybe a) = Maybe (GF2 a) -- Defined at T6018fail.hs:77:15
T6018fail.hs:89:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation is a bare type variable
but these LHS type and kind patterns are not bare variables: ‘[a]’
W1 [a] = a -- Defined at T6018fail.hs:89:15
T6018fail.hs:92:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation cannot be a type family:
W2 [a] = W2 a -- Defined at T6018fail.hs:92:15
T6018fail.hs:97:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
Z1 (Maybe b) = (b, [b]) -- Defined at T6018fail.hs:97:15
Z1 [a] = (a, a) -- Defined at T6018fail.hs:96:15
T6018fail.hs:101:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
G1 (Maybe b) = [(b, b)] -- Defined at T6018fail.hs:101:15
G1 [a] = [a] -- Defined at T6018fail.hs:100:15
T6018fail.hs:105:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
G3 a Bool = (Bool, a) -- Defined at T6018fail.hs:105:15
G3 a Int = (a, Int) -- Defined at T6018fail.hs:104:15
T6018fail.hs:108:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type variable ‘b’ cannot be inferred from the right-hand side.
In the type family equation:
G4 a b = [a] -- Defined at T6018fail.hs:108:15
T6018fail.hs:112:15: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
G5 Int = [Bool] -- Defined at T6018fail.hs:112:15
G5 [a] = [GF1 a] -- Defined at T6018fail.hs:111:15
T6018fail.hs:115:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type variable ‘a’ cannot be inferred from the right-hand side.
In the type family equation:
G6 [a] = [HF1 a] -- Defined at T6018fail.hs:115:15
T6018fail.hs:120:15: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
Type/kind variables ‘k’, ‘c’
cannot be inferred from the right-hand side.
In the type family equation:
......@@ -145,12 +155,13 @@ T6018fail.hs:120:15: error:
G7 @k a b c = [G7a @k a b c] -- Defined at T6018fail.hs:120:15
T6018fail.hs:131:1: error:
Type family equations violate injectivity annotation:
Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
FC Int Bool = Bool -- Defined at T6018fail.hs:131:1
FC Int Char = Bool -- Defined at T6018fail.hs:127:10
T6018fail.hs:136:1: error:
Type family equation violates injectivity annotation.
Type family equation violates the family's injectivity annotation.
RHS of injective type family equation is a bare type variable
but these LHS type and kind patterns are not bare variables: ‘*’,
‘Char’
......
T6018failclosed.hs:11:5: error:
• Type family equation violates injectivity annotation.
• Type family equation violates the family's injectivity annotation.
RHS of injective type family equation cannot be a type family:
IdProxyClosed a = IdClosed a -- Defined at T6018failclosed.hs:11:5
• In the equations for closed type family ‘IdProxyClosed’
In the type family declaration for ‘IdProxyClosed’
T6018failclosed.hs:19:5: error:
• Type family equation violates injectivity annotation.
• Type family equation violates the family's injectivity annotation.
RHS of injective type family equation is a bare type variable
but these LHS type and kind patterns are not bare variables: ‘'Z’
PClosed 'Z m = m -- Defined at T6018failclosed.hs:19:5
......@@ -15,7 +15,8 @@ T6018failclosed.hs:19:5: error:
In the type family declaration for ‘PClosed’
T6018failclosed.hs:19:5: error:
• Type family equations violate injectivity annotation:
• Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
PClosed 'Z m = m -- Defined at T6018failclosed.hs:19:5
PClosed ('S n) m = 'S (PClosed n m)
-- Defined at T6018failclosed.hs:20:5
......@@ -23,7 +24,7 @@ T6018failclosed.hs:19:5: error:
In the type family declaration for ‘PClosed’
T6018failclosed.hs:25:5: error:
• Type family equation violates injectivity annotation.
• Type family equation violates the family's injectivity annotation.
Type/kind variables ‘k1’, ‘b’
cannot be inferred from the right-hand side.
In the type family equation:
......@@ -34,7 +35,7 @@ T6018failclosed.hs:25:5: error:
In the type family declaration for ‘JClosed’
T6018failclosed.hs:30:5: error:
• Type family equation violates injectivity annotation.
• Type family equation violates the family's injectivity annotation.
Type variable ‘n’ cannot be inferred from the right-hand side.
In the type family equation:
KClosed ('S n) m = 'S m -- Defined at T6018failclosed.hs:30:5
......@@ -42,7 +43,7 @@ T6018failclosed.hs:30:5: error:
In the type family declaration for ‘KClosed’
T6018failclosed.hs:35:5: error:
• Type family equation violates injectivity annotation.
• Type family equation violates the family's injectivity annotation.
RHS of injective type family equation cannot be a type family:
forall k (a :: k).
LClosed a = MaybeSynClosed a -- Defined at T6018failclosed.hs:35:5
......@@ -50,28 +51,31 @@ T6018failclosed.hs:35:5: error:
In the type family declaration for ‘LClosed’
T6018failclosed.hs:39:5: error:
• Type family equations violate injectivity annotation:
• Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
FClosed Char Bool Int = Int -- Defined at T6018failclosed.hs:39:5
FClosed Bool Int Char = Int -- Defined at T6018failclosed.hs:40:5
• In the equations for closed type family ‘FClosed’
In the type family declaration for ‘FClosed’
T6018failclosed.hs:43:5: error:
• Type family equations violate injectivity annotation:
• Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
IClosed Int Char Bool = Bool -- Defined at T6018failclosed.hs:43:5
IClosed Int Int Int = Bool -- Defined at T6018failclosed.hs:44:5
• In the equations for closed type family ‘IClosed’
In the type family declaration for ‘IClosed’
T6018failclosed.hs:49:3: error:
• Type family equations violate injectivity annotation:
• Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
E2 'True = 'False -- Defined at T6018failclosed.hs:49:3
E2 a = 'False -- Defined at T6018failclosed.hs:50:3
• In the equations for closed type family ‘E2’
In the type family declaration for ‘E2’
T6018failclosed.hs:50:3: error:
• Type family equation violates injectivity annotation.
• Type family equation violates the family's injectivity annotation.
Type variable ‘a’ cannot be inferred from the right-hand side.
In the type family equation:
E2 a = 'False -- Defined at T6018failclosed.hs:50:3
......@@ -79,14 +83,15 @@ T6018failclosed.hs:50:3: error:
In the type family declaration for ‘E2’
T6018failclosed.hs:61:3: error:
• Type family equations violate injectivity annotation:
• Type family equation right-hand sides overlap; this violates
the family's injectivity annotation:
F a IO = IO a -- Defined at T6018failclosed.hs:61:3
F Char b = b Int -- Defined at T6018failclosed.hs:62:3
• In the equations for closed type family ‘F’
In the type family declaration for ‘F’
T6018failclosed.hs:66:5: error:
• Type family equation violates injectivity annotation.
• Type family equation violates the family's injectivity annotation.
Type/kind variable ‘k’ cannot be inferred from the right-hand side.
In the type family equation:
forall k (a :: k) (b :: k).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment