gralha-bytes Releases (1): 0.1.0.1 0xb55e70f19b053017c63b38dc937ac6e6 indexed https://jend.leeeet.dev/files.txt?path=gralha-bytes@0.1.0.1 Definitions (80): Bytes.ByteTree (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=ByteTree) # A Bytes is a persistent byte buffer: a balanced tree over a power-of-two capacity. # A flat leaf is one value per index (decoders keep whole words in a Bytes, and # a flat above the leaf level is a uniform run); a word leaf packs four bytes # little-endian, which is how the file effect builds a tree with a quarter of # the nodes and two levels fewer to descend. Each leaf carries its own reading. type ByteTree is Data: ByteFlat{value: U32} ByteWord{value: U32} ByteNode{left: ByteTree, right: ByteTree} Bytes.bytes.lane (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.lane) def bytes.lane(+index: U32) -> U32: Bytes.bytes.word.get (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.word.get) def bytes.word.get(+word: U32, +index: U32) -> U32: Bytes.bytes.word.put (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.word.put) def bytes.word.put(+word: U32, +index: U32, +v: U32) -> U32: Bytes.Bytes (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=Bytes) type Bytes is Data: Bytes{bufTree: ByteTree, size: U32, capacity: U32} Bytes.bytes.empty (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.empty) def bytes.empty() -> Bytes: Bytes.bytes.tree.get (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.tree.get) def bytes.tree.get(bufTree: ByteTree, +capacity: U32, +index: U32) -> U32: Bytes.bytes.tree.set (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.tree.set) def bytes.tree.set(+bufTree: ByteTree, +capacity: U32, +index: U32, +v: U32) -> ByteTree: Bytes.bytes.get (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.get) def bytes.get(bytes: Bytes, +index: U32) -> U32: Bytes.bytes.size (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.size) def bytes.size(bytes: Bytes) -> U32: Bytes.bytes.set (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.set) def bytes.set(+bytes: Bytes, +index: U32, v: U32) -> Bytes: Bytes.bytes.push (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.push) def bytes.push(bytes: Bytes, +v: U32) -> Bytes: Bytes.bytes.string (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.string) def bytes.string(s: String, acc: Bytes) -> Bytes: Bytes.bytes.slice (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.slice) def bytes.slice(n: Nat, +source: Bytes, +start: U32, target: Bytes) -> Bytes: Bytes.bytes.be (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.be) def bytes.be(+bytes: Bytes, +at: U32, count: Nat, acc: U32) -> U32: Bytes.base64.digit (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=base64.digit) def base64.digit(+c: U32) -> U32: Bytes.base64.read (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=base64.read) def base64.read(+s: String, +bits: U32, +count: U32, +out: Bytes) -> Bytes: Bytes.base64 (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=base64) def base64(s: String) -> Bytes: Bytes.BitStream (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=BitStream) type BitStream is Data: BitStream{data: Bytes, position: U32, limit: U32, valid: Bool} Bytes.BitRead (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=BitRead) type BitRead is Data: BitRead{value: U32, stream: BitStream} Bytes.bits.read (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bits.read) def bits.read(stream: BitStream, +count: U32) -> BitRead: Bytes.bits.valid (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bits.valid) def bits.valid(stream: BitStream) -> Bool: Bytes.bits.invalid (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bits.invalid) def bits.invalid(stream: BitStream) -> BitStream: Bytes.bits.align (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bits.align) def bits.align(+stream: BitStream) -> BitStream: Bytes.Huffman (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=Huffman) type Huffman is Data: HuffEmpty{} HuffBad{} HuffLeaf{symbol: U32} HuffNode{zero: Huffman, one: Huffman} @unsafe Bytes.huff.insert (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.insert) def huff.insert(+node: Huffman, +depth: Nat, +codeword: U32, +symbol: U32) -> Huffman: Bytes.huff.counts (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.counts) def huff.counts(n: Nat, +lengths: Bytes, +index: U32, +counts: Bytes) -> Bytes: Bytes.huff.codes (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.codes) def huff.codes(n: Nat, +counts: Bytes, +length: U32, codeword: U32, codes: Bytes) -> Bytes: Bytes.huff.build.loop (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.build.loop) def huff.build.loop(+n: Nat, +lengths: Bytes, +index: U32, +codes: Bytes, +node: Huffman) -> Huffman: Bytes.huff.build (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.build) def huff.build(+lengths: Bytes) -> Huffman: Bytes.huff.read.next (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.read.next) def huff.read.next(read: BitRead, zero: Huffman, one: Huffman, next: Huffman -> BitStream -> BitRead) -> BitRead: Bytes.huff.read (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.read) def huff.read(node: Huffman, +stream: BitStream) -> BitRead: Bytes.huff.fixed.lengths (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.fixed.lengths) def huff.fixed.lengths(n: Nat, +index: U32, out: Bytes) -> Bytes: Bytes.bytes.repeat (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.repeat) def bytes.repeat(n: Nat, +v: U32, out: Bytes) -> Bytes: Bytes.inflate.length.base (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.length.base) def inflate.length.base(index: U32) -> U32: Bytes.inflate.length.bits (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.length.bits) def inflate.length.bits(index: U32) -> U32: Bytes.inflate.distance.base (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.distance.base) def inflate.distance.base(index: U32) -> U32: Bytes.inflate.distance.bits (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.distance.bits) def inflate.distance.bits(index: U32) -> U32: Bytes.inflate.code.order (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.code.order) def inflate.code.order(index: U32) -> U32: Bytes.Inflate (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=Inflate) type Inflate is Data: Inflate{stream: BitStream, output: Bytes} Bytes.inflate.copy (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.copy) def inflate.copy(n: Nat, +distance: U32, +out: Bytes) -> Bytes: Bytes.inflate.distance.extra (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.distance.extra) def inflate.distance.extra(read: BitRead, +length: U32, +base: U32, +out: Bytes, limit: U32) -> Inflate: Bytes.inflate.distance (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.distance) def inflate.distance(read: BitRead, length: U32, out: Bytes, limit: U32) -> Inflate: Bytes.inflate.length.extra (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.length.extra) def inflate.length.extra(read: BitRead, base: U32, distance: Huffman, out: Bytes, limit: U32) -> Inflate: Bytes.inflate.symbol (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.symbol) def inflate.symbol(read: BitRead, distance: Huffman, +out: Bytes, +limit: U32) -> Inflate: Bytes.inflate.codes.next (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.codes.next) def inflate.codes.next(+result: Inflate, next: BitStream -> Bytes -> Inflate) -> Inflate: Bytes.inflate.codes.step (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.codes.step) def inflate.codes.step(+read: BitRead, distance: Huffman, +out: Bytes, limit: U32, next: BitStream -> Bytes -> Inflate) -> Inflate: Bytes.inflate.codes (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.codes) def inflate.codes(+literal: Huffman, +distance: Huffman, stream: BitStream, out: Bytes, +limit: U32) -> Inflate: Bytes.inflate.stored.byte (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.stored.byte) def inflate.stored.byte(read: BitRead, out: Bytes, next: BitStream -> Bytes -> Inflate) -> Inflate: Bytes.inflate.stored.copy (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.stored.copy) def inflate.stored.copy(n: Nat, stream: BitStream, out: Bytes) -> Inflate: Bytes.inflate.stored.nlen (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.stored.nlen) def inflate.stored.nlen(read: BitRead, +length: U32, +out: Bytes, limit: U32) -> Inflate: Bytes.inflate.stored.len (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.stored.len) def inflate.stored.len(read: BitRead, out: Bytes, limit: U32) -> Inflate: Bytes.DeflateTrees (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=DeflateTrees) type DeflateTrees is Data: DeflateTrees{literal: Huffman, distance: Huffman, stream: BitStream} Bytes.inflate.cl.byte (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.cl.byte) def inflate.cl.byte(read: BitRead, codes: Bytes, index: U32, next: BitStream -> Bytes -> Inflate) -> Inflate: Bytes.inflate.cl (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.cl) def inflate.cl(n: Nat, +index: U32, stream: BitStream, codes: Bytes) -> Inflate: Bytes.inflate.length.repeat (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.length.repeat) def inflate.length.repeat(read: BitRead, +base: U32, +value: U32, +remaining: U32, +lengths: Bytes) -> Inflate: Bytes.inflate.length.code (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.length.code) def inflate.length.code(read: BitRead, +remaining: U32, +lengths: Bytes) -> Inflate: Bytes.inflate.lengths.next (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.lengths.next) def inflate.lengths.next(+result: Inflate, remaining: U32, oldSize: U32, next: U32 -> BitStream -> Bytes -> Inflate) -> Inflate: Bytes.inflate.lengths (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.lengths) def inflate.lengths(+remaining: U32, +codes: Huffman, +stream: BitStream, +lengths: Bytes) -> Inflate: Bytes.inflate.trees (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.trees) def inflate.trees(result: Inflate, +litCount: U32, distCount: U32) -> DeflateTrees: Bytes.inflate.dynamic.codes (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.dynamic.codes) def inflate.dynamic.codes(result: Inflate, +litCount: U32, +distCount: U32) -> DeflateTrees: Bytes.inflate.dynamic.header (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.dynamic.header) def inflate.dynamic.header(read: BitRead) -> DeflateTrees: Bytes.inflate.dynamic (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.dynamic) def inflate.dynamic(trees: DeflateTrees, out: Bytes, limit: U32) -> Inflate: Bytes.inflate.block (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.block) def inflate.block(+kind: U32, +stream: BitStream, +out: Bytes, +limit: U32) -> Inflate: Bytes.inflate.block.done (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.block.done) def inflate.block.done(+result: Inflate, last: Bool, next: BitStream -> Bytes -> Inflate) -> Inflate: Bytes.inflate.header (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.header) def inflate.header(read: BitRead, out: Bytes, limit: U32, next: BitStream -> Bytes -> Inflate) -> Inflate: Bytes.inflate.blocks (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=inflate.blocks) def inflate.blocks(stream: BitStream, out: Bytes, +limit: U32) -> Inflate: Bytes.checksum.adler.loop (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=checksum.adler.loop) def checksum.adler.loop(n: Nat, +src: Bytes, +index: U32, +a: U32, b: U32) -> U32: Bytes.checksum.adler (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=checksum.adler) def checksum.adler(+src: Bytes) -> U32: Bytes.checksum.crc.word (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=checksum.crc.word) def checksum.crc.word(n: Nat, +word: U32) -> U32: Bytes.checksum.crc.table (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=checksum.crc.table) def checksum.crc.table(n: Nat, +index: U32, out: Bytes) -> Bytes: Bytes.checksum.crc.loop (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=checksum.crc.loop) def checksum.crc.loop(n: Nat, +src: Bytes, +index: U32, +table: Bytes, +crc: U32) -> U32: Bytes.zlib.result (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=zlib.result) def zlib.result(result: Inflate, +expected: U32, checksum: U32) -> Maybe<&2, Bytes>: Bytes.zlib (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=zlib) def zlib(+src: Bytes, +expected: U32) -> Maybe<&2, Bytes>: Bytes.uri.hex.valid (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=uri.hex.valid) def uri.hex.valid(+c: U32) -> Bool: Bytes.uri.bytes (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=uri.bytes) def uri.bytes(+s: String, +out: Bytes) -> Bytes: Bytes.bytes.depth (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.depth) def bytes.depth(+size: U32, +side: U32, +depth: Nat) -> Nat: Bytes.bytes.zero (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.zero) def bytes.zero(+size: U32) -> Bytes: Bytes.bytes.read.raw (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.read.raw) # A file's bytes, read straight into a byte tree by the effect (File.read # decodes UTF-8, and building the tree in Bend from a byte string costs a # cons cell per byte); Fail carries the errno and its message. def bytes.read.raw(path: String) -> IO(Result<&1, &1, U32 & String, Bytes>): Bytes.bytes.read (https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.read) def bytes.read(path: String) -> IO(Result<&1, &1, U32 & String, Bytes>):