CABRunLengthEncoder

class Object
trait Matchable
class Any

Type members

Classlikes

case
class RunLengthConfig(minRun: Int)

the configuration of our encoder, this will be used in the Reader part of our RWST

the configuration of our encoder, this will be used in the Reader part of our RWST

case
class RunLengthState(lastToken: Option[Token], length: Int, input: List[Token])
Companion
object
Companion
class

Value members

Concrete methods

def done: RunLength[Boolean]
have we exhausted the input?
def emit: RunLength[Unit]
emit the lastToken
def encode(minRun: Int, input: List[Token]): String
def maybeEmit: RunLength[Unit]
emit tokens if the next input token is different than the last
def writeOutput(token: Token, length: Int, minRun: Int): RunLength[Unit]

put output on the writer

put output on the writer

Concrete fields

read a token from the input

read a token from the input

with the above syntax imported, we can perform the same computation as above, but use a for comprehension

with the above syntax imported, we can perform the same computation as above, but use a for comprehension