JSMonk / hegel

An advanced static type checker
https://hegel.js.org
MIT License
2.09k stars 59 forks source link

High order function type inheritance #104

Closed nanot1m closed 4 years ago

nanot1m commented 4 years ago

If we declare two functions:

const id = x => x
const K = a => b => a

And then pass id as the argument to K

const second = K(id)

Type of the function second will be <_c, _a>(_c) => _a, but it should be something like <_c>(_c) => <_b>(_b) => _b

https://jsmonk.github.io/hegel/try#MYewdgzgLgBAlgExgXhgDxQPnQKFJWAM2hRgEMsYAjSsvcEiMJVYqACkQEp6CYwArgFsAXDACMpNu3Fd2AcnHye+RlABOY+QCZ5pJghlydynEA

JSMonk commented 4 years ago

Good issue. We will fix it soon. Thank you for your contribution ^_^

nanot1m commented 4 years ago

It is working now!

JSMonk commented 4 years ago

Seems like it doesn't:C

nanot1m commented 4 years ago

I don't see any issues on https://hegel.js.org/try