Skip to content

Commit cd7cfe2

Browse files
Update type-system.md
1 parent 04f37c1 commit cd7cfe2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

type-system.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## Lambda Calculus
1+
<link rel="stylesheet" type="text/css" href="styles.css">
2+
3+
### Lambda Calculus
24

35
Lambda Calculus just has variables, functions, and function applications.
46
It is a "dynamic" language without static types.
@@ -7,7 +9,7 @@ It is a "dynamic" language without static types.
79
λx. x y z
810
```
911

10-
## Simply Typed Lambda Calculus
12+
### Simply Typed Lambda Calculus
1113

1214
Types can help distinguish terms and their intended purpose.
1315
Each type is a simple name or an arrow.
@@ -17,7 +19,7 @@ Each type is a simple name or an arrow.
1719
f : Integer -> Integer
1820
```
1921

20-
## System F
22+
### System F
2123

2224
System F adds the ability for objects to be parameterized with quantified type variables.
2325
In LM type variables are represented with lowercase identifiers.
@@ -26,7 +28,7 @@ In LM type variables are represented with lowercase identifiers.
2628
some : a -> Option<a>
2729
```
2830

29-
## System F<:
31+
### System F<:
3032

3133
System F<: adds the ability for objects to become subtypes (<:) of a hierarchical type system.
3234

@@ -44,7 +46,7 @@ In plural notation the subtyping relations can often be expanded to clarify a bi
4446
(x : X+Y) <: Y # yes
4547
```
4648

47-
## System F<: with Specialization
49+
### System F<: with Specialization
4850

4951
Specialization adds the ability to pun (overload) functions onto the same identifier.
5052
Then, when applied, punned functions are "narrowed as necessary" to decide which function to apply.
@@ -53,7 +55,7 @@ $$abstraction \quad \frac{\Gamma \vdash a:A \quad \Gamma \vdash b:B \quad \Gamma
5355

5456
$$application \quad \frac{\Gamma \vdash f:(A \to B) + (C \to D) + (X \to Y) \quad \Gamma \vdash x:A + X \quad f(x)}{\Gamma \vdash f(x):B + Y}$$
5557

56-
## Logical Propositions
58+
### Logical Propositions
5759

5860
Nominal Types can be associated with logical properties.
5961
When a Type carries a proposition, in order to soundly fulfill that proposition two things need to be independently proven:
@@ -63,7 +65,7 @@ When a Type carries a proposition, in order to soundly fulfill that proposition
6365
Condition 1 is already working in the type system, however condition 2 will require some significant work.
6466
This feature is a prerequisite for fully certified builds.
6567

66-
## Phi Types
68+
### Phi Types
6769

6870
Many novel type systems can be expressed as Phi Types.
6971
The term "Phi Type" comes from the more widely recognized Phi Functions in Single Static Assignment form.

0 commit comments

Comments
 (0)