VPCon c a us phis -> text c <+> braces (showVal a) <+> showVals us
<+> (hsep $ map ((char '@' <+>) . showFormula) phis)
VPi a l@(VLam x t b)
- | "_" `isPrefixOf` x -> showVal1 a <+> text "->" <+> showVal1 b
+ | "_" `isPrefixOf` x -> showVal a <+> text "->" <+> showVal1 b
| otherwise -> char '(' <> showLam v
VPi a b -> text "Pi" <+> showVals [a,b]
VPair u v -> parens (showVal u <> comma <> showVal v)
Ter (Lam x t u) e -> let w = eval e t
v@(VVar n _) = mkVarNice ns x w
in VLam n (normal ns w) $ normal (n:ns) (eval (Upd e (x,v)) u)
+ Ter t e -> Ter t (normal ns e)
VPi u v -> VPi (normal ns u) (normal ns v)
VSigma u v -> VSigma (normal ns u) (normal ns v)
VPair u v -> VPair (normal ns u) (normal ns v)
VAppFormula u phi -> VAppFormula (normal ns u) phi
_ -> v
+instance Normal Env where
+ normal ns = mapEnv (normal ns) id
+
instance Normal a => Normal (Map k a) where
normal ns us = Map.map (normal ns) us