Food for thought:

J's / is different from Haskell's foldr in that Haskell's foldr allows
you to specify an "initial element" which is independent of the rest
of the list.

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).

But this design apparently comes with a cost:  The result of scan
(which seems to correspond to J's /\) apparently needs to be one
longer than the argument list.

http://conal.net/blog/posts/composable-parallel-scanning/

Or at least.. that was how I interpreted him, though I am sure that
someone with intimate familiarity with Haskell would instead point at
some underlying rule that leads to both of these consequences (the
design of foldr and the design of scan).  And, from that point of
view, I imagine you could say that these two issues are only
coincidentally related.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to