-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Support Higher Kinded Types #408
Comments
That's exactly the same example I had in |
Blocked by python/mypy#9001 |
Just lurking on this PR which seems really promising 🙌 Has there been any interest from mypy to internalize support for this further on? |
@antonagestam thanks! 👍 When this will be released, I will work with mypy team! I am pretty sure that we can incorporate some parts of our API into the standard API. |
BTW, your https://github.com/antonagestam/phantom-types project looks amazing! |
@sobolevn Thanks! I'm finding it hard to find the time to get it off the ground but I'm currently making some changes to make it much more based around predicate functions which I think will make it a lot more useful and adaptable to different contexts :) Exciting times in the world of typed Python! |
This feature is crutial before
1.0
release.Currently, our interfaces are not universal. Many functions and methods do require to explicitly annotate all containers that they can work with. As a result users cannot create their own containers.
And we struggle to build useful abstractions (like
MonadIO
on top ofIO
andFuture
, see https://github.com/gcanti/fp-ts/blob/master/src/MonadIO.ts). Let's see this example: https://returns.readthedocs.io/en/latest/pages/context.html#requirescontextfutureresult-containerIt can possibly work with both
IO
andFuture
containers. In the first case, it would be sync. But, in the second one it would be async. And the source code won't be changed at all! We would only need to substitute our monad stack.Passing
IOResult
will run this code in sync, whileFutureResult
will run like realasync
code.To make this happen, we need HKT!
I have spent a lot of time working on the initial implementation, but still no luck.
Related:
Native blockers:
semanal
andtypechecker
APIs python/mypy#8848The text was updated successfully, but these errors were encountered: