“How do you describe endianness (or byte-order) as a type in your code?”
This proposal is a simple answer to that simple question.
You may often take byte-order into account when you get involved in, for example, stream programming. While network byte-order is defined as big endian, you may have to handle some other stream whose endian is unknown in advance. In such case, you want a type that identifies endianness to write code like let thatEndian = ByteOrder.littleEndian
.