Documentation

QedShareCli.LineCut

Cutting a stream into lines #

stdinShareRanges and fileShareRanges (in Pipeline) cut a text that is held as a whole. For megabyte shares that means holding every share on stdin, or in a file, at once.

LineCut cuts a stream of chunks into the same lines, one at a time: the numbered non-blank lines, without the line feeds, and without a byte order mark at the start of the first line. cutLines runs it over a list of chunks. cutLines_eq (in LineSpec) proves that it returns the lines of the joined text, however the text is cut into chunks.

The state between chunks: the bytes of the line that is not finished yet, and its number (counting from 1).

  • buf : ByteArray

    The start of the current line.

  • lineNo : Nat

    The number of the current line.

Instances For

    A finished line: without a byte order mark if it is the first line.

    Equations
    Instances For

      Loop for LineCut.feed: p is the byte looked at, start where the current line begins in this chunk.

      Equations
      Instances For

        Add a chunk: the lines it finishes (number and bytes, without the line feed), and the new state.

        Equations
        Instances For

          The last line, after the last chunk (it has no line feed after it).

          Equations
          Instances For

            true if the bytes are empty or only whitespace.

            Equations
            Instances For

              The numbered non-blank lines of the text made of the chunks.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For