package ppx_repr
PPX deriver for type representations
Install
Dune Dependency
Authors
Maintainers
Sources
repr-fuzz-0.5.0.tbz
sha256=2ed0e1dab950eeb551cbecc3bbc5ddb584b3b3e4b4e039ff3abf7bd6d5b238f9
sha512=bacfef83e5bd2b12a7ccd514ba92525030cdcf85ba1121e9456db7f327c434db599a47667ca9826ab77ed95e0f946347e027bc6c18420c6a8faabf4a491a2a7a
doc/ppx_repr.lib/Ppx_repr_lib/Meta_deriving/Plugin/index.html
Module Meta_deriving.Plugin
Source
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 ->
t
Source
val derive_str :
t ->
loc:Ppxlib.location ->
type_name:string ->
params:string list ->
expr:Ppxlib.expression ->
Ppxlib.structure_item
Source
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)"
>