-
Notifications
You must be signed in to change notification settings - Fork 6
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
"Point" style coding with fp-ts #14
Comments
That's correct. It actually used to support this chainable style but it moved to the |
nice, maybe we add a note and just link the issue for anyone who is interested 👍 |
Is there an equaivent type to the container: // (a -> b) -> Container a -> Container b
Container.prototype.map = function (f) {
return Container.of(f(this.$value));
};
Container.of(2).map(two => two + 2);
// Container(4)
Container.of('flamethrowers').map(s => s.toUpperCase());
// Container('FLAMETHROWERS')
Container.of('bombs').map(append(' away')).map(prop('length'));
// Container(10) I'm guessing not as it only really makes sense if you are chaining/mapping in the point style |
The Not sure if that's more confusing than helpful though |
Starting with CH08, the book often introduces concepts in the "point" style:
AFAIK,
fp-ts
doesn't really provide the ability to use functors in this way (maybe I'm wrong)?It would be good to add a note on this, along side an example translation.
The text was updated successfully, but these errors were encountered: