Safe Haskell | None |
---|---|
Language | Haskell2010 |
Builder structures for JString
s
Synopsis
- jStringBuilder :: Monoid b => Builder t b -> JString -> b
Documentation
jStringBuilder :: Monoid b => Builder t b -> JString -> b Source #
Builder for a JString
.
>>>
toLazyText $ jStringBuilder textBuilder ((JString' V.empty) :: JString)
"\"\""
>>>
toLazyText $ jStringBuilder textBuilder ((JString' $ V.fromList [UnescapedJChar (Unescaped 'a'),UnescapedJChar (Unescaped 'b'),UnescapedJChar (Unescaped 'c')]) :: JString)
"\"abc\""
>>>
toLazyText $ jStringBuilder textBuilder ((JString' $ V.fromList [UnescapedJChar (Unescaped 'a'),EscapedJChar (WhiteSpace CarriageReturn),UnescapedJChar (Unescaped 'b'),UnescapedJChar (Unescaped 'c')]) :: JString)
"\"a\\rbc\""
>>>
toLazyText $ jStringBuilder textBuilder ((JString' $ V.fromList [UnescapedJChar (Unescaped 'a'),EscapedJChar (WhiteSpace CarriageReturn),UnescapedJChar (Unescaped 'b'),UnescapedJChar (Unescaped 'c'),EscapedJChar (Hex (HexDigit4 HeXDigita HeXDigitb HeXDigit1 HeXDigit2)),EscapedJChar (WhiteSpace NewLine),UnescapedJChar (Unescaped 'd'),UnescapedJChar (Unescaped 'e'),UnescapedJChar (Unescaped 'f'),EscapedJChar QuotationMark]) :: JString)
"\"a\\rbc\\uab12\\ndef\\\"\""
>>>
toLazyText $ jStringBuilder textBuilder ((JString' $ V.singleton (UnescapedJChar (Unescaped 'a'))) :: JString)
"\"a\""
>>>
toLazyText $ jStringBuilder textBuilder (JString' $ V.singleton (EscapedJChar ReverseSolidus) :: JString)
"\"\\\\\""