@visisoft/staticland
Advanced tools
Comparing version 0.1.16 to 0.1.17
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.16 visisoft.de | ||
(Build date: 3/1/2021 - 1:05:25 PM) | ||
@visisoft/staticland v.0.1.17 visisoft.de | ||
(Build date: 3/9/2021 - 9:44:11 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.16 visisoft.de | ||
(Build date: 3/1/2021 - 1:05:25 PM) | ||
@visisoft/staticland v.0.1.17 visisoft.de | ||
(Build date: 3/9/2021 - 9:44:11 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.16 visisoft.de | ||
(Build date: 3/1/2021 - 1:05:25 PM) | ||
@visisoft/staticland v.0.1.17 visisoft.de | ||
(Build date: 3/9/2021 - 9:44:11 PM) | ||
*/ | ||
@@ -11,2 +11,4 @@ 'use strict'; | ||
var liftA2 = semmelRamda.curry((f, ma, mb) => ap(map(f, ma), mb)); | ||
/** | ||
@@ -65,3 +67,3 @@ * StaticLand: maybe.js | ||
? mx[0] | ||
: isNothing(mx[0]) ? nothing() : mx // this else case makes the implementation different from chain(identity) and supports unnested maybes as join arguments | ||
: isNothing(mx[0]) ? nothing() : mx // this else case makes the implementation different from chain(identity) and supports non-nested maybes as join arguments - why on earth would I want that? | ||
) | ||
@@ -168,2 +170,3 @@ : nothing(), | ||
exports.lift = lift; | ||
exports.liftA2 = liftA2; | ||
exports.map = map; | ||
@@ -170,0 +173,0 @@ exports.maybe = maybe; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.16 visisoft.de | ||
(Build date: 3/1/2021 - 1:05:25 PM) | ||
@visisoft/staticland v.0.1.17 visisoft.de | ||
(Build date: 3/9/2021 - 9:44:11 PM) | ||
*/ | ||
@@ -5,0 +5,0 @@ 'use strict'; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.16 visisoft.de | ||
(Build date: 3/1/2021 - 1:05:25 PM) | ||
@visisoft/staticland v.0.1.17 visisoft.de | ||
(Build date: 3/9/2021 - 9:44:11 PM) | ||
*/ | ||
@@ -287,2 +287,4 @@ 'use strict'; | ||
var liftA2$1 = semmelRamda.curry((f, ma, mb) => ap(map(f, ma), mb)); | ||
/** | ||
@@ -341,3 +343,3 @@ * StaticLand: maybe.js | ||
? mx[0] | ||
: isNothing(mx[0]) ? nothing() : mx // this else case makes the implementation different from chain(identity) and supports unnested maybes as join arguments | ||
: isNothing(mx[0]) ? nothing() : mx // this else case makes the implementation different from chain(identity) and supports non-nested maybes as join arguments - why on earth would I want that? | ||
) | ||
@@ -452,3 +454,4 @@ : nothing(), | ||
typeString: typeString, | ||
just: just | ||
just: just, | ||
liftA2: liftA2$1 | ||
}); | ||
@@ -753,3 +756,3 @@ | ||
var liftA2$1 = semmelRamda.curry((f, ma, mb) => ap$1(map$2(f, ma), mb)); | ||
var liftA2$2 = semmelRamda.curry((f, ma, mb) => ap$1(map$2(f, ma), mb)); | ||
@@ -805,3 +808,3 @@ /*** | ||
ap: ap$1, | ||
liftA2: liftA2$1, | ||
liftA2: liftA2$2, | ||
fetchResponse: fetchResponse | ||
@@ -808,0 +811,0 @@ }); |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.16 visisoft.de | ||
(Build date: 3/1/2021 - 1:05:25 PM) | ||
@visisoft/staticland v.0.1.17 visisoft.de | ||
(Build date: 3/9/2021 - 9:44:11 PM) | ||
*/ | ||
@@ -245,2 +245,4 @@ 'use strict'; | ||
semmelRamda.curry((f, ma, mb) => ap(map$1(f, ma), mb)); | ||
/** | ||
@@ -247,0 +249,0 @@ * StaticLand: maybe.js |
@@ -14,2 +14,3 @@ { | ||
"@rollup/plugin-node-resolve": "^11.0.1", | ||
"@types/ramda": "^0.27.38", | ||
"abort-controller": "^3.0.0", | ||
@@ -85,3 +86,3 @@ "baconjs": "^3.0.17", | ||
"type": "module", | ||
"version": "0.1.16" | ||
"version": "0.1.17" | ||
} |
@@ -0,14 +1,58 @@ | ||
import {BinaryCurriedFn, TernaryCurriedFn} from './common'; | ||
export type Maybe<T> = [T]; | ||
export function just<T>(x: T): Maybe<T>; | ||
export function of<T>(x: T): Maybe<T>; | ||
export function nothing<T>(): Maybe<T>; | ||
export type Just<T> = [T]; | ||
export type Nothing = []; | ||
export type Maybe<T> = Just<T> | Nothing; | ||
/** | ||
* creates a Just of the value | ||
*/ | ||
export function just<T>(x: T): Just<T>; | ||
/** | ||
* alias for just | ||
*/ | ||
export function of<T>(x: T): Just<T>; | ||
/** | ||
* Creates a Nothing | ||
*/ | ||
export function nothing(): Nothing; | ||
/** | ||
* returns `true` if the Maybe is a Just | ||
*/ | ||
export function isJust<T>(mx: Maybe<T>): boolean; | ||
export function isNothing<T>(mx: Maybe<T>): boolean; | ||
export function join<T>(mx: Maybe<Maybe<T>>): Maybe<T>; | ||
export declare function equals<T, S>(ma: Maybe<T>, mb: Maybe<S>): boolean; | ||
export declare function equals<T, S>(ma: Maybe<T>) : (mb: Maybe<S>) => boolean; | ||
export function equals<T, S>(ma: Maybe<T>, mb: Maybe<S>): boolean; | ||
export function equals<T, S>(ma: Maybe<T>) : (mb: Maybe<S>) => boolean; | ||
export function fromNilable<T>(x: (T|undefined|null)): Maybe<T>; | ||
export function fromPredicate<T>(pred: (x: T) => boolean, x: T): Maybe<T>; | ||
export function fromPredicate<T>(pred: (x: T) => boolean): (x: T) => Maybe<T>; | ||
export function fromContentHolding<T extends {length: Number}>(x: T): Maybe<T>; | ||
export declare function getOrElse<T>(acc: T, ma: Maybe<T>) : T; | ||
export declare function getOrElse<T>(acc: T) : (ma: Maybe<T>) => T; | ||
export function getOrElse<T>(acc: T, ma: Maybe<T>) : T; | ||
export function getOrElse<T>(acc: T) : (ma: Maybe<T>) => T; | ||
export function map<T, U>(fn: (x: T) => U, mx: Maybe<T>): Maybe<U>; | ||
export function map<T, U>(fn: (x: T) => U) : (mx: Maybe<T>) => Maybe<U>; | ||
export function chain<T, U>(factory: (x: T) => Maybe<U>, p: Maybe<T>) : Maybe<U>; | ||
export function chain<T, U>(factory: (x: T) => Maybe<U>): (p: Maybe<T>) => Maybe<U>; | ||
export function tap<T>(fn: (x: T) => any, p: Maybe<T>): Maybe<T>; | ||
export function tap<T>(fn: (x: T) => any): (p: Maybe<T>) => Maybe<T>; | ||
export function maybe<S, T, U>(onNothing: () => S, onJust: (x: T) => U, mx: Maybe<T>): S|U; | ||
export function maybe<S, T, U>(onNothing: () => S): (onJust: (x: T) => U, mx: Maybe<T>) => S|U; | ||
export function maybe<S, T, U>(onNothing: () => S, onJust: (x: T) => U): (mx: Maybe<T>) => S|U; | ||
export function maybe<S, T, U>(onNothing: () => S): (onJust: (x: T) => U) => (mx: Maybe<T>) => S|U; | ||
export function liftA2<S, T, U>(fn: BinaryCurriedFn<S, T, U>): (ps: Maybe<S>, pt: Maybe<T>) => Maybe<U>; | ||
export function liftA2<S, T, U>(fn: BinaryCurriedFn<S, T, U>): (ps: Maybe<S>) => (pt: Maybe<T>) => Maybe<U>; | ||
export function liftA3<S, T, U, V>(fn: TernaryCurriedFn<S, T, U, V>): (ps: Maybe<S>, pt: Maybe<T>, pu: Maybe<U>) => Maybe<V>; | ||
export function liftA3<S, T, U, V>(fn: TernaryCurriedFn<S, T, U, V>): (ps: Maybe<S>) => (pt: Maybe<T>) => (pu: Maybe<U>) => Maybe<V>; | ||
export function lift<T>(fn: (...args: any[]) => T): (...mxs: Maybe<any>) => Maybe<T>; | ||
export function typeString(mx: Maybe<any>): string; |
@@ -66,3 +66,3 @@ /** | ||
? mx[0] | ||
: isNothing(mx[0]) ? nothing() : mx // this else case makes the implementation different from chain(identity) and supports unnested maybes as join arguments | ||
: isNothing(mx[0]) ? nothing() : mx // this else case makes the implementation different from chain(identity) and supports non-nested maybes as join arguments - why on earth would I want that? | ||
) | ||
@@ -162,1 +162,2 @@ : nothing(), | ||
export let just = of; | ||
export {default as liftA2} from './maybe/liftA2.js'; |
105610
44
2544
11