burrido icon indicating copy to clipboard operation
burrido copied to clipboard

Typescript definitions

Open lukiano opened this issue 7 years ago • 1 comments

Not an issue per se, I was trying to do the same proof of concept as you did, but for TypeScript.

Wondering how could the generators work so well for Promises (async/await in TS transpiles into generators), but not for any object that has map/flatmap methods. So I encountered the need for cloneable generators, and when googled it, found your project!

Have you ever tried to check if this could work with types?

lukiano avatar May 23 '17 07:05 lukiano

Hi Lukiano, since monads require abstracting over type constructors I don't believe this library can be typed in a straightforward way until TypeScript gets support for higher-kinded types; see this issue. However it might be possible to do using this technique. I'd welcome a pull request if you'd like to give it a try!

pelotom avatar May 23 '17 08:05 pelotom