, trim -- (a -> Bool) -> [a] -> [a]
, noCaseEq -- String -> String -> Bool
, isWhiteSpace -- Char -> Bool
+ , quoteStr -- String -> String
)
where
import Data.List
import Foreign
import Foreign.C
+import Network.URI
splitBy :: (a -> Bool) -> [a] -> [[a]]
isWhiteSpace :: Char -> Bool
isWhiteSpace = flip elem " \t\r\n"
+
+
+quoteStr :: String -> String
+quoteStr str = foldr (++) "" (["\""] ++ map quote str ++ ["\""])
+ where
+ quote :: Char -> String
+ quote '"' = "\\\""
+ quote c = [c]
\ No newline at end of file