Indeed better mimics and all based on using catalogue (but of course!)
and therefore more to the nature of the Haskell monad. FWIW: if I
translate back my first shot then it's more like:
map (zipWith (+) [10,20,30].map ((-1)^)) .sequence.take 3 $ repeat [1,0]
Thanks
=@@i
Raul Miller schreef:
> Here's another approach:
> >,{<"1(<:,.>:)10 20 30
> >,{<"1([,.>:@[,.<:@[)10 20 30
> or, if you prefer gerunds
> >,{<"1|:<:`>:`:0]10 20 30
> >,{<"1|:[`(>:@[)`(<:@[)`:0]10 20 30
Dan Bron schreef:
> >@,@{@(<:,&.>>:)
>
> >@,@{@(-,&.>+)&1
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm