@typed-f/monad
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -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) |
"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")); |
@@ -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>> {} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5513
3
2
10
64
1
+ Added@typed-f/tagged@^0.1.0
+ Added@typed-f/applicative@0.1.0(transitive)
+ Added@typed-f/function@0.1.0(transitive)
+ Added@typed-f/functor@0.1.0(transitive)
+ Added@typed-f/tagged@0.1.0(transitive)
- Removed@typed-f/applicative@0.0.1(transitive)
- Removed@typed-f/function@0.0.1(transitive)
- Removed@typed-f/functor@0.0.1(transitive)
Updated@typed-f/applicative@^0.1.0
Updated@typed-f/function@^0.1.0