date sorting II
Ketil Z. Malde
ketil@ii.uib.no
11 Mar 2002 08:39:55 +0100
"Michael Ruth" <meruth@hotmail.com> writes:
> start:: IO()
> start = do {
> putStr "Enter a filename: ";
> theFile <- getLine;
> myfile <- openFile theFile ReadMode;
> myList <- getInput myfile;
> myDates <- stripSpaces myList;
> myDates <- qSort myDates;
> myList <- formatOutput myDates;
> writeFile "output.txt" (getOutput (myList));
> }
You might want to look up the function "readFile" in the Prelude.
I must admit that while I've been using Haskell for odd bits and ends
for a while now, I've not yet used a file handle -- still a lot of
posted code seems to use them. Is this a creeping C-ism, or are
handles genuinely useful, even if you simply are reading the content
of a file to process it (i.e. typical Unix shell util usage)?
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants