On Mar 21, 8:21 am, Kushal Kumaran <kushal.kuma...@gmail.com> wrote: > 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 > inhttp://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. >
Yeah, I did the the code from http://lukeplant.me.uk/blogmedia/monad_explanation.py -- http://mail.python.org/mailman/listinfo/python-list