forked from blanu/juicer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblend.hs
More file actions
28 lines (25 loc) · 793 Bytes
/
blend.hs
File metadata and controls
28 lines (25 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import System.Environment (getArgs)
import Data.List
import Data.List.Split
import Juicer.Freeze
import Juicer.Puree
import Juicer.Blend
main :: IO ()
main = do
args <- getArgs
case args of
(diffname:archivename:[]) -> do
maybeDiff <- diffthaw diffname
maybeArchive <- thaw archivename
case (maybeDiff, maybeArchive) of
(Nothing, _) -> return ()
(_, Nothing) -> return ()
(Just diff, Just archive) -> blend diff archive archivename
otherwise -> putStrLn "squeeze [diff] [archive]"
blend :: Diff -> Feed -> String -> IO()
blend diff archive archivename = do
putStrLn $ show diff
putStrLn $ show archive
let archive' = merge archive diff
freeze archive' archivename
putStrLn $ show archive'