# Fwd: MapReduce as a Cat one-liner

## Christopher Diggins — 2007-04-03 19:44:40

    I thought members of the Cat discussion group and the concatenative

    mailing list would be interested in the Cat implementation of the

    Google MapReduce algorithm, so I forwarded an email from the Seattle

    Functional Users Group mailing list.

    ---------- Forwarded message ----------

    From: Christopher Diggins <cdiggins@...>

    Date: Apr 3, 2007 12:43 PM

    Subject: MapReduce as a Cat one-liner

    To: SeaFunc@yahoogroups.com

    Frank Krueger ( http://www.praeclarum.org/ ) a fellow member of the

    Seattle functional users group, asked me to come up with a simple

    implementation of the Google MapReduce algorithm in Cat, to compare to

    the C# implementation on his blog. Here is what I came up with:

      define map_reduce { [map flatten self_join] dip map }

    I've explained this algorithm in more depth on the Cat wiki (

    http://code.google.com/p/cat-language/wiki/MapReduce ).

    Of course I should at least tell you that the type is:

     map_reduce : (list ('a -> 'b) ('c -> 'd) -> list)

    Unfortunately the Cat type system isn't yet sophisticated enough to

    express the structure of lists, which would be key to making the type

    more descriptive.

    I'll be attending the East-side SeaFunc meeting early tommorrow (at

    around 7pm) at the Overlake Red Robin (at the corner of 148th and

    24th) if you care to show up earlier than usual.

    Cheers,

    Christopher Diggins

    --

    http://www.cdiggins.com