1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Define a Pretty1 instance for BindingF.

This commit is contained in:
Rob Rix 2017-09-10 21:41:41 -04:00
parent 78ad302339
commit 82897fa5e9

View File

@ -26,3 +26,9 @@ envLookup var = lookup var . unEnv
instance Pretty Metavar where
pretty (Metavar v) = pretty v
instance Pretty1 f => Pretty1 (BindingF f) where
liftPretty p pl (Let vars body) = pretty ("let" :: String) <+> align (vsep (prettyKV <$> vars)) <> line
<> pretty ("in" :: String) <+> liftPretty p pl body
where prettyKV (var, val) = pretty var <+> pretty '=' <+> p val
liftPretty _ _ (VarF metavar) = pretty metavar