Module Kxclib

Utilities regarding refs

val refset : 'a Stdlib.ref -> 'a -> unit

refset r x sets x to ref r.

val refget : 'a Stdlib.ref -> 'a

refget r returns !r.

val refupdate : 'a Stdlib.ref -> ('a -> 'a) -> unit

refupdate r f updates referent of r by f.

val refupdate' : ('a -> 'a) -> 'a Stdlib.ref -> unit

refupdate' f r is equivalent to refupdate r f.

val refupdate_and_calc : 'x Stdlib.ref -> ('x -> 'a * 'x) -> 'a

refupdate_and_calc r f calculate a result and the a updated referent value from the current referent value of r using f.

val refappend : 'a list Stdlib.ref -> 'a -> unit

refappend r x appends x to referent of r.

val refappend' : 'a -> 'a list Stdlib.ref -> unit

refappend' x r is equivalent to refappend r x.

val refpop : 'a list Stdlib.ref -> 'a

refpop r pop first item of the list referred to by r. Raises Not_found if the list is empty.

val incr : int Stdlib.ref -> unit

incr r increases the referent of r by one.

val decr : int Stdlib.ref -> unit

decr r decreases the referent of r by one.

val refupdate'_and_get : ('a -> 'a) -> 'a Stdlib.ref -> 'a
val get_and_refupdate' : ('a -> 'a) -> 'a Stdlib.ref -> 'a
val incr_and_get : int Stdlib.ref -> int
val decr_and_get : int Stdlib.ref -> int
val get_and_incr : int Stdlib.ref -> int
val get_and_decr : int Stdlib.ref -> int

Exception helper functions

val failwith' : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a
val invalid_arg' : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a

(Section name todo)

val neg : int -> int
val mul : int -> int -> int
val div : int -> int -> int
val rem : int -> int -> int

Utilities useful in idiomatic functional programming

val constant : 'a -> 'b -> 'a

constant function

val identity : 'a -> 'a

identity function

