8 Sep
2005
8 Sep
'05
8:35 a.m.
Frederik Eaton wrote:
I want the type system to be able to do "automatic lifting" of monads, i.e., since [] is a monad, I should be able to write the following:
and have it interpreted as "do {a<-[1,2]; b<-[3,4]; return (a+b)}".
Are you sure that this is the interpretation you have in mind? The expression do {a<-[1,2]; b<-[3,4]; return (a+b)} does *not* compute the element-wise sum of the two lists, but returns the list [4,5,5,6]. To me, this would be a very counter intuitive result for an expression [1,2]+[3,4]. Wolfgang