-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the inconsistent type of "env" #123
Comments
One of the ideas was to replace all type constructors ( My concern is that currently, type constructors might actually be used by |
Thanks for opening this issue, Aldwin.
So that values such as const a = $.TypeVariable('a');
$.create({checkTypes: true, env: [$.Number]})('id', {}, [a, a], x => x)([1, 2, 3]);
// ! TypeError: Type-variable constraint violation
//
// id :: a -> a
// ^
// 1
//
// 1) [1, 2, 3] ::
//
// Since there is no type of which all the above values are members, the type-variable constraint has been violated. |
But wouldn't adding |
|
Oh, hold on a second! The type constructors are applied to That clears everything up. Sanctuary Def simply doesn't use them. |
Yes. What I'm suggesting is that it should be the caller's responsibility to do something like |
Totally get that now. This change wouldn't even impact the user much, as most of the changes would happen in the internals. It would be a major version for Come to think of it. It would be a patch for |
We would simply remove the |
And then it's just |
Okay. Let's remove |
Sounds good. I suppose we can close #121 then. Haha, my eagerness to get a patch out actually caused me to have to wait longer. |
Oh wait. If you're going to release this as major, we may as well merge #121 so that people will not get 🐛 bitten in the current version. I don't know. |
This seems reasonable. I'm about to put my head down. I'll come back to these issues and pull requests on Saturday. :) |
After collecting my thoughts, this is what I think we should do:
|
without `env`(see sanctuary-js/sanctuary-def#123), but good enough for now.
The text was updated successfully, but these errors were encountered: