Giter Club home page Giter Club logo

pull-monad's Introduction

pull-monad

Greenkeeper badge

Monadic functions for pull-streams

These are the methods that make something "monadic." These functions and their interactions with each other satisfy the laws laid out in fantasy-land.

Usually these methods exist on the protytpe and are used like so:

const lift2 = (f, a, b) => b.ap(a.map(f))

Because these are simply through's, though, they must be used as such:

const lift2 = (f, a, b) => pull(b, ap(pull(a, map(f))))

example

const pull = require('pull-stream')
const { map, of, ap, chain } = require('pull-monad')

const plus1 = x => x + 1                       // takes a number and returns a number
const times7 = x => x * 7                      // takes a number and returns a number
const triplicate = x => pull.values([x, x, x]) // takes a number and returns a stream

pull(
  lift2(a => b => a + b, of(1), of(2)),
  map(times7),
  chain(triplicate),
  ap(of(plus1)),
  pull.collect((err, arr) => console.log(arr)))

// => [22, 22, 22]

pull-monad's People

Contributors

amsross avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

pull-monad's Issues

An in-range update of nodemon is breaking the build 🚨

The devDependency nodemon was updated from 1.18.5 to 1.18.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

nodemon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.18.6

1.18.6 (2018-11-05)

Bug Fixes

Commits

The new version differs by 1 commits.

  • 521eb1e fix: restart on change for non-default signals (#1409) (#1430)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of semantic-release is breaking the build 🚨

Version 15.5.3 of semantic-release was just published.

Branch Build failing 🚨
Dependency [semantic-release](https://github.com/semantic-release/semantic-release)
Current Version 15.5.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v15.5.3

15.5.3 (2018-06-15)

Bug Fixes

  • package: update p-locate to version 3.0.0 (0ab0426)
Commits

The new version differs by 3 commits.

  • 0ab0426 fix(package): update p-locate to version 3.0.0
  • f9d9144 docs: Add a troubleshooting section about squashed commits
  • 11cef46 chore(package): update sinon to version 6.0.0

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of semantic-release is breaking the build 🚨

Version 15.9.6 of semantic-release was just published.

Branch Build failing 🚨
Dependency semantic-release
Current Version 15.9.5
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes v15.9.6

15.9.6 (2018-08-08)

Bug Fixes

  • do not convert ssh repositoryUrl to https (b895231)
Commits

The new version differs by 3 commits.

  • b895231 fix: do not convert ssh repositoryUrl to https
  • 8b8e40c docs(plugins): add semantic-release-firefox
  • 06695a1 chore(package): update xo to version 0.22.0

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.