Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

monadsjs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monadsjs - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

npm-shrinkwrap.json

2

package.json
{
"name": "monadsjs",
"version": "0.0.2",
"version": "0.0.3",
"description": "Ready to use monads in examples",

@@ -5,0 +5,0 @@ "main": "lib/monads.js",

@@ -35,4 +35,4 @@ # monadsjs

Maybe monad represents a value (`Just`) or monadic zero (`Nothing`). It's very convinient way to just
literally let your code fail. Instead of writing multiple checks and try-catches just check type of
Maybe monad represents a value (`Just`) or monadic zero (`Nothing`). It's very convinient way to
literally, let your code fail. Instead of writing multiple checks and try-catches just check type of
the value at the end of transformations chain. In this particular implementation Maybe is just a

@@ -62,4 +62,4 @@ union type which exists only if you are using TypeScript.

// Nothing.unit :: () -> Nothing
// Nothing.bind :: (a -> Just b | Nothing) -> | Nothing
// Nothing.map :: (a -> b) -> | Nothing
// Nothing.bind :: (a -> Just b | Nothing) -> Nothing
// Nothing.map :: (a -> b) -> Nothing

@@ -116,4 +116,5 @@ const firstWordLength = words => words[0].length;

(here I have Haskell in mind). In JavaScript we can take an advantage of IO monads to change unpure
functions into pure which makes them easy to test. `IO.equals` makes it easy to deep compare two IO
monads.
functions into pure which makes them easy to test. This implementation is also
a [Setoid](https://github.com/hemanth/functional-programming-jargon#setoid). `IO.equals` makes it
easy to deeply compare two IO monads.

@@ -138,3 +139,3 @@ ```js

Promise out of the box is a grate Continuation monad implementation! `Promise.resolve` corresponds
Promise out of the box is a great Continuation monad implementation! `Promise.resolve` corresponds
to `unit` and `Promise.then` corresponds to `bind`. Provided Continuation implementation is a minimal

@@ -141,0 +142,0 @@ wrapper for Promise with methods you know from other monads (`bind` and `unit`). Don't use it, use

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc