From 893c1d9067e8e39be61966bd4f8b6d768256d98a Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 27 Jul 2016 00:01:54 -0400 Subject: [PATCH] Eta reduce textDiff. --- src/Diffing.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Diffing.hs b/src/Diffing.hs index b192f7e02..db52afeab 100644 --- a/src/Diffing.hs +++ b/src/Diffing.hs @@ -131,12 +131,11 @@ diffCostWithCachedTermCosts diff = unCost $ case runFree diff of -- | Returns a rendered diff given a parser, diff arguments and two source blobs. textDiff :: (Eq (Record fields), HasField fields Category, HasField fields Cost, HasField fields Range) => Parser (Syntax Text) (Record fields) -> DiffArguments -> Both SourceBlob -> IO Text -textDiff parser arguments sources = diffFiles parser renderer sources - where renderer = case format arguments of - Split -> split - Patch -> patch - JSON -> json - Summary -> summary +textDiff parser arguments = diffFiles parser $ case format arguments of + Split -> split + Patch -> patch + JSON -> json + Summary -> summary -- | Returns a truncated diff given diff arguments and two source blobs. truncatedDiff :: DiffArguments -> Both SourceBlob -> IO Text