X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FUtils.hs;h=abd4556b64930789940b2f89da1e75e5fe6c7ca5;hb=65a16e9;hp=387cca24a58f16bf3b08f4a63a99e2a3f41aeedc;hpb=9bb89434103e9a22f100d6ecb7e65a5d461e0454;p=Lucu.git diff --git a/Network/HTTP/Lucu/Utils.hs b/Network/HTTP/Lucu/Utils.hs index 387cca2..abd4556 100644 --- a/Network/HTTP/Lucu/Utils.hs +++ b/Network/HTTP/Lucu/Utils.hs @@ -32,17 +32,15 @@ splitBy isSep src -- |> joinWith ":" ["ab", "c", "def"] -- > ==> "ab:c:def" -joinWith ∷ Ascii → [Ascii] → AsciiBuilder +joinWith ∷ Ascii → [AsciiBuilder] → AsciiBuilder {-# INLINEABLE joinWith #-} joinWith sep = flip go (∅) where - go ∷ [Ascii] → A.AsciiBuilder → A.AsciiBuilder + go ∷ [AsciiBuilder] → AsciiBuilder → AsciiBuilder {-# INLINE go #-} go [] ab = ab - go (x:[]) ab = ab ⊕ A.toAsciiBuilder x - go (x:xs) ab = go xs ( ab ⊕ - A.toAsciiBuilder sep ⊕ - A.toAsciiBuilder x ) + go (x:[]) ab = ab ⊕ x + go (x:xs) ab = go xs (ab ⊕ A.toAsciiBuilder sep ⊕ x) -- |> quoteStr "abc" -- > ==> "\"abc\""