Difference between revisions of "Functional programming"

From Marek Běhálek Wiki
Jump to navigation Jump to search
Line 8: Line 8:
 
27112218957718876716220410905036741257
 
27112218957718876716220410905036741257
 
#+END_SRC
 
#+END_SRC
 +
 +
<syntaxhighlight lang="Python" style="border:3px dashed blue">
 +
def quickSort(arr):
 +
less = []
 +
pivotList = []
 +
more = []
 +
if len(arr) <= 1:
 +
return arr
 +
else:
 +
pass
 +
</syntaxhighlight>

Revision as of 08:24, 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.

  1. +BEGIN_SRC screen

ghci> 313 ^ 15 27112218957718876716220410905036741257

  1. +END_SRC
def quickSort(arr):
	less = []
	pivotList = []
	more = []
	if len(arr) <= 1:
		return arr
	else:
		pass