3 ms·
If you like this sort of thing, check out the Arrowlets[1] library for JavaScript. It uses "arrows", an abstraction in a similar vein to monads, to make CPS fun
by tikhonj 14y ago
If you like this sort of thing, check out the Arrowlets[1] library for JavaScript. It uses "arrows", an abstraction in a similar vein to monads, to make CPS functions and event handling neater (among other things).
[1]: http://www.cs.umd.edu/projects/PL/arrowlets/ http://www.cs.umd.edu/projects/PL/arrowlets/
From playing around with it, I think the arrows from that library are more useful to practical JavaScript programming than monads.
- Ralith 14y agoConsidering that arrows are a generalization of monads, that shouldn't be a surprise.
- luciferous 14y agoSince you're familiar with arrowlets, would you mind having a look at samsara? [samsara]: http://lcfrs.org/samsara/docs/dragndrop.html http://lcfrs.org/samsara/docs/dragndrop.html
- tikhonj 14y agoThat seems cool--CoffeeScript's syntax is definitely better-suited for this sort of thing than JavaScript's! The main page says the library's in CoffeeScript, but the drag and drop example uses JavaScript. Do you have a similar (or even the same) example in CoffeeScript? I'd like to see what it looks like.
- luciferous 14y agoThere are two parts to example: the plain functions, and the composition. CoffeeScript can make the plain functions look different, but the composition is the strangest looking; I need to find a better syntax for representing a directed graph in code, and CoffeeScript doesn't help with that part.