Logo
Unionpedia
Communication
Get it on Google Play
New! Download Unionpedia on your Android™ device!
Install
Faster access than browser!
 

Fold (higher-order function)

+ Save concept

In functional programming, fold (also termed reduce, accumulate, aggregate, compress, or inject) refers to a family of higher-order functions that analyze a recursive data structure and through use of a given combining operation, recombine the results of recursively processing its constituent parts, building up a return value. [1]

81 relations: Additive identity, Aggregate function, Algebraic data type, Analysis, Anamorphism, Apache Groovy, APL (programming language), Associative property, C Sharp (programming language), C Sharp 3.0, C++, C++17, Catamorphism, Clojure, ColdFusion Markup Language, Common Lisp, Cons, Continuation-passing style, Corecursion, Curl (programming language), D (programming language), Data structure, ECMAScript, Elm (programming language), Erlang (programming language), Evaluation strategy, Extension method, F Sharp (programming language), Fixed-point combinator, Function composition (computer science), Function object, Function pointer, Functional programming, Gosu (programming language), Haskell (programming language), Haxe, Hierarchy, Higher-order function, Homomorphism, Identity element, Infinite loop, Iterated binary operation, J (programming language), Java (programming language), JavaScript, Kotlin (programming language), Lazy evaluation, LFE (programming language), Lisp (programming language), List (abstract data type), ..., Logtalk, Map (higher-order function), Maple (software), Maxima (software), Merge sort, Node (computer science), OCaml, Oz (programming language), Perl, PHP, Polymorphism (computer science), Prefix sum, Prolog, Python (programming language), R (programming language), Recursion, Recursion (computer science), Recursive data type, Ruby (programming language), Rust (programming language), Scala (programming language), Scheme (programming language), Smalltalk, Standard ML, Subroutine, Swift (programming language), Tail call, Terminal and nonterminal symbols, Union (set theory), Wolfram Mathematica, Xtend. Expand index (31 more) »

Additive identity

In mathematics the additive identity of a set which is equipped with the operation of addition is an element which, when added to any element x in the set, yields x. One of the most familiar additive identities is the number 0 from elementary mathematics, but additive identities occur in other mathematical structures where addition is defined, such as in groups and rings.

New!!: Fold (higher-order function) and Additive identity · See more »

Aggregate function

In database management an aggregate function is a function where the values of multiple rows are grouped together to form a single value of more significant meaning or measurement such as a set, a bag or a list.

New!!: Fold (higher-order function) and Aggregate function · See more »

Algebraic data type

In computer programming, especially functional programming and type theory, an algebraic data type is a kind of composite type, i.e., a type formed by combining other types.

New!!: Fold (higher-order function) and Algebraic data type · See more »

Analysis

Analysis is the process of breaking a complex topic or substance into smaller parts in order to gain a better understanding of it.

New!!: Fold (higher-order function) and Analysis · See more »

Anamorphism

In category theory, the anamorphism (from the Greek ἀνά "upwards" and μορφή "form, shape") of a coinductive type denotes the assignment of a coalgebra to its unique morphism to the final coalgebra of an endofunctor.

New!!: Fold (higher-order function) and Anamorphism · See more »

Apache Groovy

Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform.

New!!: Fold (higher-order function) and Apache Groovy · See more »

APL (programming language)

APL (named after the book A Programming Language) is a programming language developed in the 1960s by Kenneth E. Iverson.

New!!: Fold (higher-order function) and APL (programming language) · See more »

Associative property

In mathematics, the associative property is a property of some binary operations.

New!!: Fold (higher-order function) and Associative property · See more »

C Sharp (programming language)

C# (/si: ʃɑːrp/) is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

New!!: Fold (higher-order function) and C Sharp (programming language) · See more »

C Sharp 3.0

The programming language C# version 3.0 was released on 19 November 2007 as part of.NET Framework 3.5.

New!!: Fold (higher-order function) and C Sharp 3.0 · See more »

C++

C++ ("see plus plus") is a general-purpose programming language.

New!!: Fold (higher-order function) and C++ · See more »

C++17

C++17 is the name for the most recent revision of the ISO/IEC 14882 standard for the C++ programming language.

New!!: Fold (higher-order function) and C++17 · See more »

Catamorphism

In category theory, the concept of catamorphism (from the Greek: κατά "downwards" and μορφή "form, shape") denotes the unique homomorphism from an initial algebra into some other algebra.

New!!: Fold (higher-order function) and Catamorphism · See more »

Clojure

Clojure (like "closure") is a dialect of the Lisp programming language.

New!!: Fold (higher-order function) and Clojure · See more »

ColdFusion Markup Language

