jon.recoil.org

Module Rule.Attr_multiple_replaceSource

An advanced module if you want to replace an item with multiple attributes simultaneously.

Sourcemodule Attribute_list : sig ... end
Sourcemodule Parsed_payload_list : sig ... end

Rewrite an item when any of the provided list of attributes are present. It has the same caveats as attr_replace.

This function uses GADT lists to provide type safety for the payloads provided: when you call it with [ attr1; attr2 ] the replacement function will provide you with a Parsed_payload_list.t containing [ attr1_payload option; attr2_payload option ]. These are options because not all the attributes are necessarily present on the item.