package ppx_repr
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
PPX deriver for type representations
Install
dune-project
Dependency
Authors
Maintainers
Sources
repr-0.8.0.tbz
sha256=1728423b8b0208f9b032ad3e05dd96a43b92cd76416f9146e394f0b0ba133347
sha512=3cd97e9a8feb9d03b88bee73fec51765d2573234ee60aeeb3ce5ced552cb0d8bd70cffe52182f517a5785a428baf685be27f7f419cda1b8167aa4037761de4ff
doc/ppx_repr.lib/Ppx_repr_lib/Meta_deriving/Plugin/index.html
Module Meta_deriving.PluginSource
A Plugin.t is a pair of functions that extend a representable type with specialised generic operations: one to supply the implementation of the specialistion, and one to supply its type.
For instance, the generic operation equal : 'a Repr.t -> 'a -> 'a -> equal could be packaged as the following plugin:
create
~intf:(fun loc t -> [%type: [%t t] -> [%t t] -> bool])
~impl:(fun loc t -> [%expr Repr.unstage (Repr.equal [%e t])])That is:
- given some type
t, its equality function has typet -> t -> bool, - given a runtime representation of
t, we can derive an equality function viaRepr.equal.
Source
val create :
?type_name:[ `before | `after ] ->
impl:(Ppxlib.location -> Ppxlib.expression -> Ppxlib.expression) ->
intf:(Ppxlib.location -> Ppxlib.core_type -> Ppxlib.core_type) ->
string ->
tSource
val derive_str :
t ->
loc:Ppxlib.location ->
type_name:string ->
params:string list ->
expr:Ppxlib.expression ->
Ppxlib.structure_itemSource
val derive_sig :
t ->
loc:Ppxlib.location ->
type_name:string ->
params:Ppxlib.core_type list ->
ctyp:Ppxlib.core_type ->
Ppxlib.signature_item sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>