1+ {-# OPTIONS_GHC -Wno-unused-imports #-}
2+
13module LambdaBuffers.Compiler.KindCheck.Derivation (
24 Derivation (Axiom , Abstraction , Application , Implication ),
35 QClassName (QClassName ),
@@ -11,15 +13,14 @@ module LambdaBuffers.Compiler.KindCheck.Derivation (
1113 context ,
1214 addContext ,
1315 getAllContext ,
14- constraintContext ,
16+ classContext ,
1517) where
1618
1719import Control.Lens (Lens' , lens , makeLenses , (&) , (.~) , (^.) )
1820import Control.Lens.Operators ((%~) )
1921import Data.Map qualified as M
2022import LambdaBuffers.Compiler.KindCheck.Kind (Kind )
21- import LambdaBuffers.Compiler.KindCheck.Type (Type , Variable )
22- import LambdaBuffers.Compiler.ProtoCompat qualified as PC
23+ import LambdaBuffers.Compiler.KindCheck.Type (Type , Variable (QualifiedTyClassRef ))
2324import LambdaBuffers.Compiler.ProtoCompat.InfoLess (InfoLess )
2425import Prettyprinter (
2526 Doc ,
@@ -43,7 +44,7 @@ data QClassName = QClassName
4344data Context = Context
4445 { _context :: M. Map (InfoLess Variable ) Kind
4546 , _addContext :: M. Map (InfoLess Variable ) Kind
46- , _constraintContext :: M. Map (InfoLess PC. ClassName ) Kind
47+ , _classContext :: M. Map (InfoLess Variable ) Kind
4748 }
4849 deriving stock (Show , Eq )
4950
@@ -62,14 +63,14 @@ instance Semigroup Context where
6263 c1
6364 & context %~ (<> c2 ^. context)
6465 & addContext %~ (<> c2 ^. addContext)
65- & constraintContext %~ (<> c2 ^. constraintContext )
66+ & classContext %~ (<> c2 ^. classContext )
6667
6768instance Monoid Context where
6869 mempty = Context mempty mempty mempty
6970
7071-- | Utility to unify the two T.
7172getAllContext :: Context -> M. Map (InfoLess Variable ) Kind
72- getAllContext c = c ^. context <> c ^. addContext
73+ getAllContext c = c ^. context <> c ^. addContext <> c ^. classContext
7374
7475data Judgement = Judgement
7576 { _j'ctx :: Context
0 commit comments