Text

type LevelStream = Stream.Stream<Nat32>

type TextSeq = Seq.Sequence<Text>

type TextSeqSeq = Seq.Sequence<TextSeq>

type Token = { pos : Nat; text : Text }

type TokenSeq = Seq.Sequence<Token>

type Pattern = Text.Pattern

public func toText(s : TextSeq) : Text

public func flatten(s2 : TextSeqSeq) : TextSeq

public func removeSlice(
  s : TextSeq,
  pos : Nat,
  size : Nat
) : ?(TextSeq, TextSeq, TextSeq)

public func tokens(s : TextSeq, p : Pattern) : TokenSeq

separate text by whitespace, and include all sub-sequences (whitespace and non-whitespace) in the output (a sequence of text sequences).

class WithLevels(levels : LevelStream)

public func putSlice(
  s1 : TextSeq,
  pos : Nat,
  s2 : TextSeq
) : TextSeq

public func deleteSlice(
  s : TextSeq,
  pos : Nat,
  size : Nat
) : TextSeq

Operations that use Sequence.append (via a stateful stream of levels)