From 978c91cd59efe237f6332f07ba8ce8692acb6780 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 17 Jun 2016 13:53:33 -0400 Subject: [PATCH] Fix setCost infinite looping. --- src/Diffing.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Diffing.hs b/src/Diffing.hs index ab38d1211..299dc76d6 100644 --- a/src/Diffing.hs +++ b/src/Diffing.hs @@ -97,7 +97,6 @@ diffFiles parser renderer sourceBlobs = do pure $! renderer textDiff sourceBlobs where construct :: CofreeF (Syntax Text) (Both Info) (Diff Text Info) -> Diff Text Info construct (info :< syntax) = free (Free ((setCost <$> info <*> sumCost syntax) :< syntax)) - setCost info cost = setCost info cost sumCost = fmap getSum . foldMap (fmap Sum . getCost) getCost diff = case runFree diff of Free (info :< _) -> cost <$> info