X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FUtils.hs;h=d6e571dd0fcf3ab0a2ad30c4cd1ac8188516d96c;hp=5cee03a56f6262c7d40ab1fe7059a566236cda73;hb=51eda5b;hpb=19043d7882f936be9b073cae34b52905016c3ad7 diff --git a/Network/HTTP/Lucu/Utils.hs b/Network/HTTP/Lucu/Utils.hs index 5cee03a..d6e571d 100644 --- a/Network/HTTP/Lucu/Utils.hs +++ b/Network/HTTP/Lucu/Utils.hs @@ -10,15 +10,12 @@ module Network.HTTP.Lucu.Utils , quoteStr , parseWWWFormURLEncoded , splitPathInfo - , show3 , trim , liftCIAscii , liftText , liftMap ) where -import Blaze.ByteString.Builder.ByteString as B -import Blaze.Text.Int as BT import Control.Monad import Data.Ascii (Ascii, CIAscii, AsciiBuilder) import qualified Data.Ascii as A @@ -98,19 +95,6 @@ splitPathInfo uri in map BS.pack reqPath --- |>>> show3 5 --- "005" -show3 ∷ Integral n ⇒ n → AsciiBuilder -{-# INLINEABLE show3 #-} -show3 = A.unsafeFromBuilder ∘ go - where - go i | i ≥ 0 ∧ i < 10 = B.fromByteString "00" ⊕ BT.digit i - | i ≥ 0 ∧ i < 100 = B.fromByteString "0" ⊕ BT.integral i - | i ≥ 0 ∧ i < 1000 = BT.integral i - | otherwise = error ("show3: the integer i must satisfy 0 <= i < 1000: " ⧺ show i) --- FIXME: Drop this function as soon as possible, to eliminate the --- dependency on blaze-textual. - -- |>>> trim " ab c d " -- "ab c d" trim ∷ String → String