ColdFusion Markup Language, more commonly known as CFML, is a scripting language for web development that runs on the JVM, the.NET framework, and Google App Engine.

New!!: Fold (higher-order function) and ColdFusion Markup Language · See more »

Common Lisp

Common Lisp (CL) is a dialect of the Lisp programming language, published in ANSI standard document ANSI INCITS 226-1994 (R2004) (formerly X3.226-1994 (R1999)).

New!!: Fold (higher-order function) and Common Lisp · See more »

Cons

In computer programming, is a fundamental function in most dialects of the Lisp programming language.

New!!: Fold (higher-order function) and Cons · See more »

Continuation-passing style

In functional programming, continuation-passing style (CPS) is a style of programming in which control is passed explicitly in the form of a continuation.

New!!: Fold (higher-order function) and Continuation-passing style · See more »

Corecursion

In computer science, corecursion is a type of operation that is dual to recursion.

New!!: Fold (higher-order function) and Corecursion · See more »

Curl (programming language)

Curl is a reflective object-oriented programming language for interactive web applications whose goal is to provide a smoother transition between formatting and programming.

New!!: Fold (higher-order function) and Curl (programming language) · See more »

D (programming language)

D is an object-oriented, imperative, multi-paradigm system programming language created by Walter Bright of Digital Mars and released in 2001.

New!!: Fold (higher-order function) and D (programming language) · See more »

Data structure

In computer science, a data structure is a data organization and storage format that enables efficient access and modification.

New!!: Fold (higher-order function) and Data structure · See more »

ECMAScript

ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.

New!!: Fold (higher-order function) and ECMAScript · See more »

Elm (programming language)

Elm is a domain-specific programming language for declaratively creating web browser-based graphical user interfaces.

New!!: Fold (higher-order function) and Elm (programming language) · See more »

Erlang (programming language)

Erlang is a general-purpose, concurrent, functional programming language, as well as a garbage-collected runtime system.

New!!: Fold (higher-order function) and Erlang (programming language) · See more »

Evaluation strategy

Evaluation strategies are used by programming languages to determine when to evaluate the argument(s) of a function call (for function, also read: operation, method, or relation) and what kind of value to pass to the function.

New!!: Fold (higher-order function) and Evaluation strategy · See more »

Extension method

In object-oriented computer programming, an extension method is a method added to an object after the original object was compiled.

New!!: Fold (higher-order function) and Extension method · See more »

F Sharp (programming language)

F# (pronounced F sharp) is a strongly typed, multi-paradigm programming language that encompasses functional, imperative, and object-oriented programming methods.

New!!: Fold (higher-order function) and F Sharp (programming language) · See more »

Fixed-point combinator

In computer science's combinatory logic, a fixed-point combinator (or fixpoint combinator) is a higher-order function fix that, for any function f that has an attractive fixed point, returns a fixed point x of that function.

New!!: Fold (higher-order function) and Fixed-point combinator · See more »

Function composition (computer science)

In computer science, function composition (not to be confused with object composition) is an act or mechanism to combine simple functions to build more complicated ones.

New!!: Fold (higher-order function) and Function composition (computer science) · See more »

Function object

In computer programming, a function object is a construct allowing an object to be invoked or called as if it were an ordinary function, usually with the same syntax (a function parameter that can also be a function).

New!!: Fold (higher-order function) and Function object · See more »

Function pointer

A function pointer, also called a subroutine pointer or procedure pointer, is a pointer that points to a function.

New!!: Fold (higher-order function) and Function pointer · See more »

Functional programming

In computer science, functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.

New!!: Fold (higher-order function) and Functional programming · See more »

Gosu (programming language)

Gosu is a statically-typed programming language that runs on the Java Virtual Machine released under the Apache 2 license.

New!!: Fold (higher-order function) and Gosu (programming language) · See more »

Haskell (programming language)

Haskell is a standardized, general-purpose compiled purely functional programming language, with non-strict semantics and strong static typing.

New!!: Fold (higher-order function) and Haskell (programming language) · See more »

Haxe

Haxe is a high-level cross-platform multi-paradigm programming language and compiler that can produce applications and source code, for many different computing platforms, from one code-base.

New!!: Fold (higher-order function) and Haxe · See more »

Hierarchy

A hierarchy (from the Greek hierarchia, "rule of a high priest", from hierarkhes, "leader of sacred rites") is an arrangement of items (objects, names, values, categories, etc.) in which the items are represented as being "above", "below", or "at the same level as" one another A hierarchy can link entities either directly or indirectly, and either vertically or diagonally.

New!!: Fold (higher-order function) and Hierarchy · See more »

Higher-order function

