3 ms·
https://rtpg.co/2016/07/20/supercharged-types.html https://rtpg.co/2016/07/20/supercharged-types.html I wrote this example a long time ago, I think nowadays I c
by rtpg 2y ago
https://rtpg.co/2016/07/20/supercharged-types.html https://rtpg.co/2016/07/20/supercharged-types.html I wrote this example a long time ago, I think nowadays I could come up with some more interesting examples though.
As to the differences with TS... I think they're playing in similar spaces but the monadic do syntax with Purescript lets you use row polymorphism for effect tracking without having to play weird API tricks. In TS that's going to be more difficult.
(short version: in purescript I could write an API client that tracks its state in the types so that you can make sure you authorize before calling some mechanism. In TS you would need to design that API around that concept and do things like client = client.authorize(). Purescript you could just do "authorize" in a monadic context and have the "context" update accordingly)