1
1
mirror of https://github.com/github/semantic.git synced 2025-01-09 00:56:32 +03:00

Add Diffable' instance for Rec1 Maybe

This commit is contained in:
Rick Winfrey 2017-09-18 14:49:33 -07:00
parent 17c8a4fd99
commit bc158136bb

View File

@ -157,3 +157,7 @@ instance Diffable' (Rec1 NonEmpty) where
algorithmFor' (Rec1 (a:|as)) (Rec1 (b:|bs)) = Just $ do
d:ds <- byRWS (a:as) (b:bs)
pure (Rec1 (d :| ds))
-- | Diff two maybes holding parameters.
instance Diffable' (Rec1 Maybe) where
algorithmFor' (Rec1 a) (Rec1 b) = Just $ Rec1 <$> diffMaybe a b