val iotaf : (int -> 'a) -> int -> 'a list
val iotaf' : (int -> unit) -> int -> unit
val iotafl : ('a -> int -> 'a) -> 'a -> int -> 'a
val iotafl' : ('a -> 'b -> 'a) -> 'a -> (int -> 'b) -> int -> 'a
val min_by : ('a -> 'b) -> 'a -> 'a -> 'a
val max_by : ('a -> 'b) -> 'a -> 'a -> 'a
val projected_compare : ('a -> 'b) -> 'a -> 'a -> int
val dup : 'x -> 'x * 'x
val swap : ('x * 'y) -> 'y * 'x
val foldl : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
val foldr : ('a -> 'b -> 'b) -> 'b -> 'a list -> 'b
module Functionals : sig ... end
module Fn = Functionals
include module type of Functionals.BasicInfix
val (&) : ('x -> 'y) -> 'x -> 'y
val (%) : ('y -> 'z) -> ('x -> 'y) -> 'x -> 'z
val (%%) : ('a -> 'y -> 'z) -> ('x -> 'y) -> 'a -> 'x -> 'z
val (&>) : ('x -> 'y) -> ('y -> 'z) -> 'x -> 'z
val (?.) : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
val (?..) : ('a -> 'b -> 'c -> 'd) -> 'c -> 'a -> 'b -> 'd
val (!.) : 'b -> ('b -> 'b -> 'c) -> 'b -> 'c
val (!..) : 'c -> ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'd
val (&&>) : ('x -> 'y -> 'z) -> ('z -> 'r) -> 'x -> 'y -> 'r
val (|->) : 'x -> ('x -> unit) -> 'x
val (//) : ('a -> 'x) -> ('b -> 'y) -> ('a * 'b) -> 'x * 'y
val (/>) : ('a * 'b) -> ('b -> 'c) -> 'a * 'c
val (/<) : ('a * 'b) -> ('a -> 'c) -> 'c * 'b
val (|+>) : 'a -> ('a -> 'b) -> 'a * 'b
val (|+<) : 'a -> ('a -> 'b) -> 'b * 'a
val (?>) : ('b -> 'c) -> ('a * 'b) -> 'a * 'c
val (?<) : ('a -> 'c) -> ('a * 'b) -> 'c * 'b
val (?+>) : ('a -> 'b) -> 'a -> 'a * 'b
val (?+<) : ('a -> 'b) -> 'a -> 'b * 'a
val (?&>) : ('y2 -> 'x2) -> (('x1 * 'x2) -> 'r) -> ('x1 * 'y2) -> 'r
val (?&<) : ('y1 -> 'x1) -> (('x1 * 'x2) -> 'r) -> ('y1 * 'x2) -> 'r
val (!!) : ('a -> 'b -> 'x) -> ('a * 'b) -> 'x
val (!?) : (('a * 'b) -> 'x) -> 'a -> 'b -> 'x
include module type of Functionals.CommonTypes
type null = |
type 'x endo = 'x -> 'x

(Section name todo)

module type Pipeable = sig ... end
module type Pipeable_flat_map = sig ... end
module type PipeOpsS = sig ... end
module PipeOps (S : Pipeable) : PipeOpsS with type 'x pipeable := 'x S.t
module PipeOps_flat_map (S : Pipeable_flat_map) : PipeOpsS with type 'x pipeable := 'x S.t

(Section name todo)

module type Monadic = sig ... end
module type MonadOpsS = sig ... end
module MonadOps (M : Monadic) : MonadOpsS with type 'x t := 'x M.t

Enhanced Stdlib

module Either : sig ... end
type ('a, 'b) either = ('a, 'b) Either.t
module Result : sig ... end
module type ResultOfS = sig ... end
module ResultOf (E : sig ... end) : ResultOfS with type err = E.err
module type ResultOfS' = sig ... end
module ResultOf' (E : sig ... end) : ResultOfS' with type err = E.err
module ResultWithErrmsg0 : sig ... end
module Queue : sig ... end
type 'x queue = 'x Queue.t
module Option : sig ... end
val some : 'a -> 'a option
val none : 'a option
val (>?) : 'a option -> ('a -> 'b) -> 'b option
val (>>?) : 'a option -> ('a -> 'b option) -> 'b option
val (|?) : 'a Option.t -> 'a -> 'a
val (|?!) : 'a Option.t -> (unit -> 'a) -> 'a
val (||?) : 'a Option.t -> 'a Option.t -> 'a Option.t
val (||?!) : 'a Option.t -> (unit -> 'a Option.t) -> 'a Option.t
val (&>?) : ('x -> 'y option) -> ('y -> 'z) -> 'x -> 'z option
val (&>>?) : ('x -> 'y option) -> ('y -> 'z option) -> 'x -> 'z option
module Seq : sig ... end
type 'x seq = 'x Seq.t
module Array : sig ... end
module List : sig ... end
include module type of List.Ops_piping
val (|&>) : 'x List.t -> ('x -> 'y) -> 'y List.t

piping map

val (|&>>) : 'x List.t -> ('x -> 'y List.t) -> 'y List.t

piping flat-map

val (|+&>) : 'x List.t -> ('x -> 'y) -> ('x * 'y) List.t

piping map to snd

val (|!>) : 'x List.t -> ('x -> unit) -> unit

piping iter

val (|-!>) : 'x List.t -> ('x -> unit) -> 'x List.t

piping and iter-tapping

val (|@>) : 'x List.t -> ('acc * (('acc * 'x) -> 'acc)) -> 'acc

piping fold_left

val (|?>) : 'x List.t -> ('x -> bool) -> 'x List.t

piping filter

val (|&?>) : 'x List.t -> ('x -> 'y option) -> 'y List.t

piping filter map

val (|+&?>) : 'x List.t -> ('x -> 'y option) -> ('x * 'y) List.t

piping filter map to snd

val iota : int -> int List.t
val iota1 : int -> int List.t
module Hashtbl : sig ... end
module Bytes : sig ... end
module String : sig ... end
module MapPlus (M : Stdlib.Map.S) : sig ... end
module StringMap : sig ... end
module IntMap : sig ... end
module Obj : sig ... end
module IoPervasives : sig ... end
include module type of IoPervasives
val with_input_file : string -> (Stdlib.in_channel -> 'a) -> 'a
val with_output_file : string -> (Stdlib.out_channel -> 'a) -> 'a
val slurp_input : ?buf:bytes -> Stdlib.in_channel -> string
val slurp_stdin : ?buf:bytes -> unit -> string
val slurp_file : string -> string
val spit_file : string -> string -> unit
module Timing : sig ... end
module Int53p : sig ... end
include module type of Int53p.Ops
type int53p = Int53p.int53p
val (~-%) : int53p -> int53p
val (~+%) : int53p -> int53p
val (+%) : int53p -> int53p -> int53p
val (-%) : int53p -> int53p -> int53p
val (*%) : int53p -> int53p -> int53p
val (/%) : int53p -> int53p -> int53p
val (/%%) : int53p -> int53p -> int53p
module Datetime0 : sig ... end

all according to proleptic Gregorian Calender

module ParseArgs : sig ... end
module ArgOptions : sig ... end
module FmtPervasives : sig ... end
type ppf = Stdlib.Format.formatter
val color_enabled : bool Stdlib.ref
val fprintf : Stdlib.Format.formatter -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val printf : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val sprintf : ('a, Stdlib.Format.formatter, unit, string) Stdlib.format4 -> 'a
val eprintf : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
module Fmt = FmtPervasives.Fmt
val condformat : bool -> (('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a) -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a
val pp_of_to_string : ('a -> string) -> Stdlib.Format.formatter -> 'a -> unit
val to_string_of_pp : (Stdlib.Format.formatter -> 'a -> unit) -> 'a -> string
val pps : ('a -> string) -> Stdlib.Format.formatter -> 'a -> unit
val spp : (Stdlib.Format.formatter -> 'a -> unit) -> 'a -> string
val pp_int : Stdlib.Format.formatter -> int -> unit
val pp_float : Stdlib.Format.formatter -> float -> unit
val pp_string : Stdlib.Format.formatter -> string -> unit
val pp_string_quoted : Stdlib.Format.formatter -> string -> unit
val pp_char : Stdlib.Format.formatter -> char -> unit
val pp_bool : Stdlib.Format.formatter -> bool -> unit
val pp_unit : Stdlib.Format.formatter -> unit -> unit
val pp_ref_address : Stdlib.Format.formatter -> 'x Stdlib.ref -> unit
val pp_int32 : Stdlib.Format.formatter -> int32 -> unit
val pp_int64 : Stdlib.Format.formatter -> int64 -> unit
val pp_integer_sep' : padding:(int * char) option -> Stdlib.Format.formatter -> int -> unit
val pp_integer_sep : Stdlib.Format.formatter -> int -> unit
val pp_multiline : Stdlib.Format.formatter -> string -> unit
val pp_exn : Stdlib.Format.formatter -> exn -> unit
val pp_full_exn' : Stdlib.Format.formatter -> (exn * Stdlib.Printexc.raw_backtrace) -> unit
val pp_full_exn : Stdlib.Format.formatter -> exn -> unit
val string_of_symbolic_output_items : Stdlib.Format.symbolic_output_item list -> string
module Log0 : sig ... end
val debug : ?modul:string -> ('a, Stdlib.Format.formatter, unit, unit) Stdlib.format4 -> 'a
val info : ?modul:string -> ('a, Stdlib.Format.formatter, unit, unit) Stdlib.format4 -> 'a
module Runtime_info : sig ... end
type backtrace_info = [
  1. | `ocaml_backtrace of Stdlib.Printexc.raw_backtrace
  2. | `string_stacktrace of string
]
module Backtrace_info : sig ... end
module type Io_style = sig ... end
module Direct_io : sig ... end
module Json : sig ... end
module Jv : sig ... end
module Base64 : sig ... end
module Url_encoding : sig ... end

encode / decode a string according to the RFC 3986 Section 2.1 URI Generic Syntax - Percent-Encoding syntax