@@ -8,9 +8,9 @@ import qualified Data.Yaml as Y
8main :: IO ()
8main :: IO ()
10 args <- getArgs
10 args <- getArgs
11− let (input, output) = case args ++ repeat "-" of
11+ (input, output) <- case args ++ repeat "-" of
12− [i, o] -> (i, o)
12+ [i, o] -> pure (i, o)
13− _ -> error "Usage: json2yaml [in] [out]"
13+ _ -> fail "Usage: json2yaml [in] [out]"
14 mval <- fmap J.decode $
14 mval <- fmap J.decode $
15 case input of
15 case input of
16 "-" -> L.getContents
16 "-" -> L.getContents