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, You’ve Landed on My Signature Page.
I’m a Software Development Engineer passionate about building scalable systems and solving problems.
Beyond engineering, I enjoy sharing ideas and documenting lessons so others can learn and build on them.This space is my digital notebook, a place where I reflect on what I’m learning and creating.
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