Encode a JSON Value to a Data.Text.Lazy
Note: uses toEncoding
:: a typeCtrl KGHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12
Moduleaeson-2.2.5.1Haskell2010
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.
Encode a JSON Value to a Data.Text.Lazy
Note: uses toEncoding
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 (ByteString.Builder) instead.fromEncoding . toEncoding
Note: Uses toJSON