kongware / scriptum

Functional Programming Unorthodoxly Adjusted to Client-/Server-side Javascript
MIT License
383 stars 21 forks source link

`Eq` type class must take thunk-equality into account #324

Closed ivenmarquardt closed 2 years ago

ivenmarquardt commented 3 years ago

thunks are implemented as proxies in scriptum. The problem is that you cannot intercept ===/== with the proxy type, hence special care have to be taken to accept the following expression:

thunk(() => 2 * 3, "() => Number") === thunk(() => 2 * 3, "() => Number") === true