FP (programming language): Difference between revisions

Content deleted Content added
Danakil (talk | contribs)
Danakil (talk | contribs)
Line 13:
'''f''':'''x''' represents the '''value''' that results from applying the '''function''' '''f''' to the '''value''' '''x'''
 
Functions are either primitive (i.e., provided with the FP environment) or are built from the primitives by '''program-forming operations''' (also called '''functionals'''). OneAn example of one such operation is '''constant''', which transforms a value '''x''' into the constant-valued function '''x̄'''. '''⊥''' is the '''undefined''' value, which all functions map into itself, due to their [[strict function|strict]] nature. where:
 
==Functionals==
'''constant''' '''x̄''' where '''x̄''':'''y''' = '''x'''
These are are the principal functionals of FP:
 
'''constant''' '''x̄''' where '''x̄''':'''y''' = '''x'''
for all values '''y''' (except the '''undefined''' value, '''⊥''', which all functions map into itself, due to their being [[strict function|strict]]). Next there are the remaining principal functionals of FP:
and '''x̄''':'''⊥''' = '''⊥'''
 
'''composition''' '''f'''&#x°'''g''' where '''f'''&#x°'''g''':'''x''' = '''f''':('''g''':'''x''')
Line 30 ⟶ 32:
 
'''insert-right''' /'''f''' where /'''f''':⟨'''x'''⟩ = '''x'''
and /'''f''':&lang;'''x'''<sub>1</sub>,'''x'''<sub>2</sub>,...,'''x'''<sub>n</sub>&rang; = '''f''':&lang;'''x'''<sub>1</sub>,/'''f''':&lang;'''x'''<sub>2</sub>,...,'''x'''<sub>n</sub>&rang;&rang;
 
'''insert-left''' \'''f''' where \'''f''':&lang;'''x'''&rang; = '''x'''
and \'''f''':&lang;'''x'''<sub>1</sub>,'''x'''<sub>2</sub>,...,'''x'''<sub>n</sub>&rang; = '''f''':&lang;\'''f''':&lang;'''x'''<sub>1</sub>,...,'''x'''<sub>n-1</sub>&rang;,'''x'''<sub>n</sub>&rang;
 
[[es:FP (lenguaje de programación)]]