Lucu-0.3.1: HTTP Daemonic LibrarySource codeContentsIndex
Network.HTTP.Lucu.Utils
Description
Utility functions used internally in the Lucu httpd. These functions may be useful too for something else.
Synopsis
splitBy :: (a -> Bool) -> [a] -> [[a]]
joinWith :: [a] -> [[a]] -> [a]
trim :: (a -> Bool) -> [a] -> [a]
isWhiteSpace :: Char -> Bool
quoteStr :: String -> String
parseWWWFormURLEncoded :: String -> [(String, String)]
Documentation
splitBy :: (a -> Bool) -> [a] -> [[a]]Source
 splitBy (== ':') "ab:c:def"
 ==> ["ab", "c", "def"]
joinWith :: [a] -> [[a]] -> [a]Source
 joinWith ":" ["ab", "c", "def"]
 ==> "ab:c:def"
trim :: (a -> Bool) -> [a] -> [a]Source
 trim (== '_') "__ab_c__def___"
 ==> "ab_c__def"
isWhiteSpace :: Char -> BoolSource
isWhiteSpace c is True iff c is one of SP, HT, CR and LF.
quoteStr :: String -> StringSource
 quoteStr "abc"
 ==> "\"abc\""
 quoteStr "ab\"c"
 ==> "\"ab\\\"c\""
parseWWWFormURLEncoded :: String -> [(String, String)]Source
 parseWWWFormURLEncoded "aaa=bbb&ccc=ddd"
 ==> [("aaa", "bbb"), ("ccc", "ddd")]
Produced by Haddock version 2.4.2