1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Tighten up the definition of afterOrBefore.

This commit is contained in:
Rob Rix 2017-05-05 15:27:50 -04:00
parent 8cd74f6ea2
commit 2ac1baef7a

View File

@ -52,10 +52,7 @@ before :: Patch a -> Maybe a
before = maybeFst . unPatch
afterOrBefore :: Patch a -> a
afterOrBefore patch = case patch of
Insert after -> after
Delete before -> before
Replace _ after -> after
afterOrBefore = these identity identity (curry snd) . unPatch
-- | Return both sides of a patch.
unPatch :: Patch a -> These a a