summaryrefslogtreecommitdiff
path: root/Utility/Misc.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-12 02:04:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-12 02:04:48 -0400
commit2332afb4bc207ab04b4a1d7adfb3a2df7f5d7874 (patch)
tree296ee7c5e281ed231cba4ca3fe0dbd9f5c2f5e51 /Utility/Misc.hs
parentacd7a52dfd2cad24fd946ffcf8c4b1d07eb474ce (diff)
cleanup
Diffstat (limited to 'Utility/Misc.hs')
-rw-r--r--Utility/Misc.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Utility/Misc.hs b/Utility/Misc.hs
index 541e150b7..e95ac4319 100644
--- a/Utility/Misc.hs
+++ b/Utility/Misc.hs
@@ -40,6 +40,10 @@ separate c l = unbreak $ break c l
| null b = r
| otherwise = (a, tail b)
+{- Breaks out the first line. -}
+firstLine :: String-> String
+firstLine = takeWhile (/= '\n')
+
{- Catches IO errors and returns a Bool -}
catchBoolIO :: IO Bool -> IO Bool
catchBoolIO a = catchDefaultIO a False