@xieyuheng/milner-lisp.js
v0.1.7
Published
An implementation of Hindley-Milner type system.
Readme
milner-lisp.js
An implementation of Hindley-Milner type system.
Examples
(define (S f g x) ((f x) (g x)))
(define (K x y) x)
(define (I x) x)
(define (C f x y) (f y x))
(define (B f g x) (f (g x)))Inferred:
(claim S (nu (A B C) (-> (-> A B C) (-> A B) A C)))
(claim K (nu (A B) (-> A B A)))
(claim I (nu (A) (-> A A)))
(claim C (nu (A B C) (-> (-> A B C) B A C)))
(claim B (nu (A B C) (-> (-> A B) (-> C A) C B)))Usages
Command line tool
Install it by the following command:
npm install -g @xieyuheng/milner-lisp.jsThe command-line program is called milner-lisp.js.
Development
npm install
npm run build
npm run test