X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FUtils.hs;h=bfa2acfb72282d76a2dad31ed2871c28c0709fed;hp=8722ecb1a7264ebd450dff106aa283b0d423de0b;hb=2bcf36a739341aaaf56d812286d57233fff81ad5;hpb=6df5f92e37d27641f53e271f043c66dd3d085bb7 diff --git a/Network/HTTP/Lucu/Utils.hs b/Network/HTTP/Lucu/Utils.hs index 8722ecb..bfa2acf 100644 --- a/Network/HTTP/Lucu/Utils.hs +++ b/Network/HTTP/Lucu/Utils.hs @@ -86,7 +86,7 @@ parseWWWFormURLEncoded src ) where unescape ∷ String → ByteString - unescape = Strict.pack ∘ unEscapeString ∘ map plusToSpace + unescape = Strict.pack ∘ unEscapeString ∘ (plusToSpace <$>) plusToSpace ∷ Char → Char plusToSpace '+' = ' ' @@ -99,7 +99,7 @@ splitPathInfo uri = let reqPathStr = uriPath uri reqPath = [unEscapeString x | x ← splitBy (≡ '/') reqPathStr, (¬) (null x)] in - map Strict.pack reqPath + Strict.pack <$> reqPath -- |>>> trim " ab c d " -- "ab c d" @@ -142,6 +142,5 @@ getLastModified = (clockTimeToUTC <$>) ∘ getModificationTime where clockTimeToUTC ∷ ClockTime → UTCTime clockTimeToUTC (TOD sec picoSec) - = posixSecondsToUTCTime - $ fromRational + = posixSecondsToUTCTime ∘ fromRational $ sec % 1 + picoSec % (1000 ⋅ 1000 ⋅ 1000 ⋅ 1000)