Module Rule.Attr_multiple_replace

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

module Attribute_list : sig ... end
module Parsed_payload_list : sig ... end
val attr_multiple_replace : string -> 'a Extension.Context.t -> ('a, 'list) Attribute_list.t -> (ctxt:Expansion_context.Base.t -> 'a -> 'list Parsed_payload_list.t -> 'a) -> t

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.