io.github.kory33.s2mctest.core.connection.codec.dsl

Type members

Classlikes

The instruction set for an embedded domain specific language (eDSL) that is able to express the process of

The instruction set for an embedded domain specific language (eDSL) that is able to express the process of

  • reading chunks of binary data from some (possibly infinite) binary data source
  • raising parse errors
  • purely transforming obtained chunks into useful data structures

The instructions present in DecodeFiniteBytes, except those already present in ReadBytesInstruction.

The instructions present in DecodeFiniteBytes, except those already present in ReadBytesInstruction.

Types

Programs of ReadBytes DSL.

Programs of ReadBytes DSL.

ReadBytes DSL itself has a free monadic structure, but a sensible interpreter (other than that injects programs into another free monad) should satisfy the following law:

 read(0) <==> pure(fs2.Chunk.empty[Byte]); // (read(0)-pure)

where <==> denotes a semantic equivalence.

Programs of ReadDelimitedBytes DSL.

Programs of ReadDelimitedBytes DSL.

ReadDelimitedBytes DSL itself has a free monadic structure, but a sensible interpreter (other than that injects programs into another free monad) should satisfy the following law:

 read(0) <==> pure(fs2.Chunk.empty[Byte]); // (read(0)-idempotent)

 readUntilTheEnd << readUntilTheEnd <==> readUntilTheEnd // (readUntilTheEnd-<<-idempotent)
 readUntilTheEnd >> read(n) >> fa <==> readUntilTheEnd >> read(n).as(a) // for every fa: F[A], a: A (readUntilTheEnd-read-fail)

where <==> denotes a semantic equivalence.

The instruction set for an embedded domain specific language (eDSL) to read bytes from a finite sequence of bytes.

The instruction set for an embedded domain specific language (eDSL) to read bytes from a finite sequence of bytes.