comp package:sop-core
Compare two sums with respect to the choice they are making.
A value that chooses the first option is considered smaller than one
that chooses the second option.
If the choices are different, then either the first (if the first is
smaller than the second) or the third (if the first is larger than the
second) argument are called. If both choices are equal, then the
second argument is called, which has access to the elements contained
in the sums.
Compare two sums of products with respect to the choice in the sum
they are making.
Only the sum structure is used for comparison. This is a small wrapper
around
ccompare_NS for a common special case.
Composition of constraints.
Note that the result of the composition must be a constraint, and
therefore, in
Compose f g, the kind of
f is
k -> Constraint. The kind of
g, however,
is
l -> k and can thus be a normal type constructor.
A typical use case is in connection with
All on an
NP or
an
NS. For example, in order to denote that all elements on an
NP f xs satisfy
Show, we can say
All
(Compose Show f) xs.
Extract the contents of a
Comp value.