Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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/

From playing around with it, I think the arrows from that library are more useful to practical JavaScript programming than monads.



Since you're familiar with arrowlets, would you mind having a look at samsara?

[samsara]: http://lcfrs.org/samsara/docs/dragndrop.html


That 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.


There 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.


Considering that arrows are a generalization of monads, that shouldn't be a surprise.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: