mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Tighten up the definition of afterOrBefore.
This commit is contained in:
parent
8cd74f6ea2
commit
2ac1baef7a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user