list of byte encoded as JS Uint8Array + demo more readable

This commit is contained in:
Joeri Exelmans 2025-03-17 20:14:57 +01:00
parent 574651ccb7
commit 3d08485a08
6 changed files with 102 additions and 37 deletions

15
primitives/byte.js Normal file
View file

@ -0,0 +1,15 @@
import { fnType } from "../type_registry.js";
import {Type, Function} from "../metacircular.js";
import {Byte, Bool} from "./symbols.js";
const eqByte = x => y => x === y;
const Byte_to_Bool = fnType({in: Byte, out: Bool});
const Byte_to_Byte_to_Bool = fnType({in: Byte, out: Byte_to_Bool});
export const ModuleByte = [
{i: Byte , t: Type },
{i: Byte_to_Bool , t: Function },
{i: Byte_to_Byte_to_Bool , t: Function },
{i: eqByte , t: Byte_to_Byte_to_Bool },
];