package prelude

  1. Overview
  2. Docs
type formatter = {Format}78.formatter
include module type of struct include Fmt end
val stdout : Stdlib.Format.formatter
val stderr : Stdlib.Format.formatter
val pf : Stdlib.Format.formatter -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val pr : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val epr : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val str : ('a, Stdlib.Format.formatter, unit, string) Stdlib.format4 -> 'a
val kpf : (Stdlib.Format.formatter -> 'a) -> Stdlib.Format.formatter -> ('b, Stdlib.Format.formatter, unit, 'a) Stdlib.format4 -> 'b
val kstr : (string -> 'a) -> ('b, Stdlib.Format.formatter, unit, 'a) Stdlib.format4 -> 'b
val str_like : Stdlib.Format.formatter -> ('a, Stdlib.Format.formatter, unit, string) Stdlib.format4 -> 'a
val with_buffer : ?like:Stdlib.Format.formatter -> Stdlib.Buffer.t -> Stdlib.Format.formatter
val failwith : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a
val failwith_notrace : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a
val invalid_arg : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a
val error : ('b, Stdlib.Format.formatter, unit, ('a, string) Stdlib.result) Stdlib.format4 -> 'b
val error_msg : ('b, Stdlib.Format.formatter, unit, ('a, [> `Msg of string ]) Stdlib.result) Stdlib.format4 -> 'b
type !'a t = Stdlib.Format.formatter -> 'a -> unit
val flush : 'a t
val nop : 'a t
val any : (unit, Stdlib.Format.formatter, unit) Stdlib.format -> 'a t
val using : ('a -> 'b) -> 'b t -> 'a t
val const : 'a t -> 'a -> 'b t
val fmt : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> Stdlib.Format.formatter -> 'a
val cut : 'a t
val sp : 'a t
val sps : int -> 'a t
val comma : 'a t
val semi : 'a t
val append : 'a t -> 'a t -> 'a t
val (++) : 'a t -> 'a t -> 'a t
val concat : ?sep:unit t -> 'a t list -> 'a t
val iter : ?sep:unit t -> (('a -> unit) -> 'b -> unit) -> 'a t -> 'b t
val iter_bindings : ?sep:unit t -> (('a -> 'b -> unit) -> 'c -> unit) -> ('a * 'b) t -> 'c t
val box : ?indent:int -> 'a t -> 'a t
val hbox : 'a t -> 'a t
val vbox : ?indent:int -> 'a t -> 'a t
val hvbox : ?indent:int -> 'a t -> 'a t
val hovbox : ?indent:int -> 'a t -> 'a t
val parens : 'a t -> 'a t
val brackets : 'a t -> 'a t
val braces : 'a t -> 'a t
val quote : ?mark:string -> 'a t -> 'a t
val id : 'a -> 'a
val field : ?label:string t -> ?sep:unit t -> string -> ('b -> 'a) -> 'a t -> 'b t
val record : ?sep:unit t -> 'a t list -> 'a t
val bool : bool t
val int : int t
val nativeint : nativeint t
val int32 : int32 t
val int64 : int64 t
val uint : int t
val unativeint : nativeint t
val uint32 : int32 t
val uint64 : int64 t
val float : float t
val float_dfrac : int -> float t
val float_dsig : int -> float t
val char : char t
val string : string t
val buffer : Stdlib.Buffer.t t
val exn : exn t
val exn_backtrace : (exn * Stdlib.Printexc.raw_backtrace) t
val pair : ?sep:unit t -> 'a t -> 'b t -> ('a * 'b) t
val option : ?none:unit t -> 'a t -> 'a option t
val result : ok:'a t -> error:'b t -> ('a, 'b) Stdlib.result t
val list : ?sep:unit t -> 'a t -> 'a list t
val array : ?sep:unit t -> 'a t -> 'a array t
val seq : ?sep:unit t -> 'a t -> 'a Stdlib.Seq.t t
val hashtbl : ?sep:unit t -> ('a * 'b) t -> ('a, 'b) Stdlib.Hashtbl.t t
val queue : ?sep:unit t -> 'a t -> 'a Stdlib.Queue.t t
val stack : ?sep:unit t -> 'a t -> 'a Stdlib.Stack.t t
module Dump = Fmt.Dump
val si_size : scale:int -> string -> int t
val byte_size : int t
val bi_byte_size : int t
val uint64_ns_span : int64 t
type !'a vec = int * (int -> 'a)
val on_bytes : char vec t -> bytes t
val on_string : char vec t -> string t
val ascii : ?w:int -> ?subst:unit t -> unit -> char vec t
val octets : ?w:int -> ?sep:unit t -> unit -> char vec t
val addresses : ?addr:int t -> ?w:int -> 'a vec t -> 'a vec t
val hex : ?w:int -> unit -> char vec t
val words : string t
val paragraphs : string t
val text : string t
val lines : string t
val truncated : max:int -> string t
val text_loc : ((int * int) * (int * int)) t
val one_of : ?empty:unit t -> 'a t -> 'a list t
val did_you_mean : ?pre:unit t -> ?post:unit t -> kind:string -> 'a t -> ('a * 'a list) t
val if_utf_8 : 'a t -> 'a t -> 'a t
val utf_8 : Stdlib.Format.formatter -> bool
val set_utf_8 : Stdlib.Format.formatter -> bool -> unit
type color = [
  1. | `Black
  2. | `Blue
  3. | `Cyan
  4. | `Green
  5. | `Magenta
  6. | `Red
  7. | `White
  8. | `Yellow
]
type style = [
  1. | `Bg of [ `Black | `Blue | `Cyan | `Green | `Hi of color | `Magenta | `Red | `White | `Yellow ]
  2. | `Black
  3. | `Blue
  4. | `Bold
  5. | `Cyan
  6. | `Faint
  7. | `Fg of [ `Black | `Blue | `Cyan | `Green | `Hi of color | `Magenta | `Red | `White | `Yellow ]
  8. | `Green
  9. | `Italic
  10. | `Magenta
  11. | `None
  12. | `Red
  13. | `Reverse
  14. | `Underline
  15. | `White
  16. | `Yellow
]
val styled : style -> 'a t -> 'a t
type style_renderer = [
  1. | `Ansi_tty
  2. | `None
]
val style_renderer : Stdlib.Format.formatter -> style_renderer
val set_style_renderer : Stdlib.Format.formatter -> style_renderer -> unit
val of_to_string : ('a -> string) -> 'a t
val to_to_string : 'a t -> 'a -> string
val strf : ('a, Stdlib.Format.formatter, unit, string) Stdlib.format4 -> 'a
  • deprecated use Fmt.str instead.
val kstrf : (string -> 'a) -> ('b, Stdlib.Format.formatter, unit, 'a) Stdlib.format4 -> 'b
  • deprecated use Fmt.kstr instead.
val strf_like : Stdlib.Format.formatter -> ('a, Stdlib.Format.formatter, unit, string) Stdlib.format4 -> 'a
  • deprecated use Fmt.str_like instead.
val always : (unit, Stdlib.Format.formatter, unit) Stdlib.format -> 'a t
  • deprecated use Fmt.any instead.
val unit : (unit, Stdlib.Format.formatter, unit) Stdlib.format -> unit t
  • deprecated use Fmt.any instead.
val prefix : unit t -> 'a t -> 'a t
  • deprecated use Fmt.(++) instead.
val suffix : unit t -> 'a t -> 'a t
  • deprecated use Fmt.(++) instead.
val styled_unit : style -> (unit, Stdlib.Format.formatter, unit) Stdlib.format -> unit t
  • deprecated use Fmt.(styled s (any fmt)) instead.
OCaml

Innovation. Community. Security.