@@ -49,19 +49,17 @@ do
4949
5050### Serialize a `String` as UTF8
5151
52−Encode a `String` as UTF8 with a length prefix in a
53−way that's compatible with the
54−[`Binary.Put.putStringUtf8`](https://hackage.haskell.org/package/binary/docs/Data-Binary-Put.html#v:putStringUtf8)
55−function from the Haskell
56−[__binary__](https://hackage.haskell.org/package/binary)
57−library.
58−Uses [`Data.TextEncoding.encodeUtf8`](https://pursuit.purescript.org/packages/purescript-text-encoding/docs/Data.TextEncoding#v:encodeUtf8).
52+Encode a `String` as UTF8 with a length prefix.
53+
54+We give this as an example, rather than supporting it in the library, because
55+it depends on
56+[`Data.TextEncoding.encodeUtf8`](https://pursuit.purescript.org/packages/purescript-text-encoding/docs/Data.TextEncoding#v:encodeUtf8).
57+
5958```purescript
6059putStringUtf8 :: forall m. (MonadEffect m) => String -> PutM m Unit
6160putStringUtf8 s = do
6261 let stringbuf = Data.ArrayBuffer.Typed.buffer $ Data.TextEncoding.encodeUtf8 s
63− -- Put a 64-bit big-endian length prefix for the length of the utf8 string, in bytes.
64− putUint32be 0
62+ -- Put a 32-bit big-endian length prefix for the length of the utf8 string, in bytes.
6563 putUint32be $ Data.Uint.fromInt $ Data.ArrayBuffer.byteLength stringbuf
6664 putArrayBuffer stringbuf
6765
@@ -77,6 +75,7 @@ way that's compatible with the
7775from the Haskell
7876[__binary__](https://hackage.haskell.org/package/binary)
7977library.
78+
8079```purescript
8180putArrayInt32 :: forall m. (MonadEffect m) => Array Int -> PutM m Unit
8281putArrayInt32 xs = do