In mathematics and computer science, a higher-order function (also functional, functional form or functor) is a function that does at least one of the following.

New!!: Fold (higher-order function) and Higher-order function · See more »

Homomorphism

In algebra, a homomorphism is a structure-preserving map between two algebraic structures of the same type (such as two groups, two rings, or two vector spaces).

New!!: Fold (higher-order function) and Homomorphism · See more »

Identity element

In mathematics, an identity element or neutral element is a special type of element of a set with respect to a binary operation on that set, which leaves other elements unchanged when combined with them.

New!!: Fold (higher-order function) and Identity element · See more »

Infinite loop

An infinite loop (or endless loop) is a sequence of instructions in a computer program which loops endlessly, either due to the loop having no terminating condition, having one that can never be met, or one that causes the loop to start over.

New!!: Fold (higher-order function) and Infinite loop · See more »

Iterated binary operation

In mathematics, an iterated binary operation is an extension of a binary operation on a set S to a function on finite sequences of elements of S through repeated application.

New!!: Fold (higher-order function) and Iterated binary operation · See more »

J (programming language)

The J programming language, developed in the early 1990s by Kenneth E. Iverson and Roger Hui, is a synthesis of APL (also by Iverson) and the FP and FL function-level languages created by John Backus.

New!!: Fold (higher-order function) and J (programming language) · See more »

Java (programming language)

Java is a general-purpose computer-programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.

New!!: Fold (higher-order function) and Java (programming language) · See more »

JavaScript

JavaScript, often abbreviated as JS, is a high-level, interpreted programming language.

New!!: Fold (higher-order function) and JavaScript · See more »

Kotlin (programming language)

Kotlin is a statically typed programming language that runs on the Java virtual machine and also can be compiled to JavaScript source code or use the LLVM compiler infrastructure.

New!!: Fold (higher-order function) and Kotlin (programming language) · See more »

Lazy evaluation

In programming language theory, lazy evaluation, or call-by-need is an evaluation strategy which delays the evaluation of an expression until its value is needed (non-strict evaluation) and which also avoids repeated evaluations (sharing).

New!!: Fold (higher-order function) and Lazy evaluation · See more »

LFE (programming language)

Lisp Flavored Erlang (LFE) is a functional, concurrent, general-purpose programming language and Lisp dialect built on top of Core Erlang and the Erlang Virtual Machine (BEAM).

New!!: Fold (higher-order function) and LFE (programming language) · See more »

Lisp (programming language)

Lisp (historically, LISP) is a family of computer programming languages with a long history and a distinctive, fully parenthesized prefix notation.

New!!: Fold (higher-order function) and Lisp (programming language) · See more »

List (abstract data type)

In computer science, a list or sequence is an abstract data type that represents a countable number of ordered values, where the same value may occur more than once.

New!!: Fold (higher-order function) and List (abstract data type) · See more »

Logtalk

Logtalk is an object-oriented logic programming language that extends and leverages the Prolog language with a feature set suitable for programming in the large.

New!!: Fold (higher-order function) and Logtalk · See more »

Map (higher-order function)

In many programming languages, map is the name of a higher-order function that applies a given function to each element of a list, returning a list of results in the same order.

New!!: Fold (higher-order function) and Map (higher-order function) · See more »

Maple (software)

Maple is a symbolic and numeric computing environment, and is also a multi-paradigm programming language.

New!!: Fold (higher-order function) and Maple (software) · See more »

Maxima (software)

Maxima is a computer algebra system (CAS) based on a 1982 version of Macsyma.

New!!: Fold (higher-order function) and Maxima (software) · See more »

Merge sort

In computer science, merge sort (also commonly spelled mergesort) is an efficient, general-purpose, comparison-based sorting algorithm.

New!!: Fold (higher-order function) and Merge sort · See more »

Node (computer science)

A node is a basic unit used in computer science.

New!!: Fold (higher-order function) and Node (computer science) · See more »

OCaml

OCaml, originally named Objective Caml, is the main implementation of the programming language Caml, created by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, Ascánder Suárez and others in 1996.

New!!: Fold (higher-order function) and OCaml · See more »

Oz (programming language)

Oz is a multiparadigm programming language, developed in the Programming Systems Lab at Université catholique de Louvain, for programming language education.

New!!: Fold (higher-order function) and Oz (programming language) · See more »

Perl

Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages, Perl 5 and Perl 6.

New!!: Fold (higher-order function) and Perl · See more »

PHP

PHP: Hypertext Preprocessor (or simply PHP) is a server-side scripting language designed for Web development, but also used as a general-purpose programming language.

New!!: Fold (higher-order function) and PHP · See more »

