Permalink
Browse files

$.when is not fully parametric, thus can't be used for monadic return

Thanks @dyokomizo
  • Loading branch information...
1 parent 18187cb commit 2deb8cba02870fc4a976108a3f3bbf1d73bff829 @puffnfresh committed Jul 7, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 examples/deferredmonad.roy
@@ -1,5 +1,8 @@
let deferred = {
- return: $.when
+ return: \x ->
+ let d = $.Deferred ()
+ d.resolve x
+ d.promise ()
bind: \x f -> x.pipe f
}

0 comments on commit 2deb8cb

Please sign in to comment.