Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Moving to TypeScript in 3.0 #115
I did say that I'd take a look at TypeScript again a long while ago and I finally did, today. With some of the recent additions to TypeScript, writing things like Folktale in it is not too bad. The compiler services and the new metadata API, though? Those are very compelling (even though they're both experimental). An initial 2.0 release is only really missing the Data.Future docs (which, if work allows, should happen sometime between this week and the next), so on to thinking about the future.
Moving to TypeScript would allow some very interesting features:
OTOH, this would also mean that:
There's also some other stuff to fix:
Docs will probably move back to Sphinx for the time being. But that means having to write plugins to test code automatically, and the Sphinx extension API is painful.
This work would subsume #65, of course.
@boris-marinov I think support for tagged unions was added in 2.1 or something. But that's just on the types side, so it doesn't help much with the runtime part of the things. Depending on how the pattern matching proposal goes on TC39 we might get some interesting stuff though. But that's on the "far future" side of things, sadly.
@raveclassic work on the TS support will start after the final 2.0 version is released, which will hopefully be this weekend.
This might be helpful: https://pattern-matching-with-typescript.alabor.me/
While I was playing with the typings in #157 , the
let stringTask = Task.of("Hello"); let numTask = Task.of(5); waitAll([stringTask, numberTask]);
let stringTask = Task.of("Hello"); let numTask = Task.of(5); // Error here, because array is expected to have tasks return same type //waitAll([stringTask, numberTask]); // wrap waitAll function from folktale let runAll2: <E, V1, V2>(tasks: [Task<E, V1>, Task<E, V2>]) => Task<E, [V1, V2]> = t => waitAll(t); runAll2([stringTask, numberTask]); // The error type is still the same, // but now we can have different values in the tuple (aka array)
$.02 - just something I came across. Relevant line in current WIP typings.