Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Written by Prashant Basnet
👋 Welcome to my Signature, a space between logic and curiosity.
I’m a Software Development Engineer who loves turning ideas into systems that work beautifully.
This space captures the process: the bugs, breakthroughs, and “aha” moments that keep me building.
A type environment (T) maps variables names to theirs types. For example:
Lambda Expressions & Types:
Each lambda expression can be typed based on it's structure. The typing rules generally follow:
Function Application Typing:
For an application of the form:
Typing Rules:
here e1 has a type Int -> Int
Since e1 has a type Int -> Int & e2 has type Int, the whole expression (e1 e2) has type Int.
1. What is Γ (Gamma)?
Γ (Gamma), represents a type environment or type context. It is a mapping of variable names to their types.
It keeps tracks of the types of all variables in scope at a given point in your expressions.
What does x:T mean?
Type Derivation Example
We are given:
Expression 1
Expression 2
Expression 3
since t1 is (Int -> Int) is maches expected types of t2
Therefore t3 inherits the result type of t2 when applied to t1, which is Int -> Int