HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleaeson-2.2.3.0Haskell2010

Data.Aeson.Text

Most frequently, you'll probably want to encode straight to UTF-8 (the standard JSON encoding) using encode.

You can use the conversions to Builders when embedding JSON messages as parts of a protocol.

  • 2 values
  • Packageaeson-2.2.3.0
  • Exports2
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceText.hs
valueencodeToTextBuilder :: ToJSON a => a -> Builder
#

Encode a JSON Value to a Data.Text Builder, which can be embedded efficiently in a text-based protocol.

If you are going to immediately encode straight to a L.ByteString, it is more efficient to use encode (lazy ByteString) or fromEncoding . toEncoding (ByteString.Builder) instead.

Note: Uses toJSON