=pod =encoding utf8 =head1 NAME Muldis::D::Ext::Set - Muldis D extension for Set and Maybe specific operators =head1 VERSION This document is Muldis::D::Ext::Set version 0.26.0. =head1 PREFACE This document is part of the Muldis D language specification, whose root document is L; you should read that root document before you read this one, which provides subservient details. =head1 DESCRIPTION Muldis D has a mandatory core set of system-defined (eternally available) entities, which is referred to as the I or the I; they are the minimal entities that all Muldis D implementations need to provide; they are mutually self-describing and are used to bootstrap the language; any entities outside the core, called I, are non-mandatory and are defined in terms of the core or each other, but the reverse isn't true. This current C document describes the system-defined I, which consists of generic operators that are specific to the C and C parameterized relation types, and said operators are short-hands for generic relational operators in the language core. This current document does not describe the polymorphic operators that all types, or some types including core types, have defined over them; said operators are defined once for all types in L. I =head1 SYSTEM-DEFINED SET-CONCERNING FUNCTIONS Each C parameter is optional and defaults to the zero-attribute tuple if no explicit argument is given to it. =over =item C This function results in C iff its C argument matches the sole attribute of a tuple of its C argument (that is, iff conceptually C is a member of C), and C otherwise. This function will fail|warn if its 2 arguments are incompatible as per C. =item C This function is exactly the same as C except that it results in the opposite boolean value when given the same arguments. =item C This function results in a C that is the relational union of C and a Set whose sole tuple has the sole attribute value of C; that is, conceptually the result is C inserted into C. As a trivial case, if C already exists in C, then the result is just C. =item C This function is exactly the same as C except that it will fail if C already exists in C. =item C This function results in a C that is the relational difference from C of a Set whose sole tuple has the sole attribute value of C; that is, conceptually the result is C deleted from C. As a trivial case, if C already doesn't exist in C, then the result is just C. =item C This function is a generic reduction operator that recursively takes each pair of input values in C and applies an argument-specified scalar or nonscalar value-resulting function (which is both commutative and associative) to the pair until just one input value is left, which is the result. The function to apply is named in the C argument, and that function must have 3 arguments named C, C, C; the last parameter is curried with the same-named argument of C, and the first 2 parameters are the 2 input scalar or nonscalar values for an invocation. If C has zero values, then C results in the value given in C. I may be changed to take a function name rather than a value, for consistency with C.> This function will fail|warn if the |declared type of C isn't a subtype of the |declared type of the sole attribute of C. =item C This function is exactly the same as C except that it does not take an C argument, and it results in a C of what is otherwise the result type, and that result has zero elements if the argument has zero elements. =item C This function results in a C whose sole attribute is tuple-typed and the attribute values are all the tuples of C; is a short-hand for a relational wrap of all attributes of C such that the new tuple-valued attribute is named C. =item C This function results in a C consisting of all the values of the attribute of C named by C. It is a short-hand for a unary projection of just the named attribute plus its renaming to C. =back =head1 SYSTEM-DEFINED MAYBE-CONCERNING FUNCTIONS =over =item C This selector function results in the only zero-tuple Maybe value. =item C This selector function results in the Maybe value with a single tuple whose C attribute's value is the C argument. =item C This function results in the scalar or nonscalar value of the sole attribute of the sole tuple of its argument, which always exists when the argument is a C. =item C This function results in the scalar or nonscalar value of the sole attribute of the sole tuple of its argument, if said tuple exists; otherwise, it results in the default value of the scalar or nonscalar data type whose name is given in the C argument. This function is a short-hand for invoking C with the result from invoking C. =item C This function results in the scalar or nonscalar value of the sole attribute of the sole tuple of C, if said tuple exists; otherwise, it results in C. This function will warn if the declared type of C isn't a subtype of the declared type of the attribute. =back =head1 SEE ALSO Go to L for the majority of distribution-internal references, and L for the majority of distribution-external references. =head1 AUTHOR Darren Duncan (C) =head1 LICENSE AND COPYRIGHT This file is part of the formal specification of the Muldis D language. Muldis D is Copyright © 2002-2008, Darren Duncan. See the LICENSE AND COPYRIGHT of L for details. =head1 TRADEMARK POLICY The TRADEMARK POLICY in L applies to this file too. =head1 ACKNOWLEDGEMENTS The ACKNOWLEDGEMENTS in L apply to this file too. =cut