Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 512 Bytes

README.md

File metadata and controls

22 lines (13 loc) · 512 Bytes

Tipos

My journey studying type inference in Haskell.

You can find here an implementation of a very simple type inferer for the following:

  • Lambda abstractions
  • +, -, *, /, ==, >=, <=, > and < operators
  • if and case expressions
  • let expressions

Parser

This: parseExpr "\\x.\\y.x+y"

Will give you this: Right (Lam "x" (Lam "y" (App (App (Var "+") (Var "x")) (Var "y"))))

Type inferer

This: typeOf "\\x.\\y.x+y"

Will give you this: Int->Int->Int