src/Pure/PIDE/document_id.scala
author Manuel Eberl <manuel@pruvisto.org>
Tue, 22 Apr 2025 19:02:33 +0200
changeset 82537 3dfd62b4e2c8
parent 80462 7a1f9e571046
permissions -rw-r--r--
dropped problematic code equation for multisets for RBT code testing

/*  Title:      Pure/PIDE/document_id.scala
    Author:     Makarius

Unique identifiers for document structure.

NB: ML ticks forwards > 0, JVM ticks backwards < 0.
*/

package isabelle


object Document_ID {
  type Generic = Long
  type Version = Generic
  type Command = Generic
  type Exec = Generic

  val none: Generic = 0
  val make: Counter = Counter.make()

  def apply(id: Generic): String = Value.Long.apply(id)
  def unapply(s: String): Option[Generic] = Value.Long.unapply(s)

  def encode(id: Generic): XML.Body = XML.Encode.long(id)
}