GHC internal error: associated type not in scope during typechecking
Trying to add a really bad associated type to a class as follows
type family Strategy' a b n where
Strategy' a b Zero = St a b -- this is where the error occurs
Strategy' a b (Succ n)
= Strategy' a b n
<| ReverseArgs (Strategy' b a n)
<| Combine (Strategy' a a n) (Strategy' b b n)
class DefinedStrategy a b where
type St
triggers
/home/mrkgnao/code/haskell/noether/library/Algebra/DeOverlap.hs:126:24: error:
• GHC internal error: ‘St’ is not in scope during type checking, but it passed the renamer
tcl_env of environment: [amtJ :-> Type variable ‘a’ = a,
amtK :-> Type variable ‘b’ = b, roW :-> ATcTyCon Strategy']
• In the type ‘St a b’
In the type family declaration for ‘Strategy'’
/home/mrkgnao/code/haskell/noether/library/Algebra/DeOverlap.hs:132:1: error:
• The associated type ‘St’
mentions none of the type or kind variables of the class ‘DefinedStrategy a b’
• In the class declaration for ‘DefinedStrategy’