Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Type theory
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Function terms==== In addition to atomic terms, most modern type theories also allow for [[Function (mathematics)|functions]]. Function types introduce an arrow symbol, and are [[Recursive definition|defined inductively]]: If <math>\sigma</math> and <math>\tau</math> are types, then the notation <math>\sigma\to\tau</math> is the type of a function which takes a [[parameter]] of type <math>\sigma</math> and returns a term of type <math>\tau</math>. Types of this form are known as [[Simply typed lambda calculus|''simple'' types]].<ref name=":1" /> Some terms may be declared directly as having a simple type, such as the following term, <math>\mathrm{add}</math>, which takes in two natural numbers in sequence and returns one natural number. <math>\mathrm{add}:\mathsf{nat}\to (\mathsf{nat}\to\mathsf{nat})</math> Strictly speaking, a simple type only allows for one input and one output, so a more faithful reading of the above type is that <math>\mathrm{add}</math> is a function which takes in a natural number and returns a function of the form <math>\mathsf{nat}\to\mathsf{nat}</math>. The parentheses clarify that <math>\mathrm{add}</math> does not have the type <math>(\mathsf{nat}\to \mathsf{nat})\to\mathsf{nat}</math>, which would be a function which takes in a function of natural numbers and returns a natural number. The convention is that the arrow is [[Operator associativity|right associative]], so the parentheses may be dropped from <math>\mathrm{add}</math>'s type.<ref name=":1" />
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Type theory
(section)
Add topic