Backport from sid to buster
[hcoop/debian/mlton.git] / doc / guide / src / MLtonWord.adoc
1 MLtonWord
2 =========
3
4 [source,sml]
5 ----
6 signature MLTON_WORD =
7 sig
8 type t
9
10 val bswap: t -> t
11 val rol: t * word -> t
12 val ror: t * word -> t
13 end
14 ----
15
16 * `type t`
17 +
18 the type of words. For `MLton.LargeWord` this is `LargeWord.word`,
19 for `MLton.Word` this is `Word.word`, for `MLton.Word8` this is
20 `Word8.word`, for `MLton.Word16` this is `Word16.word`, for
21 `MLton.Word32` this is `Word32.word`, for `MLton.Word64` this is
22 `Word64.word`.
23
24 * `bswap w`
25 +
26 byte swap.
27
28 * `rol (w, w')`
29 +
30 rotates left (circular).
31
32 * `ror (w, w')`
33 +
34 rotates right (circular).