mirror of
https://github.com/github/semantic.git
synced 2024-12-18 20:31:55 +03:00
Fix up a few manual instances.
This commit is contained in:
parent
fdd12d4718
commit
562be941fe
@ -68,7 +68,7 @@ runFree (Free.Pure a) = FreeF.Pure a
|
||||
|
||||
instance Pretty1 f => Pretty1 (Free.Free f) where
|
||||
liftPretty p pl = go where go (Free.Pure a) = p a
|
||||
go (Free.Free f) = liftPretty go (liftPrettyList p pl) f
|
||||
go (Free.Free f) = liftPretty go (list . map (liftPretty p pl)) f
|
||||
|
||||
instance (Pretty1 f, Pretty a) => Pretty (Free.Free f a) where
|
||||
pretty = pretty1
|
||||
pretty = liftPretty pretty prettyList
|
||||
|
@ -95,4 +95,4 @@ instance Pretty1 Patch where
|
||||
liftPretty p _ (Delete a) = nest 2 (vsep [ pretty ("Delete" :: String), p a ])
|
||||
|
||||
instance Pretty a => Pretty (Patch a) where
|
||||
pretty = pretty1
|
||||
pretty = liftPretty pretty prettyList
|
||||
|
@ -74,10 +74,10 @@ runCofree (a Cofree.:< f) = a CofreeF.:< f
|
||||
|
||||
|
||||
instance Pretty1 f => Pretty1 (Cofree.Cofree f) where
|
||||
liftPretty p pl = go where go (a Cofree.:< f) = p a <+> liftPretty go (liftPrettyList p pl) f
|
||||
liftPretty p pl = go where go (a Cofree.:< f) = p a <+> liftPretty go (list . map (liftPretty p pl)) f
|
||||
|
||||
instance (Pretty1 f, Pretty a) => Pretty (Cofree.Cofree f a) where
|
||||
pretty = pretty1
|
||||
pretty = liftPretty pretty prettyList
|
||||
|
||||
instance Apply1 Pretty1 fs => Pretty1 (Union fs) where
|
||||
liftPretty p pl = apply1 (Proxy :: Proxy Pretty1) (liftPretty p pl)
|
||||
|
Loading…
Reference in New Issue
Block a user