summaryrefslogtreecommitdiff
path: root/examples/testdiff.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2018-10-26 02:28:05 -0400
committerJoe Crayne <joe@jerkface.net>2018-10-26 02:28:05 -0400
commite6168c1d804f14846562a2842bc569bfdc921c58 (patch)
tree3406bae946e7304fdb5d528ad72b58c41c172bac /examples/testdiff.hs
parent72edf82d5acce1f361771d7d2c70e7ffbfe7f009 (diff)
Move haskell example into haskell/ directory.
Diffstat (limited to 'examples/testdiff.hs')
-rw-r--r--examples/testdiff.hs31
1 files changed, 0 insertions, 31 deletions
diff --git a/examples/testdiff.hs b/examples/testdiff.hs
deleted file mode 100644
index 7e20dc5..0000000
--- a/examples/testdiff.hs
+++ /dev/null
@@ -1,31 +0,0 @@
1{-# LANGUAGE OverloadedStrings #-}
2
3import qualified Data.ByteString.Lazy as L
4import Data.VCDIFF
5import Text.XXD
6
7source :: L.ByteString
8source = "It could be said that Joe was here. I don't know what to do about it."
9
10patched :: L.ByteString
11patched = "It could be said that Joe, the magnificent, was here. I don't know what to do about it."
12
13delta :: Result VCDIFF
14delta = computeDiff defaultConfig source patched
15
16main = do
17 mapM_ putStrLn $ xxd2 0 (L.toStrict source)
18 putStrLn ""
19 mapM_ putStrLn $ xxd2 0 (L.toStrict patched)
20 putStrLn ""
21 case delta of
22 Result δ@(VCDIFF d) me -> do
23 -- mapM_ (mapM_ putStrLn . xxd2 0) (chunksOf 16 d)
24 mapM_ putStrLn $ xxd2 0 (L.toStrict d)
25 print me
26 putStrLn ""
27 let Result patched' pe = applyPatch defaultConfig source δ
28 mapM_ putStrLn $ xxd2 0 (L.toStrict patched') -- $ L.take 48 patched')
29 print pe
30 print ("source",source)
31 print ("patched",patched)