The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Muldis::D::Core::Ordered - Muldis D generic ordered-sensitive operators

VERSION

This document is Muldis::D::Core::Ordered version 0.115.0.

PREFACE

This document is part of the Muldis D language specification, whose root document is Muldis::D; you should read that root document before you read this one, which provides subservient details. Moreover, you should read the Muldis::D::Core document before this current document, as that forms its own tree beneath a root document branch.

DESCRIPTION

This document describes essentially all of the core Muldis D ordered-sensitive operators, essentially all the generic ones that a typical programming language should have.

This documentation is pending.

GENERIC ORDERED-SENSITIVE FUNCTIONS FOR ALL DATA TYPES

These are generic operators that are sensitive to an ordering of a type's values, and are used for such things as list sorting or quota queries or determining before/after/min/max/between/etc. They can potentially be used with values of any data type as long as said data type has a (total) order-determination function defined for it, and all system-defined conceptually-ordered Muldis D scalar root types do.

Each of these functions which has the parameter named func is a wrapper over the order-determination function named in its func argument when the latter function is curried by a calling-function-specific is_reverse_order argument value. For any scalar root type's type-default order function, the argument for func is sys.std.Core.Scalar.order. Each func parameter is optional and defaults to sys.std.Core.Scalar.order if no explicit argument is given to it.

sys.std.Core.Ordered.is_before

function sys.std.Core.Ordered.is_before (Bool <-- $topic : Universal, $other : Universal, $func? : OrdDetCFuncNC)

This function results in Bool:True iff the wrapped function would result in Order:Increase when given the same corresponding 2 arguments plus an is_reverse_order argument of Bool:False, and Bool:False otherwise. Note that this operation is also known as less than or <.

sys.std.Core.Ordered.is_after

function sys.std.Core.Ordered.is_after (Bool <-- $topic : Universal, $other : Universal, $func? : OrdDetCFuncNC)

This function is an alias for sys.std.Core.Ordered.is_before except that it transposes the topic and other arguments. This function results in Bool:True iff the wrapped function would result in Order:Decrease when given the same corresponding 2 arguments plus an is_reverse_order argument of Bool:False, and Bool:False otherwise. Note that this operation is also known as greater than or >.

sys.std.Core.Ordered.is_before_or_same

function sys.std.Core.Ordered.is_before_or_same (Bool <-- $topic : Universal, $other : Universal, $func? : OrdDetCFuncNC)

This function is exactly the same as sys.std.Core.Ordered.is_before except that it results in Bool:True if its 2 primary arguments are identical. Note that this operation is also known as less than or equal to or .

sys.std.Core.Ordered.is_after_or_same

function sys.std.Core.Ordered.is_after_or_same (Bool <-- $topic : Universal, $other : Universal, $func? : OrdDetCFuncNC)

This function is an alias for sys.std.Core.Ordered.is_before_or_same except that it transposes the topic and other arguments. This function is exactly the same as sys.std.Core.Ordered.is_after except that it results in Bool:True if its 2 primary arguments are identical. Note that this operation is also known as greater than or equal to or .

sys.std.Core.Ordered.min

function sys.std.Core.Ordered.min (Universal <-- $topic : Set, $func? : OrdDetCFuncNC)

This function is a reduction operator that recursively takes each pair of its N input element values and picks the minimum of the 2 (which is commutative, associative, and idempotent) until just one is left, which is the function's result. If topic has zero values, then this function will fail. Note that, conceptually min does have an identity value which could be this function's result when topic has zero values, which is the result type's concept of positive infinity; however, in practice there is little benefit to min supporting this identity value, since the wrapped order-determination function can't supply the value, and also many types' concept of positive infinity is impossible or impractically large to represent, such as with the infinite Text type.

sys.std.Core.Ordered.max

function sys.std.Core.Ordered.max (Universal <-- $topic : Set, $func? : OrdDetCFuncNC)

This function is exactly the same as sys.std.Core.Ordered.min except that it results in the maximum input element value rather than the minimum one. (Note that, conceptually max has an identity value which is the result type's concept of negative infinity, but it is unsupported here).

sys.std.Core.Ordered.minmax

function sys.std.Core.Ordered.minmax (Tuple <-- $topic : Set, $func? : OrdDetCFuncNC)

This function results in a binary tuple whose attribute names are min and max and whose respective attribute values are what sys.std.Core.Ordered.min and sys.std.Core.Ordered.max would result in when given the same arguments. If topic has zero values, then this function will fail.

sys.std.Core.Ordered.maybe_min

function sys.std.Core.Ordered.maybe_min (Maybe <-- $topic : Set, $func? : OrdDetCFuncNC)

This function is exactly the same as sys.std.Core.Ordered.min except that it results in a Maybe of what is otherwise the result type, and that result has zero elements if the argument has zero elements, rather than the function failing.

sys.std.Core.Ordered.maybe_max

function sys.std.Core.Ordered.maybe_max (Maybe <-- $topic : Set, $func? : OrdDetCFuncNC)

This function is to sys.std.Core.Ordered.max as sys.std.Core.Ordered.maybe_min is to sys.std.Core.Ordered.min.

sys.std.Core.Ordered.maybe_minmax

function sys.std.Core.Ordered.maybe_minmax (Relation <-- $topic : Set, $func? : OrdDetCFuncNC)

This function results in a binary relation whose attribute names are min and max. If topic has zero values then the result has a single tuple whose respective attribute values are what sys.std.Core.Ordered.min and sys.std.Core.Ordered.max would result in when given the same arguments; if topic has zero values, then the result has zero tuples.

SEE ALSO

Go to Muldis::D for the majority of distribution-internal references, and Muldis::D::SeeAlso for the majority of distribution-external references.

AUTHOR

Darren Duncan (darren@DarrenDuncan.net)

LICENSE AND COPYRIGHT

This file is part of the formal specification of the Muldis D language.

Muldis D is Copyright © 2002-2010, Muldis Data Systems, Inc.

See the LICENSE AND COPYRIGHT of Muldis::D for details.

TRADEMARK POLICY

The TRADEMARK POLICY in Muldis::D applies to this file too.

ACKNOWLEDGEMENTS

The ACKNOWLEDGEMENTS in Muldis::D apply to this file too.