To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

Comparison of programming languages (functional programming)

From Wikipedia, the free encyclopedia

This page provides the comparison tables of functional programming instructions between programming languages. Comparison of basic instructions of imperative paradigm is provided by the comparison of basic instructions.

YouTube Encyclopedic

  • 1/3
    Views:
    6 066
    343 783
    1 964
  • Programming Paradigms, Assembly, Procedural, Functional & OOP | Ep28
  • Programming Paradigms - Computerphile
  • How important is the SPEED of a Programming Language?

Transcription

List operations

Function applications and lists

For brevity, these words will have the specified meanings in the following tables (unless noted to be part of language syntax):

funcN
A function. May be unary or n-ary (or always unary for languages without n-ary functions).
func1, func2, etc.
functions of specific arity. func (with no number) is the same as func1, also known as a projection in many languages.
pred
Unary function returning a Boolean value. (ML type: 'a -> bool) (C-like type: bool pred<T>(T t)).
list
The list being operated on.
args
Comma-separated list of one or more argument names, in the form of arg1, arg2, ..., argn.
pattern
A pattern, in languages with pattern matching.
val
Any relevant value, depending on context.
identity lambda lambda map apply filter fold sum
Python lambda x: x lambda args: expr map(func, list) nfunc(*arguments) filter(pred, list) functools.reduce(func2, list) sum(list)
Mathematica #& (expr)& (arguments are #1, #2, etc.)

Function[{args},expr]

Map[func, list]

func /@ list

Apply[nfunc, args]

nfunc@@args

Select[list, pred] Fold[func2, val, list] Apply[Plus,list]

Plus@@list

C#[1] x => x (args) => expr Enumerable.Select(list, func) Requires reflection Enumerable.Where(list, pred) Enumerable.Aggregate(list, func2)

Enumerable.Aggregate(list, val, func2)

Enumerable.Sum(list)

Enumerable.Sum(list, func)

Visual Basic .NET[1] Function(x) x Function(args) expr
F#[2] (can use Enumerable as well) id(built-in)

fun x -> x

fun pattern -> expr Seq.map func list Seq.filter pred list Seq.fold func2 val list Seq.sum list

Seq.sumBy func list

Numerical operations on lists

comp
a binary function that returns a value indicating sort order (an integer in most languages).
sort max min
Python sorted(list) max(list) min(list)
Mathematica Sort[list] Max[list] Min[list]
C#[1] Enumerable.OrderBy(list, comp) Enumerable.Max(list, func) Enumerable.Min(list, func)
Visual Basic .NET[1]
F#[2] Seq.sort list

Seq.sortBy comp list

seq.max

seq.maxBy func list

seq.min

seq.minBy func list

Iterations on lists

group by
Python itertools.groupby(list, func)[3]
Mathematica GroupBy[list, func][wolfram 1]
C#[1] Enumerable.GroupBy(list, func)
Visual Basic .NET[1]
F#[2] seq.groupBy func list

Generating lists by combinatorics tools

start
first value of range.
step
increment of range.
count
number of items in range.
last
inclusive last value of range.
end
exclusive last value of range.
Generate range (lazily) Infinite range (lazily)
Python xrange(start, end, step) (Python 2)[4]

range(start, end, step) (Python 3)[5]

itertools.count(start, step)
C#[1] Enumerable.Range(start, count) Enumerable.Range(start, Int32.MaxValue)
Visual Basic .NET[1]
F#[2] seq { start..step..last } Seq.initInfinite func

References

  1. ^ a b c d e f g h "Enumerable Class (System.Linq)". Microsoft Docs. Microsoft. Retrieved 2019-08-29.
  2. ^ a b c d "Collections.Seq Module (F#)". Microsoft Developer Network. Microsoft. Retrieved 2019-08-29.
  3. ^ "itertools — Functions creating iterators for efficient looping". Python 3.7.4 documentation. Python Software Foundation. Retrieved 2019-08-29.
  4. ^ "Built-in Functions". Python 2.7.16 documentation. Python Software Foundation. Retrieved 2019-08-29.
  5. ^ "Built-in Types". Python 3.7.4 documentation. Python Software Foundation. Retrieved 2019-08-29.
  1. ^ "GroupBy". Wolfram Language Documentation. Wolfram. Retrieved 2019-08-29.


This page was last edited on 26 December 2023, at 22:14
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.