Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krzemin/typeinf
Simply-typed lambda calculus type inferer
https://github.com/krzemin/typeinf
Last synced: about 2 months ago
JSON representation
Simply-typed lambda calculus type inferer
- Host: GitHub
- URL: https://github.com/krzemin/typeinf
- Owner: krzemin
- Created: 2013-05-28T18:51:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-28T18:10:34.000Z (about 11 years ago)
- Last Synced: 2024-05-02T01:32:28.461Z (8 months ago)
- Language: Haskell
- Size: 262 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
typeinf
=======Simply-typed lambda calculus type inferer
Also available on http://typeinf.herokuapp.com
usage
=====ghci TypeInf/Inferer.hs
*TypeInf.Inferer> let i = "(\\x.x)"
*TypeInf.Inferer> let k = "(\\x y.x)"
*TypeInf.Inferer> let s = "(\\x y z.x z(y z))"
*TypeInf.Inferer> typ i
λx.x : α->α
*TypeInf.Inferer> typ k
λx y.x : α->β->α
*TypeInf.Inferer> typ s
λx y z.x z (y z) : (α->β->γ)->(α->β)->α->γ
*TypeInf.Inferer> let skk = s++k++k
*TypeInf.Inferer> skk
"(\\x y z.x z(y z))(\\x y.x)(\\x y.x)"
*TypeInf.Inferer> typ skk
(λx y z.x z (y z)) (λx y.x) (λx y.x) : α->α
*TypeInf.Inferer> typ (k++i)
(λx y.x) (λx.x) : α->β->β
*TypeInf.Inferer> typ (s++i++i)
term (λx y z.x z (y z)) (λx.x) (λx.x) has no type!
*TypeInf.Inferer> typ "\\x y.y (\\z. z (y x))"
λx y.y (λz.z (y x)) : ((α->β)->β)->(((α->β)->β)->γ)->γ
*TypeInf.Inferer>