]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Utils.hs
The big change
[Rakka.git] / Rakka / Utils.hs
index 92f3b1232f51eacb51cdddefeaa15c6db36258db..9f2873c9ae328d626d9679b2ac0c777750c1e50e 100644 (file)
@@ -2,9 +2,9 @@ module Rakka.Utils
     ( yesOrNo
     , parseYesOrNo
     , maybeA
-    , defaultTo
     , deleteIfEmpty
     , formatW3CDateTime
+    , chomp
     )
     where
 
@@ -35,13 +35,6 @@ maybeA a = listA a
                         (x:_) -> returnA -< Just x
 
 
-defaultTo :: ArrowChoice a => b -> a (Maybe b) b
-defaultTo def
-    = proc m -> case m of
-                  Nothing -> returnA -< def
-                  Just x  -> returnA -< x
-
-
 deleteIfEmpty :: (ArrowList a, ArrowChoice a) => a String String
 deleteIfEmpty
     = proc str -> do case str of
@@ -79,4 +72,8 @@ formatW3CDateTime time
             
       show2 :: Int -> String
       show2 n | n < 10    = '0':(show n)
-              | otherwise = show n
\ No newline at end of file
+              | otherwise = show n
+
+
+chomp :: String -> String
+chomp = reverse . snd . break (/= '\n') . reverse