//! Parts for "combiners". Combiners are custom user-defined macros for our
//! notation/format/language.
use crate::;
/// A macro function, bound to an operator sub-form, which is called with the
/// operands sub-form(s) to determine what should be substituted for the whole
/// form. The `OperativeRef` and `ApplicativeRef` type parameters determine the
/// types used to refer to the functions.
///
/// While these parameters as defined here can allow possibly inconsistent
/// types, further bounds on these are required by a `Parser`'s
/// [`OperatorBindings`](trait.OperatorBindings.html) which ensures that only
/// consistent ones can be used with it, which is the only intended use of this
/// type.
/// The type of "operative" functions. First argument is the "operator"
/// sub-form as a `Datum`; and the second argument is the "operands" sub-form as
/// the `Text` type containing the unparsed operands text; and the third
/// argument is the `Parser`'s `DatumAllocator`. See
/// [`combiner::Result`](type.Result.html) for the description of the return
/// value.
pub type OpFn<DA, CE> = dyn Fn
;
/// The type of "applicative" functions. First argument is the "operator"
/// sub-form as a `Datum`; and the second argument is the "operands" sub-forms
/// as a `Datum::List` containing the recursively parsed operands as separate
/// `Datum`s, or it is a `Datum::EmptyList` if the operands text was empty; and
/// the third argument is the `Parser`'s `DatumAllocator`. See
/// [`combiner::Result`](type.Result.html) for the description of the return
/// value.
pub type ApFn<DA, CE> = dyn Fn ;
/// The type returned by "operative" and "applicative" functions. For a
/// successful `Some` return, the returned `Datum` is substituted for the
/// original form by the parser in the AST it yields. For a successful `None`
/// return, the original form is removed from the AST. An
/// [`Error`](../enum.Error.html) is returned if the combiner fails for any
/// reason.
pub type Result<DA, CE>
= Result;
type DADatum<DA> = ;