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

monads.maybe

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monads.maybe - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

.npmignore

4

lib/index.js

@@ -23,6 +23,2 @@ // Generated by LiveScript 1.2.0

* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* + module: monads.maybe
* + author: Quildreen Motta
* + exports: Maybe
*/

@@ -29,0 +25,0 @@ (function(){

{
"name": "monads.maybe",
"version": "0.2.1",
"version": "0.3.0",
"description": "A monad for values that may not be available or computations that may fail.",

@@ -28,4 +28,4 @@ "main": "lib/index.js",

"devDependencies": {
"browserify": "~2.35.4",
"groc": "git://github.com/killdream/groc#patch-livescript",
"browserify": "git://github.com/robotlolita/node-browserify",
"groc": "git://github.com/robotlolita/groc#typography",
"LiveScript": "~1.2.0",

@@ -32,0 +32,0 @@ "hifive-tap": "~0.1.0",

@@ -39,3 +39,4 @@ Monads: Maybe

// Call a function only if both a and b have values (sequencing)
// Call a function only if both a and b
// have values (sequencing)
a.chain(function(x) {

@@ -48,8 +49,12 @@ return b.chain(function(y) {

// Transform values only if they're available:
a.map(function(x){ return x + 1 }) // Maybe.Nothing
b.map(function(x){ return x + 1 }) // Maybe.Just(1)
a.map(function(x){ return x + 1 })
// => Maybe.Nothing
b.map(function(x){ return x + 1 })
// => Maybe.Just(1)
// Use a default value if no value is present
a.orElse(function(){ return Maybe.Just(-1) }) // Maybe.Just(-1)
b.orElse(function(){ return Maybe.Just(-1) }) // Maybe.Just(0)
a.orElse(function(){ return Maybe.Just(-1) })
// => Maybe.Just(-1)
b.orElse(function(){ return Maybe.Just(-1) })
// => Maybe.Just(0)
```

@@ -61,3 +66,3 @@

The easiest way is to grab it from NPM. If you're running in a Browser
environment, you can use [Browserify][]
environment, you can use [Browserify][]:

@@ -92,3 +97,3 @@ $ npm install monads.maybe

[Download the latest release][release], and load the `monads.maybe.umd.js`
file. The properties are exposed in the global `Maybe` object:
file. The properties are exposed in the global `folktale.monads.Maybe` object:

@@ -109,7 +114,7 @@ ```html

$ make bundle
This will generate the `dist/monads.maybe.umd.js` file, which you can load in
any JavaScript environment.
## Documentation

@@ -142,3 +147,3 @@

[Browserify]: http://browserify.org/
[release]: https://github.com/folktale/monads.maybe/releases/download/v0.2.1/monads.maybe-0.2.1.tar.gz
[release]: https://github.com/folktale/monads.maybe/releases/download/v0.3.0/monads.maybe-0.3.0.tar.gz
[Git]: http://git-scm.com/

@@ -145,0 +150,0 @@ [Make]: http://www.gnu.org/software/make/

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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