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

@typed-f/monad

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typed-f/monad - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

<a name="0.1.0"></a>
# [0.1.0](https://github.com/Ailrun/typed-f/compare/v0.0.1...v0.1.0) (2018-08-14)
### Features
* **tagged:** add [@typed-f](https://github.com/typed-f)/tagged package ([#2](https://github.com/Ailrun/typed-f/issues/2)) ([91b914d](https://github.com/Ailrun/typed-f/commit/91b914d))
<a name="0.0.1"></a>

@@ -8,0 +20,0 @@ ## 0.0.1 (2018-08-11)

4

dist/index.js
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("@typed-f/applicative"));

41

dist/Monad.d.ts

@@ -1,28 +0,25 @@

import { Applicative } from '@typed-f/applicative';
import { Applicative1, Applicative2, Applicative3, Applicative4 } from '@typed-f/applicative';
import { Fun } from '@typed-f/function';
export interface Monad<T> extends Applicative<T> {
import * as T from '@typed-f/tagged';
interface MonadBuilder<BindType> {
bind: BindType;
/**
* @desc
* Retype `Functor` methods
*/
map<U>(f: Fun<[T], U>): Monad<U>;
lift<U>(f: Fun<[T], U>): Monad<U>;
fmap<U>(f: Fun<[T], U>): Monad<U>;
/**
* @desc
* Retype `Functor` methods
*/
unit(arg: T): Monad<T>;
of(arg: T): Monad<T>;
ap<U>(wf: Monad<Fun<[T], U>>): Monad<U>;
/**
* @desc
* `Monad` methods
*/
bind<U>(wf: Fun<[T], Monad<U>>): Monad<U>;
/**
* @desc
* alias of `bind`
*/
chain<U>(wf: Fun<[T], Monad<U>>): Monad<U>;
chain: BindType;
}
declare type MB<B> = MonadBuilder<B>;
declare type M1B<Tag extends keyof T.Tag1List<any>, A0> = <R>(wf: Fun<[A0], T.Tag1List<R>[Tag]>) => T.Tag1List<R>[Tag];
declare type M2B<Tag extends keyof T.Tag2List<any, any>, A0, A1> = <R>(wf: Fun<[A1], T.Tag2List<A0, R>[Tag]>) => T.Tag2List<A0, R>[Tag];
declare type M3B<Tag extends keyof T.Tag3List<any, any, any>, A0, A1, A2> = <R>(wf: Fun<[A2], T.Tag3List<A0, A1, R>[Tag]>) => T.Tag3List<A0, A1, R>[Tag];
declare type M4B<Tag extends keyof T.Tag4List<any, any, any, any>, A0, A1, A2, A3> = <R>(wf: Fun<[A3], T.Tag4List<A0, A1, A2, R>[Tag]>) => T.Tag4List<A0, A1, A2, R>[Tag];
export interface Monad1<Tag extends keyof T.Tag1List<any>, A0> extends Applicative1<Tag, A0>, MB<M1B<Tag, A0>> {
}
export interface Monad2<Tag extends keyof T.Tag2List<any, any>, A0, A1> extends Applicative2<Tag, A0, A1>, MB<M2B<Tag, A0, A1>> {
}
export interface Monad3<Tag extends keyof T.Tag3List<any, any, any>, A0, A1, A2> extends Applicative3<Tag, A0, A1, A2>, MB<M3B<Tag, A0, A1, A2>> {
}
export interface Monad4<Tag extends keyof T.Tag4List<any, any, any, any>, A0, A1, A2, A3> extends Applicative4<Tag, A0, A1, A2, A3>, MB<M4B<Tag, A0, A1, A2, A3>> {
}
export {};
{
"name": "@typed-f/monad",
"version": "0.0.1",
"version": "0.1.0",
"keywords": [

@@ -26,2 +26,3 @@ "Functor",

"scripts": {
"clean": "rimraf dist",
"build": "tsc -p ./tsconfig.json",

@@ -31,6 +32,8 @@ "watch": "tsc -w -p ./tsconfig.json"

"dependencies": {
"@typed-f/applicative": "^0.0.1",
"@typed-f/function": "^0.0.1"
"@typed-f/applicative": "^0.1.0",
"@typed-f/function": "^0.1.0",
"@typed-f/tagged": "^0.1.0"
},
"devDependencies": {
"rimraf": "^2.6.2",
"typescript": "^3.0.1"

@@ -41,3 +44,3 @@ },

},
"gitHead": "90233b12d1b366e9103c7065ad4967adbe61e6be"
"gitHead": "a1925ab6cb01347972f566478cc9c0fc289c2e31"
}

@@ -1,35 +0,23 @@

import { Applicative } from '@typed-f/applicative';
import { Applicative1, Applicative2, Applicative3, Applicative4 } from '@typed-f/applicative';
import { Fun } from '@typed-f/function';
import * as T from '@typed-f/tagged';
export interface Monad<T> extends Applicative<T> {
interface MonadBuilder<BindType> {
bind: BindType;
/**
* @desc
* Retype `Functor` methods
* alias of `bind`
*/
chain: BindType;
}
type MB<B> = MonadBuilder<B>;
map<U>(f: Fun<[T], U>): Monad<U>;
lift<U>(f: Fun<[T], U>): Monad<U>;
fmap<U>(f: Fun<[T], U>): Monad<U>;
type M1B<Tag extends keyof T.Tag1List<any>, A0> = <R>(wf: Fun<[A0], T.Tag1List<R>[Tag]>) => T.Tag1List<R>[Tag];
type M2B<Tag extends keyof T.Tag2List<any, any>, A0, A1> = <R>(wf: Fun<[A1], T.Tag2List<A0, R>[Tag]>) => T.Tag2List<A0, R>[Tag];
type M3B<Tag extends keyof T.Tag3List<any, any, any>, A0, A1, A2> = <R>(wf: Fun<[A2], T.Tag3List<A0, A1, R>[Tag]>) => T.Tag3List<A0, A1, R>[Tag];
type M4B<Tag extends keyof T.Tag4List<any, any, any, any>, A0, A1, A2, A3> = <R>(wf: Fun<[A3], T.Tag4List<A0, A1, A2, R>[Tag]>) => T.Tag4List<A0, A1, A2, R>[Tag];
/**
* @desc
* Retype `Functor` methods
*/
unit(arg: T): Monad<T>;
of(arg: T): Monad<T>;
ap<U>(wf: Monad<Fun<[T], U>>): Monad<U>;
/**
* @desc
* `Monad` methods
*/
bind<U>(wf: Fun<[T], Monad<U>>): Monad<U>;
/**
* @desc
* alias of `bind`
*/
chain<U>(wf: Fun<[T], Monad<U>>): Monad<U>;
}
export interface Monad1<Tag extends keyof T.Tag1List<any>, A0> extends Applicative1<Tag, A0>, MB<M1B<Tag, A0>> {}
export interface Monad2<Tag extends keyof T.Tag2List<any, any>, A0, A1> extends Applicative2<Tag, A0, A1>, MB<M2B<Tag, A0, A1>> {}
export interface Monad3<Tag extends keyof T.Tag3List<any, any, any>, A0, A1, A2> extends Applicative3<Tag, A0, A1, A2>, MB<M3B<Tag, A0, A1, A2>> {}
export interface Monad4<Tag extends keyof T.Tag4List<any, any, any, any>, A0, A1, A2, A3> extends Applicative4<Tag, A0, A1, A2, A3>, MB<M4B<Tag, A0, A1, A2, A3>> {}
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