X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FUtils.hs;h=abd4556b64930789940b2f89da1e75e5fe6c7ca5;hp=387cca24a58f16bf3b08f4a63a99e2a3f41aeedc;hb=65a16e9;hpb=1d4b3e418e5fe8d2701f448dcb112dee223b061b 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\""