Encode a JSON Value to a Data.Text.Lazy
Note: uses toEncoding
:: a typeCtrl KGHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11
Moduleaeson-2.3.2.0Haskell2010
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
ByteString, it is more efficient to use encode (lazy ByteString)
or (Builder) instead.Data.Aeson.fromEncoding . toEncoding
Note: Uses toJSON