package gendarme

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module GendarmeSource

This module provides the Gendarme library

Sourceexception Unimplemented_case

Generic failover exception when handling unhandled type extensions

Sourceexception Unknown_field

Exception raised when unmarshalling unknown record fields or variant cases

Sourceexception Type_error

Exception raised when unmarshalling data to the wrong type

Sourceexception Unpack_error

Exception raised when unpacking values from a different encoder. This should not be raised under normal circumstances.

Sourceexception Unknown_alt_default

Exception raised when getting the default value of a variant type. This usually happens when unmarshalling a record type which does not provide a default value for variants. Variant types require specifying a default value with [@default] when used in records.

Sourcetype _ t = ..

Extensible GADT wrapping OCaml types

Sourcetype target = ..

Extensible type to register new encoding targets

Sourcetype encoder = ..

Extensible type to register new encoders

Sourcetype 'a ty = unit -> 'a t

Convenience type

Sourcemodule type M = sig ... end

Minimal encoder signature

Sourcemodule type S = sig ... end

Encoder signature

Sourcetype 'a o_lens = {
  1. o_fds : (encoder * string) list;
  2. o_get : 'a -> (encoder * string) -> target;
  3. o_put : 'a -> (encoder * string) -> target -> 'a;
  4. o_def : 'a;
}

Record marshalling lens type

Sourcetype 'a a_lens = {
  1. a_get : (module M) -> 'a -> target;
  2. a_put : (module M) -> target -> 'a;
}

Variant marshalling lens type

Sourcetype ('a, 'b) p_lens = {
  1. p_wit : 'b ty;
  2. p_get : 'a -> 'b;
  3. p_put : 'b -> 'a;
}

Proxy lens type

Sourcetype t +=
  1. | Int : int t
  2. | Float : float t
  3. | String : string t
  4. | Bool : bool t
  5. | List : 'a ty -> 'a list t
  6. | Option : 'a ty -> 'a option t
  7. | Empty_list : string list t
  8. | Tuple2 : 'a ty * 'b ty -> ('a * 'b) t
  9. | Tuple3 : 'a ty * 'b ty * 'c ty -> ('a * 'b * 'c) t
  10. | Tuple4 : 'a ty * 'b ty * 'c ty * 'd ty -> ('a * 'b * 'c * 'd) t
  11. | Tuple5 : 'a ty * 'b ty * 'c ty * 'd ty * 'e ty -> ('a * 'b * 'c * 'd * 'e) t
  12. | Object : 'a o_lens -> 'a t
  13. | Alt : 'a a_lens -> 'a t
  14. | Proxy : ('a, 'b) p_lens -> 'a t
  15. | Map : 'a ty * 'b ty -> ('a * 'b) list t

Extension of t to usual OCaml types

Sourceval default : 'a ty -> unit -> 'a

Get the default value for the given type

Sourceval get : ?v:'a -> 'a ty -> 'a

Get the given value or the default one for the given type

Sourceval marshal : (module M with type t = 'a) -> ?v:'b -> 'b ty -> 'a

Fallback marshaller

Sourceval unmarshal : (module M with type t = 'a) -> ?v:'a -> 'b ty -> 'b

Fallback unmarshaller

Sourceval assoc : encoder -> ?v:'a -> 'a o_lens -> (string * target) list

Helper function to simplify marshalling records

Sourceval deassoc : encoder -> 'a o_lens -> (string * target) list -> 'a

Helper function to simplify unmarshalling records

Sourceval int : unit -> int t

int witness

Sourceval float : unit -> float t

float witness

Sourceval string : unit -> string t

string witness

Sourceval bool : unit -> bool t

bool witness

Sourceval list : 'a ty -> unit -> 'a list t

'a list witness builder

Sourceval option : 'a ty -> unit -> 'a option t

'a option witness builder

Sourceval empty_list : unit -> string list t

Empty 'a list witness

Sourceval tuple2 : 'a ty -> 'b ty -> unit -> ('a * 'b) t

('a * 'b) witness builder

Sourceval pair : 'a ty -> 'b ty -> unit -> ('a * 'b) t

Alias for tuple2

Sourceval double : 'a ty -> 'b ty -> unit -> ('a * 'b) t

Alias for tuple2

Sourceval couple : 'a ty -> 'b ty -> unit -> ('a * 'b) t

Alias for tuple2

Sourceval tuple3 : 'a ty -> 'b ty -> 'c ty -> unit -> ('a * 'b * 'c) t

('a * 'b * 'c) witness builder

Sourceval triple : 'a ty -> 'b ty -> 'c ty -> unit -> ('a * 'b * 'c) t

Alias for tuple3

Sourceval tuple4 : 'a ty -> 'b ty -> 'c ty -> 'd ty -> unit -> ('a * 'b * 'c * 'd) t

('a * 'b * 'c * 'd) witness builder

Sourceval quadruple : 'a ty -> 'b ty -> 'c ty -> 'd ty -> unit -> ('a * 'b * 'c * 'd) t

Alias for tuple4

Sourceval tuple5 : 'a ty -> 'b ty -> 'c ty -> 'd ty -> 'e ty -> unit -> ('a * 'b * 'c * 'd * 'e) t

('a * 'b * 'c * 'd * 'e) witness builder

Sourceval quintuple : 'a ty -> 'b ty -> 'c ty -> 'd ty -> 'e ty -> unit -> ('a * 'b * 'c * 'd * 'e) t

Alias for tuple5

Sourcetype 'a seq = 'a Seq.t

'a Seq.t alias

Sourceval seq : 'a ty -> unit -> 'a Seq.t t

'a Seq.t witness builder

Sourcemodule Seq : sig ... end

Seq module emulation

Sourceval hashtbl : 'a ty -> 'b ty -> unit -> ('a, 'b) Hashtbl.t t

('a, 'b) Hashtbl.t witness builder

Sourcemodule Hashtbl : sig ... end

Hashtbl module emulation

OCaml

Innovation. Community. Security.