node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org »

monoid-max

Monoid Max

Build Status

Fantasy Land Compliant! Indigenous Complaint!

An implementation of the max monoid in javascript

Example

var Max = require("monoid-max");
 
var list = [
    new Max(52),
    new Max(72),
    new Max(42),
    new Max(63),
    new Max(65),
    new Max(93)
];
 
var result = list.reduce(function(a, b) { return a.concat(b); });
 
console.log(result.value());
//prints 93