Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maybe = ->
- fns = []
- monad = (input) -> fns.reduce ((v, fn) -> fn v), input
- Object.assign monad, with: (fn) ->
- fns.push (v) -> if v? then fn v else null
- monad
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement