[Haskell-cafe] Conditional IO ?

Dmitri O.Kondratiev dokondr at gmail.com
Mon Jun 20 10:00:54 CEST 2011

What is right way to do conditional IO?
For example, I need to write to file errors only in case they exist,
otherwise my function should do nothing:

handleParseErrors errors
  | (not . null) errors =  writeFile "parse-errors.txt" (show errors)
  | otherwise = ?

What should be an 'otherwise' case ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110620/d0ff418b/attachment.htm>

More information about the Haskell-Cafe mailing list