package alba
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=062f33c55ef39706c4290dff67d5a00bf009051fd757f9352be527f629ae21fc
md5=eb4edc4d6b7e15b83d6397bd34994153
doc/alba.fmlib/Fmlib/Readable_printer/index.html
Module Fmlib.Readable_printer
A readable printer is a structure you can issue print commands on and which returns a readable structure which can be read character by character.
Principles
A readable printer is a very lightweight and lazy structure. Issuing a command like string "hello" just stores the string and does nothing else.
Since the printer is organized as a monoid you chain to printers p1 and p2 by p1 <+> p2.
If you printed all your stuff to the printer p you use readable p to generate a readable structure. The readable structure is lazy as well. It just has the first item (string, substring, fill or character) explicitly and a function to generate the rest if needed. So the actual output is generated on demand.
Readable Structure
module R : Module_types.READABLEThe readable structure returned by the printer.
Basics
val empty : tThe readable printer printing nothing.
Print Commands
val string : string -> tstring s prints the string s.
val substring : string -> int -> int -> tsubstring s start len prints the substring of s starting at position start with length len.
val fill : int -> char -> tfill n c prints the character c n times.
val char : char -> tchar c prints the character c.