Questions tagged [monetjs]

Monet is a library designed to bring great power to your JavaScript programming. It is a tool bag that assists Functional Programming by providing a set of Monads and other useful functions.

This library is inspired by those that have come before, especially the FunctionalJava and Scalaz projects.

While functional programming may be alien to you, this library is a simple way to introduce monads and pure functional programming into your daily practices.

Resources:

6 questions
4
votes
3 answers

How to effectively combine multiple Maybe monads in JavaScript?

I have an object of css rules which can have any or none of the following properties: { 'font-style': '…', 'font-variant': '…', 'font-weight': '…', 'text-decoration': '…', 'vertical-align': '…' } The next step is to build up a css string…
customcommander
  • 17,580
  • 5
  • 58
  • 84
4
votes
1 answer

How to use the Free Monad

I have been looking into the Free monad because I have read that a use case for it is to do logging in a side-effect free way. I am attempting to do this in JavaScript with the Monet library. However the documentation is lacking and I do not…
Michael
  • 501
  • 5
  • 12
3
votes
1 answer

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…
Ignat Insarov
  • 4,660
  • 18
  • 37
1
vote
2 answers

Either Monad: How to collect all the Right values and do work with all of them at the end?

So what I am trying to do is collect all the Right values from a series of Either results and have all of them available at the end of the chain to do work on them. I also want the chain to fail fast if one of the Either values is a Left. So after…
Michael
  • 501
  • 5
  • 12
0
votes
1 answer

Filtering Lists of Maybes

If I have a Maybe[], and I'd like to only take those values of the array which are not None, what is the best way to do that, and have typescript understand what it's getting? I'm presuming the way to type that would be to say that I'm going to…
OliverRadini
  • 6,238
  • 1
  • 21
  • 46
-2
votes
1 answer

What represents the letters inside brackets?

I'm using a library called Monet.js, in the documentation has descriptions like this: Maybe[A].map(fn: A => B) : Maybe[B] I dont know what represents the letters inside the brackets. Anyone can help me ?