I don’t understand Haskell, but this doesn’t look very complicated: https://hub.darcs.net/darcs/darcs-2.16/browse/src/Darcs/Patch/Match.hs#20
-- | /First matcher, Second matcher and Nonrange matcher/
--
-- When we match for patches, we have a PatchSet, of which we want a
-- subset. This subset is formed by the patches in a given interval
-- which match a given criterion. If we represent time going left to
-- right, then we have (up to) three 'Matcher's:
--
-- * the 'firstMatcher' is the left bound of the interval,
--
-- * the 'secondMatcher' is the right bound, and
--
-- * the 'nonrangeMatcher' is the criterion we use to select among
-- patches in the interval.
---
-- Each of these matchers can be present or not according to the
-- options. The patches we want would then be the ones that all
-- present matchers have in common.
--
-- Alternatively, match flags can also be understood as a 'patchSetMatch'.
-- This (ab-)uses match flags that normally denote a 'nonrangeMatcher',
-- (additionally including the 'OneIndex' flag --index=n), to denote
-- selection of a full 'PatchSet' up to the latest matching patch. This
-- works similar to 'secondMatcher' except for tag matches, which in this
-- case mean to select only the tag and all its dependencies. In other
-- words, the tag will be clean in the resulting 'PatchSet'.
It is interesting that these patterns can be used on most Darcs commands, and they all resolve to logical sets of patches, without using any state ID. This is especially needed for Pijul. I think it’s possible in Darcs because of the patch order (and the command to reorder it).
I was reading about Darcs, and every command takes patterns and matches. These sound really useful. Would it be possible to have something similar?
The page describes these as