monoid-average

An implementation of the average monoid

npm install monoid-average
6 downloads in the last week
12 downloads in the last month

Monoid Average

Build Status

Fantasy Land Compliant! Indigenous Complaint!

An implementation of the average monoid in javascript

Example

var Average = require("monoid-average");

var list = [
    new Average(52),
    new Average(72),
    new Average(42),
    new Average(63),
    new Average(65),
    new Average(93)
];

var result = list.reduce(function(a, b) { return a.concat(b); });

console.log(result.value());
//prints 64.5
npm loves you