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? > > David At this point, I think your worry about the result of a scan being one element too long also goes away, doesn't it? David "Raul Miller" <[email protected]> wrote in message news:[email protected]... > On Thu, Apr 7, 2011 at 4:04 PM, David Hotham > <[email protected]> wrote: >> Actually, scan is a bad analogy for /\ in the first place. > > Oops, I should have looked closer before I posted. > > But I believe scanr is like /\. > > Or, more correctly, scanr1 is like /\. > > Other than that issue, I currently believe that my initial comments > here were valid. But if I made any other (perhaps more serious) > mistakes, please let me know? > > -- > Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