Polymorphism (computer science)

In programming languages and type theory, polymorphism (from Greek πολύς, polys, "many, much" and μορφή, morphē, "form, shape") is the provision of a single interface to entities of different types.

New!!: Fold (higher-order function) and Polymorphism (computer science) · See more »

Prefix sum

In computer science, the prefix sum, cumulative sum, inclusive scan, or simply scan of a sequence of numbers is a second sequence of numbers, the sums of prefixes (running totals) of the input sequence: For instance, the prefix sums of the natural numbers are the triangular numbers: |- !input numbers | 1 || 2 || 3 || 4 || 5 || 6 ||...

New!!: Fold (higher-order function) and Prefix sum · See more »

Prolog

Prolog is a general-purpose logic programming language associated with artificial intelligence and computational linguistics.

New!!: Fold (higher-order function) and Prolog · See more »

Python (programming language)

Python is an interpreted high-level programming language for general-purpose programming.

New!!: Fold (higher-order function) and Python (programming language) · See more »

R (programming language)

R is a programming language and free software environment for statistical computing and graphics that is supported by the R Foundation for Statistical Computing.

New!!: Fold (higher-order function) and R (programming language) · See more »

Recursion

Recursion occurs when a thing is defined in terms of itself or of its type.

New!!: Fold (higher-order function) and Recursion · See more »

Recursion (computer science)

Recursion in computer science is a method of solving a problem where the solution depends on solutions to smaller instances of the same problem (as opposed to iteration).

New!!: Fold (higher-order function) and Recursion (computer science) · See more »

Recursive data type

In computer programming languages, a recursive data type (also known as a recursively-defined, inductively-defined or inductive data type) is a data type for values that may contain other values of the same type.

New!!: Fold (higher-order function) and Recursive data type · See more »

Ruby (programming language)

Ruby is a dynamic, interpreted, reflective, object-oriented, general-purpose programming language.

New!!: Fold (higher-order function) and Ruby (programming language) · See more »

Rust (programming language)

Rust is a systems programming language sponsored by Mozilla which describes it as a "safe, concurrent, practical language," supporting functional and imperative-procedural paradigms.

New!!: Fold (higher-order function) and Rust (programming language) · See more »

Scala (programming language)

Scala is a general-purpose programming language providing support for functional programming and a strong static type system.

New!!: Fold (higher-order function) and Scala (programming language) · See more »

Scheme (programming language)

Scheme is a programming language that supports multiple paradigms, including functional programming and imperative programming, and is one of the two main dialects of Lisp.

New!!: Fold (higher-order function) and Scheme (programming language) · See more »

Smalltalk

Smalltalk is an object-oriented, dynamically typed, reflective programming language.

New!!: Fold (higher-order function) and Smalltalk · See more »

Standard ML

Standard ML (SML; "Standard Meta Language") is a general-purpose, modular, functional programming language with compile-time type checking and type inference.

New!!: Fold (higher-order function) and Standard ML · See more »

Subroutine

In computer programming, a subroutine is a sequence of program instructions that performs a specific task, packaged as a unit.

New!!: Fold (higher-order function) and Subroutine · See more »

Swift (programming language)

Swift is a general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. for iOS, macOS, watchOS, tvOS, and Linux.

New!!: Fold (higher-order function) and Swift (programming language) · See more »

Tail call

In computer science, a tail call is a subroutine call performed as the final action of a procedure.

New!!: Fold (higher-order function) and Tail call · See more »

Terminal and nonterminal symbols

In computer science, terminal and nonterminal symbols are the lexical elements used in specifying the production rules constituting a formal grammar.

New!!: Fold (higher-order function) and Terminal and nonterminal symbols · See more »

Union (set theory)

In set theory, the union (denoted by ∪) of a collection of sets is the set of all elements in the collection.

New!!: Fold (higher-order function) and Union (set theory) · See more »

Wolfram Mathematica

Wolfram Mathematica (usually termed Mathematica) is a modern technical computing system spanning most areas of technical computing — including neural networks, machine learning, image processing, geometry, data science, visualizations, and others.

New!!: Fold (higher-order function) and Wolfram Mathematica · See more »

Xtend

Xtend is a general-purpose high-level programming language for the Java Virtual Machine.

New!!: Fold (higher-order function) and Xtend · See more »

Redirects here:

Accumulate (higher-order function), Fold (function), Fold (higher order function), Fold function, Foldl, Foldr, Left fold, Reduce (higher-order function), Reduce function, Right fold.

References

[1] https://en.wikipedia.org/wiki/Fold_(higher-order_function)

OutgoingIncoming
Hey! We are on Facebook now! »