@cicada-lang/hindley-milner.js
v0.1.2
Published
To practics implementing Hindley-Milner type system.
Readme
hindley-milner.js
To practics implementing 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 @cicada-lang/hindley-milner.jsThe command-line program is called hindley-milner.js.
Development
npm install # Install dependencies
npm run build # Compile `src/` to `lib/`
npm run test # Run testContributions
To make a contribution, fork this project and create a pull request.
Please read the STYLE-GUIDE.md before you change the code.
Remember to add yourself to AUTHORS. Your line belongs to you, you can write a little introduction to yourself but not too long.
