map-sum ( ... seq quot: ( ... elt -- ... n ) -- ... n )


Vocabulary
sequences

Inputs
seqa sequence
quota quotation


Outputs
na number


Word description
Like map sum, but without creating an intermediate sequence.

Examples
USING: math ranges sequences prettyprint ; 100 [1..b] [ sq ] map-sum .
338350


Definition


: map-sum ( ... seq quot: ( ... elt -- ... n ) -- ... n )
[ 0 ] 2dip [ dip + ] curry [ swap ] prepose each ; inline