Oleg Kobchenko schreef:
> Or tacitly
>
>    foldr=: (~/)(@|.)
>
>    - foldr i.5
> _10
>
You probably mean foldl

Haskell has several forms of fold's. foldr1 is comparable with
J's insert. foldr1 doesn't take a starting value

So in Haskell we have:

Prelude> foldl1 (-) [0..4]
-10
Prelude> foldr1 (-) [0..4]
2

In J

   -/ i.5
2

So your foldr is Haskell's foldl1
The other fold's in Haskell are:

foldl / foldr <function> <starting value> list

f.e.
Prelude> foldr (-) 0 [0..4]
2


FYI


=@@i


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

Reply via email to