Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Lambda cube
(section)
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!
=== (位2) System F === In [[System F]] (also named 位2 for the "second-order typed lambda calculus")<ref>{{cite book |last1=Nederpelt |first1=Rob |last2=Geuvers |first2=Herman |title=Type Theory and Formal Proof |date=2014 |publisher=Cambridge University Press |isbn=9781107036505 |page=69 |url=https://www.cambridge.org/vi/academic/subjects/computer-science/programming-languages-and-applied-logic/type-theory-and-formal-proof-introduction?format=HB }}</ref> there is another type of abstraction, written with a <math>\Lambda</math>, that allows ''terms to depend on types'', with the following rule: <math>\frac{\Gamma \;\vdash\; t : \sigma}{\Gamma \;\vdash\; \Lambda \alpha . t : \Pi \alpha . \sigma} \;\text{ if } \alpha\text{ does not occur free in }\Gamma</math> The terms beginning with a <math>\Lambda</math> are called [[Parametric polymorphism|polymorphic]], as they can be applied to different types to get different functions, similarly to polymorphic functions in [[ML (programming language)|ML-like languages]]. For instance, the polymorphic identity <syntaxhighlight lang="ocaml"> fun x -> x </syntaxhighlight>of [[OCaml]] has type <syntaxhighlight lang="ocaml"> 'a -> 'a </syntaxhighlight>meaning it can take an argument of any type <code>'a</code> and return an element of that type. This type corresponds in 位2 to the type <math>\Pi \alpha . \alpha \to \alpha</math>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)