Skip to content

Instantly share code, notes, and snippets.

@atondwal
Created April 14, 2015 13:15
Show Gist options
  • Save atondwal/b603c8755f19c1f98470 to your computer and use it in GitHub Desktop.
Save atondwal/b603c8755f19c1f98470 to your computer and use it in GitHub Desktop.
diff --git a/Liquid.hs b/Liquid.hs
index c5b03ac..eea1bb4 100644
--- a/Liquid.hs
+++ b/Liquid.hs
@@ -76,22 +76,24 @@ testDelta cfg target cgi info dc cons = do
ExitSuccess -> return False
ExitFailure _ -> return True
+deltaDebug _ _ _ _ _ [c] _ = return [c]
deltaDebug cfg target cgi info dc cons r = do
let (c1, c2) = splitAt ((length cons) `div` 2) cons
- if length cons == 1
- then return cons
- else do
- test1 <- testDelta cfg target cgi info dc (c1 ++ r)
- if test1
- then deltaDebug cfg target cgi info dc c1 r
- else do
- test2 <- testDelta cfg target cgi info dc (c2 ++ r)
- if test2
- then deltaDebug cfg target cgi info dc c2 r
- else do
- d1 <- deltaDebug cfg target cgi info dc c1 (c2 ++ r)
- d2 <- deltaDebug cfg target cgi info dc c2 (c1 ++ r)
- return (d1 ++ d2)
+ test1 <- testDelta cfg target cgi info dc (c1 ++ r)
+ test2 <- testDelta cfg target cgi info dc (c2 ++ r)
+ if test1
+ then if test2
+ then do
+ d1 <- deltaDebug cfg target cgi info dc c1 r
+ d2 <-deltaDebug cfg target cgi info dc c2 r
+ return (d1 ++ d2)
+ else deltaDebug cfg target cgi info dc c1 r
+ else if test2
+ then deltaDebug cfg target cgi info dc c2 r
+ else do
+ d1 <- deltaDebug cfg target cgi info dc c1 (c2 ++ r)
+ d2 <- deltaDebug cfg target cgi info dc c2 (c1 ++ r)
+ return (d1 ++ d2)
checkOne :: Config -> FilePath -> IO (Output Doc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment