
6 Feb
2009
6 Feb
'09
5:40 a.m.
On Fri, Feb 6, 2009 at 10:30 AM, Christian Maeder
Another course of action would be to add exception handling; if head throws an exception then the input file isn't following the accepted syntax.
I'ld rather check all lines before (or filter non empty ones) than trying to catch Prelude.head: empty list!
Yes, that's how I modified my own "solution" once I tracked down what sort of input it would fail on: main = interact (unlines . map show . countDays . dropWhile null . lines) /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe