put names into contexts, and contexts into errors

This commit is contained in:
rhiannon morris 2023-03-14 03:22:26 +01:00
parent f4af1a5a78
commit 86d21caf24
13 changed files with 520 additions and 324 deletions

View file

@ -17,6 +17,10 @@ export %hint
showTyContext : (PrettyHL q, Show q) => Show (TyContext q d n)
showTyContext = deriveShow
export %hint
showEqContext : (PrettyHL q, Show q) => Show (EqContext q n)
showEqContext = deriveShow
export %hint
showTypingError : (PrettyHL q, Show q) => Show (Error q)
showTypingError = deriveShow
@ -33,19 +37,19 @@ PrettyHL q => ToInfo (Error q) where
toInfo (NotInScope x) =
[("type", "NotInScope"),
("name", show x)]
toInfo (ExpectedTYPE t) =
toInfo (ExpectedTYPE _ t) =
[("type", "ExpectedTYPE"),
("got", prettyStr True t)]
toInfo (ExpectedPi t) =
toInfo (ExpectedPi _ t) =
[("type", "ExpectedPi"),
("got", prettyStr True t)]
toInfo (ExpectedSig t) =
toInfo (ExpectedSig _ t) =
[("type", "ExpectedSig"),
("got", prettyStr True t)]
toInfo (ExpectedEnum t) =
toInfo (ExpectedEnum _ t) =
[("type", "ExpectedEnum"),
("got", prettyStr True t)]
toInfo (ExpectedEq t) =
toInfo (ExpectedEq _ t) =
[("type", "ExpectedEq"),
("got", prettyStr True t)]
toInfo (BadUniverse k l) =
@ -56,22 +60,22 @@ PrettyHL q => ToInfo (Error q) where
[("type", "TagNotIn"),
("tag", show t),
("set", show $ SortedSet.toList ts)]
toInfo (BadCaseQtys qouts) =
toInfo (BadCaseQtys _ qouts) =
("type", "BadCaseQtys") ::
[(show i, prettyStr True q) | (i, q) <- zip [1 .. length qouts] qouts]
[(show i, prettyStr True q) | (i, _, _, q) <- zip [1 .. length qouts] qouts]
toInfo (ClashT mode ty s t) =
toInfo (ClashT _ mode ty s t) =
[("type", "ClashT"),
("mode", show mode),
("ty", prettyStr True ty),
("left", prettyStr True s),
("right", prettyStr True t)]
toInfo (ClashTy mode s t) =
toInfo (ClashTy _ mode s t) =
[("type", "ClashTy"),
("mode", show mode),
("left", prettyStr True s),
("right", prettyStr True t)]
toInfo (ClashE mode e f) =
toInfo (ClashE _ mode e f) =
[("type", "ClashE"),
("mode", show mode),
("left", prettyStr True e),
@ -85,14 +89,10 @@ PrettyHL q => ToInfo (Error q) where
[("type", "ClashQ"),
("left", prettyStr True pi),
("right", prettyStr True rh)]
toInfo (ClashD p q) =
[("type", "ClashD"),
("left", prettyStr True p),
("right", prettyStr True q)]
toInfo (NotType ty) =
toInfo (NotType _ ty) =
[("type", "NotType"),
("got", prettyStr True ty)]
toInfo (WrongType ty s t) =
toInfo (WrongType _ ty s t) =
[("type", "WrongType"),
("ty", prettyStr True ty),
("left", prettyStr True s),