Ignat Insarov
Ignat Insarov

Reputation: 4832

How can I use `monet-pimp` in node?

Reading the package's description, I see there are "extensions" on commonly used classes available in a separate file monet-pimp.js. For example, they suggest I write like this:

var f = function (x, y) { ... } .curry()

But I cannot understand how I am supposed to "activate" this feature. If I require the module:

monet = require("monet")

— I do not think any alteration to built in classes is to be expected. And I do not know if there is a way to require monet-pimp.js directly.

Upvotes: 3

Views: 167

Answers (1)

Archy Will He
Archy Will He

Reputation: 9777

the code is here; it's not exported;

https://github.com/monet/monet.js/blob/develop/src/monet-pimp.js

you can export it and use it like this..

...

export const activateMonadSugar = ()=> (function (root, factory) {
 ...
....


activateMonadSugar()



Upvotes: 0

Related Questions