Higher Kinded Types released!
Hi everyone, I am happy to announce that the first version of Higher Kinded Types emulation is released with full `mypy` support as a part of `dry-python/returns@0.15`. I have made a post that describes all its features and (what is even more exciting) all the hacks we have to apply to get this working: https://sobolevn.me/2020/10/higher-kinded-types-in-python Long story short: the biggest problem is that `mypy` treats `Kind` as a regular type and not as a SpecialForm with some extra features. This forces us to use direct inheritance from Kind and do some other hacks inside our mypy plugin. The second problem is that we don't have variadic generics. But, I know that it is in the work right now. If mypy developers are interested, I can slowly work on adding Kind type and all the required machinery into mypy itself (the good news is that even `mypyc` works correctly with Kind). If so, please, guide me about the first steps :) Source code and docs: https://github.com/dry-python/returns Simple example from the article to experiment: https://gist.github.com/sobolevn/7f8ffd885aec70e55dd47928a1fb3e61 Best regards, Nikita Sobolev https://github.com/sobolevn
participants (1)
-
Никита Соболев