Documentation

Hale.Word8.Data.Word8

@[inline]

Test if byte is an uppercase ASCII letter. $$\text{isUpper}(w) \iff w \in [65, 90]$$

Equations
Instances For
    @[inline]

    Test if byte is a lowercase ASCII letter. $$\text{isLower}(w) \iff w \in [97, 122]$$

    Equations
    Instances For
      @[inline]

      Test if byte is an ASCII letter. $$\text{isAlpha}(w) \iff \text{isUpper}(w) \lor \text{isLower}(w)$$

      Equations
      Instances For
        @[inline]

        Test if byte is an ASCII decimal digit. $$\text{isDigit}(w) \iff w \in [48, 57]$$

        Equations
        Instances For
          @[inline]

          Test if byte is an ASCII letter or digit. $$\text{isAlphaNum}(w) \iff \text{isAlpha}(w) \lor \text{isDigit}(w)$$

          Equations
          Instances For
            @[inline]

            Test if byte is ASCII whitespace (space, tab, newline, vertical tab, form feed, carriage return). $$\text{isSpace}(w) \iff w \in \{9,10,11,12,13,32\}$$

            Equations
            Instances For
              @[inline]

              Test if byte is an ASCII control character. $$\text{isControl}(w) \iff w < 32 \lor w = 127$$

              Equations
              Instances For
                @[inline]

                Test if byte is a printable ASCII character. $$\text{isPrint}(w) \iff w \in [32, 126]$$

                Equations
                Instances For
                  @[inline]

                  Test if byte is an ASCII hexadecimal digit. $$\text{isHexDigit}(w) \iff \text{isDigit}(w) \lor w \in [65,70] \lor w \in [97,102]$$

                  Equations
                  Instances For
                    @[inline]

                    Test if byte is an ASCII octal digit. $$\text{isOctDigit}(w) \iff w \in [48, 55]$$

                    Equations
                    Instances For
                      @[inline]

                      Test if byte is in the ASCII range. $$\text{isAscii}(w) \iff w \le 127$$

                      Equations
                      Instances For
                        @[inline]

                        Convert an uppercase ASCII letter to lowercase; other bytes unchanged. $$\text{toLower}(w) = \begin{cases} w + 32 & \text{if } w \in [65,90] \\ w & \text{otherwise} \end{cases}$$

                        Equations
                        Instances For
                          @[inline]

                          Convert a lowercase ASCII letter to uppercase; other bytes unchanged. $$\text{toUpper}(w) = \begin{cases} w - 32 & \text{if } w \in [97,122] \\ w & \text{otherwise} \end{cases}$$

                          Equations
                          Instances For

                            toLower is idempotent: applying it twice yields the same result. $$\forall w.\; \text{toLower}(\text{toLower}(w)) = \text{toLower}(w)$$

                            Proved by exhaustive evaluation over all 256 UInt8 values via native_decide.

                            toUpper is idempotent: applying it twice yields the same result. $$\forall w.\; \text{toUpper}(\text{toUpper}(w)) = \text{toUpper}(w)$$

                            Proved by exhaustive evaluation over all 256 UInt8 values via native_decide.

                            toLower maps uppercase letters to lowercase letters. $$\forall w.\; \text{isUpper}(w) \to \text{isLower}(\text{toLower}(w))$$

                            Proved by exhaustive evaluation over all 256 UInt8 values via native_decide.

                            toUpper maps lowercase letters to uppercase letters. $$\forall w.\; \text{isLower}(w) \to \text{isUpper}(\text{toUpper}(w))$$

                            Proved by exhaustive evaluation over all 256 UInt8 values via native_decide.