From 2ac1baef7a7cac2c0c93ab9ce39c40944d3ba2e9 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 5 May 2017 15:27:50 -0400 Subject: [PATCH] Tighten up the definition of afterOrBefore. --- src/Patch.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Patch.hs b/src/Patch.hs index 768cba42c..3e395ff65 100644 --- a/src/Patch.hs +++ b/src/Patch.hs @@ -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