Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/Isabelle/Pure/General/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 764 B image not shown  

Quelle  buffer.ML   Sprache: SML

 
(*  Title:      Pure/General/buffer.ML
    Author:     Makarius

Scalable text buffers.
*)


signature BUFFER =
sig
  type T
  val empty: T
  val is_empty: T -> bool
  val add: string -> T -> T
  val length: T -> int
  val contents: T -> string list
  val content: T -> string
  val build: (T -> T) -> T
  val build_content: (T -> T) -> string
end;

structure Buffer: BUFFER =
struct

abstype T = Buffer of string list
with

val empty = Buffer [];

fun is_empty (Buffer xs) = null xs;

fun add "" buf = buf
  | add x (Buffer xs) = Buffer (x :: xs);

fun length (Buffer xs) = fold (Integer.add o size) xs 0;

fun contents (Buffer xs) = rev xs;
val content = implode o contents;

fun build (f: T -> T) = f empty;
fun build_content f = build f |> content;

end;

end;

99%


¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.