mon

monadicjs

javascript monad library with do-notation

Showing:

Popularity

Downloads/wk

0

Maintenance

No Maintenance Data Available

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Build Status

Monad library for JavaScript

Monads can be very useful for async IO. They succefully appeared in Haskell. Haskell provides the do notation for executing monads. And this library ports do to JavaScript. Something that looks like this in Haskell

  do {
    fileContent <- readFile "README.md"
    putStr fileContent
  }

will look like this in JavaScript:

  const fs = require("fs")
  do_(function*() {
    const fileContent = yield fs.readFile.bind(null, "README.md")
    console.log(fileContent)
  })

Checkout tests how to experiment with it.

You will not be able to code every monad that one can programm in Haskell (like the list monad), but a lot is possible with this approach. Here is what you can do in Haskell but not with this library:

  do {
    x <- [1,2,3]
    return (2*x)
  } {- [2,4,6] -}

Available monads

Ideas

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial