Difference between revisions of "Functional programming"

From Marek Běhálek Wiki
Jump to navigation Jump to search
(Marked this version for translation)
Line 1: Line 1:
 
<translate>
 
<translate>
== Functional Programming ==
+
== Functional Programming == <!--T:1-->
 
As the expressions above imply, Haskell has a notion of integers
 
As the expressions above imply, Haskell has a notion of integers
 
and floating point numbers. Integers can be arbitrarily large.
 
and floating point numbers. Integers can be arbitrarily large.
 
Here, ~(^)~ provides integer exponentiation.
 
Here, ~(^)~ provides integer exponentiation.
  
 +
<!--T:2-->
 
<pre style="color: silver; background: black;">
 
<pre style="color: silver; background: black;">
 
ghci> 313 ^ 15
 
ghci> 313 ^ 15
Line 10: Line 11:
 
</pre>
 
</pre>
  
 +
<!--T:3-->
 
<syntaxhighlight lang="Haskell" >
 
<syntaxhighlight lang="Haskell" >
 
def quickSort(arr):
 
def quickSort(arr):

Revision as of 10:34, 7 August 2019

Functional Programming

As the expressions above imply, Haskell has a notion of integers and floating point numbers. Integers can be arbitrarily large. Here, ~(^)~ provides integer exponentiation.

ghci> 313 ^ 15
27112218957718876716220410905036741257
def quickSort(arr):
	less = []
	pivotList = []
	more = []
	if len(arr) <= 1:
		return arr
	else:
		pass