On Mar 21, 7:55 pm, grocery_stocker <cdal...@gmail.com> wrote: > Given the following.... > > def double(val): > return val.bind(lambda x: val.return_(x*2)) > > I get "AttributeError: 'int' object has no attribute 'bind' " when I > try to do the following > > double(2) > > <snipped>
See the usage of the double function in http://lukeplant.me.uk/blogmedia/monad_explanation.py, which is presumably where you got it from. It's not being passed in an ordinary int. int's do not have bind or return_ attributes. -- kushal -- http://mail.python.org/mailman/listinfo/python-list