Change the sample programs in README to exit with a non-zero return code
Getty Ritter
9 years ago
45 | 45 | import Control.Monad ((>=>)) |
46 | 46 | import Data.TeLML (parse) |
47 | 47 | import Data.TeLML.Markup (render) |
48 | import System.Exit (exitFailure) | |
48 | 49 | import Text.Blaze.Renderer.String (renderMarkup) |
49 | 50 | |
50 | 51 | main :: IO () |
51 | 52 | main = do |
52 | 53 | str <- getContents |
53 | 54 | case (parse >=> render) str of |
54 |
Left err -> putStrLn err |
|
55 | Left err -> putStrLn err >> exitFailure | |
55 | 56 | Right doc -> putStrLn (renderMarkup doc) |
56 | 57 | ~~~~ |
57 | 58 | |
98 | 99 | import Control.Monad ((>=>)) |
99 | 100 | import Data.TeLML (parse) |
100 | 101 | import Data.TeLML.Markup (Renderer, renderWith) |
102 | import System.Exit (exitFailure) | |
103 | import Text.Blaze.Html5 (strong, toMarkup) | |
101 | 104 | import Text.Blaze.Renderer.String (renderMarkup) |
102 | import Text.Blaze.Html5 (strong, toMarkup) | |
103 | 105 | |
104 | 106 | myTags :: [(String, Renderer)] |
105 | 107 | myTags = |
118 | 120 | main = do |
119 | 121 | str <- getContents |
120 | 122 | case (parse >=> renderWith myTags) str of |
121 |
Left err -> putStrLn err |
|
123 | Left err -> putStrLn err >> exitFailure | |
122 | 124 | Right doc -> putStrLn (renderMarkup doc) |
123 | 125 | ~~~~ |
124 | 126 |