Word16

16-bit unsigned integer type
16-bit unsigned integer type
ShortByteStrings encoded as UTF16-LE, suitable for windows FFI calls. Word16s are *always* in BE encoding (both input and output), so e.g. pack takes a list of BE encoded [Word16] and produces a UTF16-LE encoded ShortByteString. Likewise, unpack takes a UTF16-LE encoded ShortByteString and produces a list of BE encoded [Word16]. Indices and lengths are always in respect to Word16, not Word8. All functions will error out if the input string is not a valid UTF16 stream (uneven number of bytes). So use this module with caution.
Generates a random 16-bit word in the given [inclusive,inclusive] range. This is a specialization of integral, offered for convenience.
Decode a Word16 from a Dhall Natural.
>>> input word16 "42"
42
Encode a 16-bit unsigned integer as 4 bytes.
Note: This results in a zigzag encoded number. Avro does not have unsigned types.
Unsigned 16-bit word.
Parse a LEB-128-encoded number. If the number is larger than 0xFFFF, fails with the provided error.
Construct a BV from a Word16.
>>> let buf = pack [1,2,3,4,5,6,7,8]

>>> word16 buf
258
Deserialize an unsigned 16-bit integer in default byte order.
Serialize an unsigned 16-bit integer in the default byte order.
Word16# type
Not on Stackage, so not searched. Word16 library
Decode JSON number to bounded Word16
Encode JSON number to bounded Word16