2 -- htnef, a program to do things to TNEF files.
4 -- Copyright Michael Orlitzky
6 -- http://michael.orlitzky.com/
8 -- This program is free software: you can redistribute it and/or modify
9 -- it under the terms of the GNU General Public License as published by
10 -- the Free Software Foundation, either version 3 of the License, or
11 -- (at your option) any later version.
13 -- This program is distributed in the hope that it will be useful,
14 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
15 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 -- GNU General Public License for more details.
18 -- http://www.fsf.org/licensing/licenses/gpl.html
21 import System.Environment (getArgs)
26 -- Perform x, ignoring the result.
27 -- Then return the result of doing the rest of the operations,
28 -- which will be a single IO (). This forces evaluation
29 -- of a list of IOs, i.e. [IO ()]
30 sequential_io :: [IO ()] -> IO ()
31 sequential_io [] = return ()
32 sequential_io (x:xs) = do
37 -- Decode whatever file is passed on the command line.
41 tf :: TnefFile <- decodeFile (args !! 0)
42 putStrLn (show tf) -- Dump the data...
43 sequential_io (write_tnef_file tf) -- And write the attachments