monoid-min

An implementation of the min monoid

Usage no npm install needed!

<script type="module">
  import monoidMin from 'https://cdn.skypack.dev/monoid-min';
</script>

README

Monoid Min

Fantasy Land Compliant!

An implementation of the min monoid in javascript

Example

var Min = require("monoid-min");

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

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

console.log(result.value());
//prints 42