This commit is contained in:
Chris Penner 2022-01-20 14:45:23 -06:00
parent e2a5f94646
commit 1346489fe9
3 changed files with 8 additions and 6 deletions

View File

@ -138,7 +138,7 @@ indexByReference uf = (tms, tys)
allTerms :: Ord v => TypecheckedUnisonFile v a -> Map v (Term v a)
allTerms uf =
Map.fromList [ (v, t) | (v, t, _) <- join $ topLevelComponents' uf ]
Map.fromList [ (v, t) | (v, t, _) <- join $ topLevelComponents uf ]
-- |the top level components (no watches) plus test watches.
topLevelComponents :: TypecheckedUnisonFile v a

View File

@ -734,8 +734,9 @@ hash = hash' [] where
instance (Show1 f, Show v) => Show (Term f v a) where
-- annotations not shown
showsPrec p (Term _ _ out) = case out of
Var v -> showParen (p>=9) $ \x -> "Var " ++ show v ++ x
Cycle body -> ("Cycle " ++) . showsPrec p body
Abs v body -> showParen True $ (show v ++) . showString ". " . showsPrec p body
Tm f -> showsPrec1 p f
showsPrec p (Term freevars _ out) = case out of
-- showsPrec p (Term _ _ out) = case out of
Var v -> showParen (p>=9) $ \x -> show freevars <> "Var " ++ show v ++ x
Cycle body -> (show freevars <>) . ("Cycle " ++) . showsPrec p body
Abs v body -> showParen True $ (show freevars <>) . (show v ++) . showString ". " . showsPrec p body
Tm f -> (show freevars <>) . showsPrec1 p f

View File

@ -21,6 +21,7 @@ module Unison.DataDeclaration
constructorType,
constructorTypes,
constructorVars,
constructorIds,
declConstructorReferents,
declDependencies,
declFields,