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

Define a pretty instance for BindingF.

This commit is contained in:
Rob Rix 2017-09-10 21:53:14 -04:00
parent 8a41498ffd
commit 9a5711cb41

View File

@ -52,6 +52,9 @@ instance Pretty1 f => Pretty1 (BindingF f) where
where prettyKV (var, val) = pretty var <+> pretty '=' <+> p val
liftPretty _ _ (VarF metavar) = pretty metavar
instance (Pretty1 f, Pretty a) => Pretty (BindingF f a) where
pretty = liftPretty pretty prettyList
instance ToJSONFields1 f => ToJSONFields1 (BindingF f) where
toJSONFields1 (Let vars body) = [ "vars" .= vars ] <> toJSONFields1 body