This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TVar of tvar ref | |
| TArrow of ty * ty | |
and tvar = | |
| Unbound of int | |
| Link of ty | |
type exp = | |
| EVar of string | |
| EAbs of string * exp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TVar of int | |
| TArrow of ty * ty | |
type exp = | |
| EVar of string | |
| EAbs of string * exp | |
| EApp of exp * exp | |
let new_tvar = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TVar of int | |
| TArrow of ty * ty | |
type exp = | |
| EVar of string | |
| EAbs of string * exp | |
| EApp of exp * exp | |
type new_tvar = NewTVar of ty * (unit -> new_tvar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TArrow of ty * ty | |
| TBool | |
| TNat | |
| TRecord of (string * ty) list | |
| TVariant of (string * ty) list | |
| TUnit | |
| TRef of ty | |
| TBottom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TArrow of ty * ty | |
| TBool | |
| TNat | |
| TRecord of (string * ty) list | |
| TVariant of (string * ty) list | |
| TUnit | |
| TRef of ty | |
| TBottom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TArrow of ty * ty | |
| TBool | |
| TNat | |
| TRecord of (string * ty) list | |
| TVariant of (string * ty) list | |
| TUnit | |
| TRef of ty | |
type exp = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TArrow of ty * ty | |
| TBool | |
| TNat | |
| TRecord of (string * ty) list | |
| TVariant of (string * ty) list | |
type exp = | |
| EVar of string | |
| EAbs of string * ty * exp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TArrow of ty * ty | |
| TBool | |
| TNat | |
| TRecord of (string * ty) list | |
| TVariant of (string * ty) list | |
type exp = | |
| EVar of string | |
| EAbs of string * ty * exp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TArrow of ty * ty | |
type exp = | |
| EVar of string | |
| EAbs of string * ty * exp | |
| EApp of exp * exp | |
let rec typeof env = function | |
| EVar var -> List.assoc var env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ty = | |
| TArrow of ty * ty | |
| TBool | |
| TNat | |
| TRecord of (string * ty) list | |
type exp = | |
| EVar of string | |
| EAbs of string * ty * exp | |
| EApp of exp * exp |