New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fantasy-derivations

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fantasy-derivations

The fantasy-land spec allows for ADTs not to define certain functions when they are derivable from those they must define. This module is for ensuring you can always use a method if it is defined or derivable

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

fantasy-derivations

The fantasy-land spec only requires ADTs to define the minimum set of methods necessary for its type. Others can be derived. Fantasyland gives the code necessary for the derivations, but leaves it up to either the implementer or consumer to put them to use. fantasy-derivations allows you to access methods on various ADTs that can support them without worrying whether they are in fact defined.

Example

var fallback = require('fantasy-derivations')
var monad = require('some-monad-library-with-only-chain-defined')

var my_monad = monad.of(0)

fallback('map', my_monad)(function (n) { return n + 1 })
// monad.of(1)

API

The exported function takes a string (a method name) and an ADT and does its best to return a function for that ADT matching spec.

Keywords

FAQs

Package last updated on 25 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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