monoid-average

1.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i monoid-average

Weekly Downloads

3

Version

1.0.2

License

none

Last publish

Collaborators

  • josephmoniz