Paste: map-reduce

Author: tylerg
Mode: factor
Date: Fri, 9 Jan 2009 05:11:59
Plain Text |
! A shorter map reduce
! exploits the so called "map fusion" law
! fold f e . map g = fold (f . g) e

: map-reduce ( seq map-quot reduce-quot -- result )
  [ unclip-slice ] 2dip compose reduce ;

Annotation: oops

Author: tylerg
Mode: factor
Date: Fri, 9 Jan 2009 05:15:04
Plain Text |
inline ! of course!

Annotation: not right

Author: tylerg
Mode: factor
Date: Mon, 12 Jan 2009 07:30:42
Plain Text |
! the above is incorrect because it does not apply the first quotation to the 'zero' element.  Back to the drawing board ...

New Annotation

Summary:
Author:
Mode:
Body: