Content deleted Content added
added more functionals, corrected typos, reorganized |
|||
Line 7:
if '''x'''<sub>1</sub>,...,'''x'''<sub>n</sub> are '''values''', then the '''sequence''' ⟨'''x'''<sub>1</sub>,...,'''x'''<sub>n</sub>⟩ is also a '''value'''
These values can be built from any set of atoms: booleans, integers, reals, characters, etc. '''⊥''' is the '''undefined''' value, or '''bottom'''. Sequences are ''bottom-preserving'':
⟨'''x'''<sub>1</sub>,...,'''⊥''',...,'''x'''<sub>n</sub>⟩ = '''⊥'''
FP programs are ''functions'' '''f''' that each map a single ''value'' '''x''' into another:
Line 13 ⟶ 15:
'''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'''). An example of one such operation is '''constant''', which transforms a value '''x''' into the constant-valued function '''x̄'''.
==Functionals==
Line 19 ⟶ 22:
'''constant''' '''x̄''' where '''x̄''':'''y''' = '''x'''
▲ and '''x̄''':'''⊥''' = '''⊥'''
'''composition''' '''f'''&#x°'''g''' where '''f'''&#x°'''g''':'''x''' = '''f''':('''g''':'''x''')
|