Data.Byte

lib/Data/Byte.gob

No module comment.

type Byte = Byte

An integer from 0 to 255, which the compiler provides.

fun toInt : fun(Byte) -> Int
fun fromInt : fun(Int) -> Option Byte
fun truncate : fun(Int) -> Byte

The low eight bits, total and explicitly lossy. The name is the warning.

fun minValue : fun() -> Byte
fun maxValue : fun() -> Byte
fun and : fun(Byte, Byte) -> Byte
fun or : fun(Byte, Byte) -> Byte
fun xor : fun(Byte, Byte) -> Byte
fun not : fun(Byte) -> Byte
fun shl : fun(Byte, Int) -> Byte

Shifting happens in Int and the result is narrowed, so bits shifted off the top are discarded. The shift amount is Int.shl's, so it panics outside 0..63 rather than masking.

fun shr : fun(Byte, Int) -> Byte
fun getLE : [Index c, Key c ~ Int, Value c ~ Byte] fun(c, Int, Int) -> Int

The width-byte integer at at in bytes, for a width from 1 to 8: least significant byte first for getLE, most significant first for getBE. Narrower than 8 bytes it is unsigned; at 8 it fills an Int, so a top bit set reads as a negative number. These work on anything indexed by Int with Byte elements, Array Byte and Vec Byte among them, and panic as indexing does if the bytes run past the end.

fun getBE : [Index c, Key c ~ Int, Value c ~ Byte] fun(c, Int, Int) -> Int
fun putLE : [SetIndex c, Key c ~ Int, Value c ~ Byte] fun(c, Int, Int, Int) -> Unit

Write the low width bytes of n at at, in the order getLE and getBE read them. The bits above them are dropped, as truncate drops them, so a negative n writes its two's complement.

fun putBE : [SetIndex c, Key c ~ Int, Value c ~ Byte] fun(c, Int, Int, Int) -> Unit
instance Eq Byte
instance Ord Byte
instance Show Byte
instance Hash Byte