package pidgin
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9f05aa80a2867cc15fabbf6d52239567d2d3b386c611dc0467c27799526e5bfc
sha512=42ae7eefe12dfba69266a1e4a19a36c7e4000a30325d222cff8f95fafb011d886b455f3aef0553c4de40d0f7d23455fdbbcca9a273a7095ca6f9d6e999e7aba7
doc/pidgin/Pidgin/Conv/index.html
Module Pidgin.ConvSource
Describes converters for lifting OCaml values into Repr.t.
Types
Signatures
Converters
Build a record. If the flag normalize_keys is true (default value) keys are lowercased and trimmed.
Specific terms
Make use of the minimal nature of ASTs to construct more complex expressions. Mostly using records.
option conv converter for option. use null for describing None and conv for Some.
sum f x produce a sum-type for a given x. The function f return a couple of constructor-name and value. The result is wrapped into the following record: {constr = "constr-name"; value = value}.
pair fst snd (a, b) produce a product type for a given pair a, b. The result is wrapped into the following record: {first = a; second = b}.
result ~ok ~error is a converter for result values. It uses sum under the hood.
either ~ok ~error is a converter for Either values. It uses sum under the hood.
triple ca cb cd is a converter for triples. Under the hood, triple are pair.
int32 is a converter for int32. It use {constr = "int32"; value = string n} as an underlying representation.
int64 is a converter for int64. It use {constr = "int64"; value = string n} as an underlying representation.
Specific converters
into (module Proj) converts value using Proj.to_pidgin.
Mapping
using f conv is a contramap. If we have a function from b to a, then we can get a conversion from a to t to b to t.