First-class functions: Difference between revisions

Content deleted Content added
→‎{{header|Mercury}}: Reimplemented using more idiomatic use of higher-order functions for ease of expression.
Line 864: Line 864:
# A list of "forward" functions is provided (sin, cosine and a lambda that calls ln).
# A list of "forward" functions is provided (sin, cosine and a lambda that calls ln).
# A list of "reverse" functions is provided (asin, acosine and a lambda that calls exp).
# A list of "reverse" functions is provided (asin, acosine and a lambda that calls exp).
# The lists are mapped in corresponding members through an anonymous function that compose the resulting pairs of functions and apply them to the value 0.5.
# The lists are mapped in corresponding members through an anonymous function that composes the resulting pairs of functions and applies them to the value 0.5.
# The results are returned and printed when all function pairs have been processed.
# The results are returned and printed when all function pairs have been processed.