On Thu, Apr 7, 2011 at 4:29 PM, David Hotham <[email protected]> wrote: > Something weird seems to have happened to my posts - I sent one and then a > reply to that one, but only the second got through. > > That being so, you may not have noticed the text in my first mail. So I'll > repeat it here. > >>I think you have a mistaken idea about what a (Haskell) monad is. At the >>start of this thread you wrote: >> >> "This means you can use Haskell's foldr with a function which combines >> arguments of two different types without having to write a Haskell >> Monad (which means: deriving a new function and type to let both of >> the function argument types be consistent with each other)." >> >> This isn't what a Haskell monad is at all. >> >> While I'm not quite sure what your point is, I think it unlikely that >> understanding Haskell monads will be relevant to it - so I won't go any >> further into that. >> >> On your original post, as best I understand it, I think that you may just >> have chosen the wrong Haskell analog for /\. You probably want one of the >> scan variants that treats the first element of the list as the seed. So >> for example: >> >> scanl1 (+) [1,2,3,4] >> [1,3,6,10] >> >> Does this help?
If I have the wrong idea of what a monad is -- I currently believe that it is a single, consistent type for dealing with what would otherwise be incompatible type issues -- then it would help to have a better description of it. A flat out statement that I am wrong with no additional information does not help. (Now, I understand, of course that Haskell's IO Monad is something specific, but I was not suggesting that we needed the IO Monad.) -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
