@visisoft/staticland
Advanced tools
Comparing version 0.1.36 to 0.1.37
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.36 visisoft.de | ||
(Build date: 1/13/2022 - 4:48:59 PM) | ||
@visisoft/staticland v.0.1.37 visisoft.de | ||
(Build date: 1/17/2022 - 8:06:27 PM) | ||
*/ | ||
@@ -9,3 +9,3 @@ 'use strict'; | ||
var semmelRamda = require('semmel-ramda'); | ||
var ramda = require('ramda'); | ||
var fetch = require('node-fetch'); | ||
@@ -20,3 +20,3 @@ var AbortController = require('abort-controller'); | ||
const // :: Number -> a -> Cancelable * a | ||
laterSucceed = semmelRamda.curry((dt, value) => (resolve, unused) => { | ||
laterSucceed = ramda.curry((dt, value) => (resolve, unused) => { | ||
const timer = setTimeout(resolve, dt, value); | ||
@@ -30,3 +30,3 @@ return () => { clearTimeout(timer); }; | ||
// :: Number -> e -> Cancelable e * | ||
const laterFail = semmelRamda.curry((dt, value) => (unused, reject) => { | ||
const laterFail = ramda.curry((dt, value) => (unused, reject) => { | ||
const timer = setTimeout(reject, dt, value); | ||
@@ -38,3 +38,3 @@ return () => { clearTimeout(timer); }; | ||
const race = semmelRamda.curry((ccA, ccB) => (resolve, reject) => { | ||
const race = ramda.curry((ccA, ccB) => (resolve, reject) => { | ||
let | ||
@@ -71,6 +71,6 @@ cancelB, | ||
var map = semmelRamda.curry((fn, cc) => (resolve, reject) => cc(semmelRamda.o(resolve, fn), reject)); | ||
var map = ramda.curry((fn, cc) => (resolve, reject) => cc(ramda.o(resolve, fn), reject)); | ||
var chain = semmelRamda.curry((fn, cc) => (resolve, reject) => { | ||
let cancel = semmelRamda.identity; | ||
var chain = ramda.curry((fn, cc) => (resolve, reject) => { | ||
let cancel = ramda.identity; | ||
const resolveInner = x => { | ||
@@ -92,3 +92,3 @@ cancel = fn(x)(resolve, reject); | ||
// Sequential execution is derived from chain and map: ap(mf, ma) = chain(f => map(f, ma), mf) | ||
ap = semmelRamda.curry((ccF, ccB) => (res, rej) => { | ||
ap = ramda.curry((ccF, ccB) => (res, rej) => { | ||
let theF, theB, cancelB, hasB; | ||
@@ -138,3 +138,3 @@ const cancelF = ccF( | ||
var liftA2 = semmelRamda.curry((f, ma, mb) => ap(map(f, ma), mb)); | ||
var liftA2 = ramda.curry((f, ma, mb) => ap(map(f, ma), mb)); | ||
@@ -188,3 +188,3 @@ // :: Promise e a -> Cancelable e a | ||
const cancelify = fn => semmelRamda.curryN(fn.length, (...args) => | ||
const cancelify = fn => ramda.curryN(fn.length, (...args) => | ||
(res, rej) => { | ||
@@ -191,0 +191,0 @@ let |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.36 visisoft.de | ||
(Build date: 1/13/2022 - 4:48:59 PM) | ||
@visisoft/staticland v.0.1.37 visisoft.de | ||
(Build date: 1/17/2022 - 8:06:27 PM) | ||
*/ | ||
@@ -9,3 +9,3 @@ 'use strict'; | ||
var semmelRamda = require('semmel-ramda'); | ||
var ramda = require('ramda'); | ||
@@ -31,6 +31,6 @@ /** | ||
// :: (…b -> a) -> …b -> Either c a | ||
fromThrowable = f => semmelRamda.tryCatch(semmelRamda.o(of, f), left), | ||
fromThrowable = f => ramda.tryCatch(ramda.o(of, f), left), | ||
// :: (a -> Boolean) -> (a -> b) -> a -> Either b a | ||
fromAssertedValue = semmelRamda.curry((predicate, createLeftValue, a) => | ||
fromAssertedValue = ramda.curry((predicate, createLeftValue, a) => | ||
predicate(a) ? of (a) : left(createLeftValue(a)) | ||
@@ -45,12 +45,12 @@ ), | ||
isEither = semmelRamda.either(isLeft, isRight), | ||
isEither = ramda.either(isLeft, isRight), | ||
// Transformation // | ||
map = semmelRamda.curry((f, mx) => | ||
semmelRamda.when(isRight, semmelRamda.compose(of, semmelRamda.unary(f), semmelRamda.nth(1)))(mx) | ||
map = ramda.curry((f, mx) => | ||
ramda.when(isRight, ramda.compose(of, ramda.unary(f), ramda.nth(1)))(mx) | ||
), | ||
chain = semmelRamda.curry((f, mx) => | ||
semmelRamda.when(isRight, semmelRamda.o(semmelRamda.unary(f), semmelRamda.nth(1)))(mx) | ||
chain = ramda.curry((f, mx) => | ||
ramda.when(isRight, ramda.o(ramda.unary(f), ramda.nth(1)))(mx) | ||
), | ||
@@ -64,3 +64,3 @@ | ||
// :: (c -> b) -> (a -> b) -> Either c a -> b | ||
either = semmelRamda.curry((leftFn, rightFn, ma) => | ||
either = ramda.curry((leftFn, rightFn, ma) => | ||
isLeft(ma) ? leftFn(ma[0]) : rightFn(ma[1]) | ||
@@ -76,4 +76,4 @@ ), | ||
// :: Either b a -> Either b a -> Either b a | ||
alt = semmelRamda.curry((ma, mb) => | ||
either(semmelRamda.always(mb), of, ma) | ||
alt = ramda.curry((ma, mb) => | ||
either(ramda.always(mb), of, ma) | ||
); | ||
@@ -80,0 +80,0 @@ |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.36 visisoft.de | ||
(Build date: 1/13/2022 - 4:48:59 PM) | ||
@visisoft/staticland v.0.1.37 visisoft.de | ||
(Build date: 1/17/2022 - 8:06:27 PM) | ||
*/ | ||
@@ -9,3 +9,3 @@ 'use strict'; | ||
var semmelRamda = require('semmel-ramda'); | ||
var ramda = require('ramda'); | ||
@@ -19,6 +19,6 @@ /** | ||
const map$1 = semmelRamda.curry((x2y, x) => x2y(x)), | ||
ap = semmelRamda.curry((x2y, x) => x2y(x)), | ||
const map$1 = ramda.curry((x2y, x) => x2y(x)), | ||
ap = ramda.curry((x2y, x) => x2y(x)), | ||
of = x => x; | ||
semmelRamda.curry((xy2z, mx, my) => ap(map$1(xy2z, mx), my)); | ||
ramda.curry((xy2z, mx, my) => ap(map$1(xy2z, mx), my)); | ||
@@ -33,3 +33,3 @@ /** | ||
const | ||
map = semmelRamda.curry((x2y, c) => c); | ||
map = ramda.curry((x2y, c) => c); | ||
@@ -43,4 +43,4 @@ /** | ||
const over = semmelRamda.curry((composableLens, x2x, s) => composableLens(x2x)(s)), | ||
set = semmelRamda.curry((composableLens, x, s) => over(composableLens, _ => x, s)), | ||
const over = ramda.curry((composableLens, x2x, s) => composableLens(x2x)(s)), | ||
set = ramda.curry((composableLens, x, s) => over(composableLens, _ => x, s)), | ||
makeComposable$2 = lens => lens(map$1); | ||
@@ -55,3 +55,3 @@ | ||
const view = semmelRamda.curry((composableLens, s) => over(composableLens, of, s)), | ||
const view = ramda.curry((composableLens, s) => over(composableLens, of, s)), | ||
makeComposable$1 = lens => lens(map); | ||
@@ -67,3 +67,3 @@ | ||
const sequence = view, | ||
makeComposable = semmelRamda.curry((lens, map) => lens(map)); | ||
makeComposable = ramda.curry((lens, map) => lens(map)); | ||
@@ -70,0 +70,0 @@ /** |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.36 visisoft.de | ||
(Build date: 1/13/2022 - 4:48:59 PM) | ||
@visisoft/staticland v.0.1.37 visisoft.de | ||
(Build date: 1/17/2022 - 8:06:27 PM) | ||
*/ | ||
@@ -9,3 +9,3 @@ 'use strict'; | ||
var semmelRamda = require('semmel-ramda'); | ||
var ramda = require('ramda'); | ||
@@ -21,5 +21,5 @@ /** | ||
// :: Applicative f => ((a → f a), ((a → b → c) → f a → f b → f c) → [f a] → f [a] | ||
const sequence$1 = semmelRamda.curry((of_f, liftA2_f, lfa) => | ||
semmelRamda.reduce( | ||
(acc, x) => liftA2_f(semmelRamda.append, x, acc), | ||
const sequence$1 = ramda.curry((of_f, liftA2_f, lfa) => | ||
ramda.reduce( | ||
(acc, x) => liftA2_f(ramda.append, x, acc), | ||
of_f([]), | ||
@@ -30,4 +30,4 @@ lfa | ||
var traverse = semmelRamda.curry((of_f, liftA2_f, effect_to_f, ma) => | ||
sequence$1(of_f, liftA2_f, semmelRamda.map(effect_to_f, ma))); | ||
var traverse = ramda.curry((of_f, liftA2_f, effect_to_f, ma) => | ||
sequence$1(of_f, liftA2_f, ramda.map(effect_to_f, ma))); | ||
@@ -48,7 +48,7 @@ const | ||
// getOrElse :: a -> Maybe a -> a | ||
var getOrElse = semmelRamda.reduce((acc, x) => x); // alt: xs => xs[0] | ||
var getOrElse = ramda.reduce((acc, x) => x); // alt: xs => xs[0] | ||
//map = curry((f, mx) => isJust(mx) ? mx.map(unary(f)) : singleNothing), // alt mx.map(unary(f)) | ||
// map :: (a -> b) -> Maybe a -> Maybe b | ||
var map$1 = semmelRamda.curry((f, mx) => mx.map(semmelRamda.unary(f))); | ||
var map$1 = ramda.curry((f, mx) => mx.map(ramda.unary(f))); | ||
@@ -66,3 +66,3 @@ /** | ||
// maybe :: (() -> b) -> (a -> b) -> Maybe a -> b | ||
var maybe = semmelRamda.curry((nothingFn, justFn, ma) => | ||
var maybe = ramda.curry((nothingFn, justFn, ma) => | ||
isJust(ma) ? getOrElse("THIS_VALUE_SHOWING_ANYWHERE_IS_AN_ERROR", map$1(justFn, ma)) | ||
@@ -83,7 +83,7 @@ : nothingFn() | ||
//chain = curry((f, mx) => mx.flatMap(unary(f))), | ||
var chain = semmelRamda.curry((f, mx) => isJust(mx) ? f(mx[0]) : nothing()); | ||
var chain = ramda.curry((f, mx) => isJust(mx) ? f(mx[0]) : nothing()); | ||
var ap = semmelRamda.curry((mf, mx) => chain(f => map$1(f, mx), mf)); | ||
var ap = ramda.curry((mf, mx) => chain(f => map$1(f, mx), mf)); | ||
semmelRamda.curry((f, ma, mb) => ap(map$1(f, ma), mb)); | ||
ramda.curry((f, ma, mb) => ap(map$1(f, ma), mb)); | ||
@@ -98,5 +98,5 @@ /** | ||
// :: Applicative f => ((a → f a), ((a → b) → f a → f b) → Maybe (f a) → f (Maybe a) | ||
const sequence = semmelRamda.curry((of_f, map_f, mfa) => | ||
const sequence = ramda.curry((of_f, map_f, mfa) => | ||
maybe( // :: (() -> b) -> (a -> b) -> Maybe a -> b | ||
semmelRamda.compose(of_f, nothing), // :: () -> f Nothing | ||
ramda.compose(of_f, nothing), // :: () -> f Nothing | ||
map_f(just), // :: f a -> f Just a | ||
@@ -107,3 +107,3 @@ mfa // :: Maybe f a | ||
semmelRamda.curry((of_f, map_f, effect_to_f, ma) => sequence(of_f, map_f, map$1(effect_to_f, ma))); | ||
ramda.curry((of_f, map_f, effect_to_f, ma) => sequence(of_f, map_f, map$1(effect_to_f, ma))); | ||
@@ -120,9 +120,9 @@ /** | ||
// fromNilable :: (a|undefined|null) -> Maybe a | ||
semmelRamda.ifElse(semmelRamda.isNil, nothing, of); | ||
ramda.ifElse(ramda.isNil, nothing, of); | ||
// fromContentHolding :: a -> Maybe a | ||
semmelRamda.ifElse(semmelRamda.isEmpty, nothing, of); | ||
ramda.ifElse(ramda.isEmpty, nothing, of); | ||
// :: (a -> Boolean) -> a -> Maybe a | ||
semmelRamda.curry((predicate, x) => | ||
ramda.curry((predicate, x) => | ||
predicate(x) ? of(x) : nothing() | ||
@@ -139,5 +139,5 @@ ); | ||
// equals :: Maybe a -> Maybe b -> Boolean | ||
semmelRamda.curry((ma, mb) => | ||
ramda.curry((ma, mb) => | ||
isJust(ma) ? | ||
isJust(mb) && semmelRamda.equals(ma[0], mb[0]) : | ||
isJust(mb) && ramda.equals(ma[0], mb[0]) : | ||
isNothing(mb) | ||
@@ -152,4 +152,4 @@ ); | ||
// tap :: (a -> *) -> Maybe a -> Maybe a | ||
semmelRamda.curry((fn, mx) => { | ||
mx.forEach(semmelRamda.unary(fn)); | ||
ramda.curry((fn, mx) => { | ||
mx.forEach(ramda.unary(fn)); | ||
return mx; | ||
@@ -161,4 +161,4 @@ }); | ||
maybe( | ||
semmelRamda.always('Nothing'), | ||
value => `Just(${semmelRamda.pathOr(typeof value, ['constructor', 'name'], value)})` | ||
ramda.always('Nothing'), | ||
value => `Just(${ramda.pathOr(typeof value, ['constructor', 'name'], value)})` | ||
); | ||
@@ -173,3 +173,3 @@ | ||
const find = semmelRamda.curryN(2, (predicate, list) => { | ||
const find = ramda.curryN(2, (predicate, list) => { | ||
// shameless copy from Ramda | ||
@@ -188,3 +188,3 @@ let idx = 0; | ||
// map :: (a -> b) -> [a] -> [b] | ||
var map = semmelRamda.curry((f, mx) => mx.map(semmelRamda.unary(f))); | ||
var map = ramda.curry((f, mx) => mx.map(ramda.unary(f))); | ||
@@ -191,0 +191,0 @@ exports.find = find; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.36 visisoft.de | ||
(Build date: 1/13/2022 - 4:48:59 PM) | ||
@visisoft/staticland v.0.1.37 visisoft.de | ||
(Build date: 1/17/2022 - 8:06:27 PM) | ||
*/ | ||
@@ -9,3 +9,3 @@ 'use strict'; | ||
var semmelRamda = require('semmel-ramda'); | ||
var ramda = require('ramda'); | ||
@@ -25,7 +25,7 @@ const // isJust :: Maybe a -> Boolean | ||
// getOrElse :: a -> Maybe a -> a | ||
var getOrElse = semmelRamda.reduce((acc, x) => x); // alt: xs => xs[0] | ||
var getOrElse = ramda.reduce((acc, x) => x); // alt: xs => xs[0] | ||
//map = curry((f, mx) => isJust(mx) ? mx.map(unary(f)) : singleNothing), // alt mx.map(unary(f)) | ||
// map :: (a -> b) -> Maybe a -> Maybe b | ||
var map = semmelRamda.curry((f, mx) => mx.map(semmelRamda.unary(f))); | ||
var map = ramda.curry((f, mx) => mx.map(ramda.unary(f))); | ||
@@ -43,3 +43,3 @@ /** | ||
// maybe :: (() -> b) -> (a -> b) -> Maybe a -> b | ||
var maybe = semmelRamda.curry((nothingFn, justFn, ma) => | ||
var maybe = ramda.curry((nothingFn, justFn, ma) => | ||
isJust(ma) ? getOrElse("THIS_VALUE_SHOWING_ANYWHERE_IS_AN_ERROR", map(justFn, ma)) | ||
@@ -59,7 +59,7 @@ : nothingFn() | ||
//chain = curry((f, mx) => mx.flatMap(unary(f))), | ||
var chain = semmelRamda.curry((f, mx) => isJust(mx) ? f(mx[0]) : nothing()); | ||
var chain = ramda.curry((f, mx) => isJust(mx) ? f(mx[0]) : nothing()); | ||
var ap = semmelRamda.curry((mf, mx) => chain(f => map(f, mx), mf)); | ||
var ap = ramda.curry((mf, mx) => chain(f => map(f, mx), mf)); | ||
var liftA2 = semmelRamda.curry((f, ma, mb) => ap(map(f, ma), mb)); | ||
var liftA2 = ramda.curry((f, ma, mb) => ap(map(f, ma), mb)); | ||
@@ -74,5 +74,5 @@ /** | ||
// :: Applicative f => ((a → f a), ((a → b) → f a → f b) → Maybe (f a) → f (Maybe a) | ||
const sequence = semmelRamda.curry((of_f, map_f, mfa) => | ||
const sequence = ramda.curry((of_f, map_f, mfa) => | ||
maybe( // :: (() -> b) -> (a -> b) -> Maybe a -> b | ||
semmelRamda.compose(of_f, nothing), // :: () -> f Nothing | ||
ramda.compose(of_f, nothing), // :: () -> f Nothing | ||
map_f(just), // :: f a -> f Just a | ||
@@ -83,3 +83,3 @@ mfa // :: Maybe f a | ||
var traverse = semmelRamda.curry((of_f, map_f, effect_to_f, ma) => sequence(of_f, map_f, map(effect_to_f, ma))); | ||
var traverse = ramda.curry((of_f, map_f, effect_to_f, ma) => sequence(of_f, map_f, map(effect_to_f, ma))); | ||
@@ -96,9 +96,9 @@ /** | ||
// fromNilable :: (a|undefined|null) -> Maybe a | ||
fromNilable = semmelRamda.ifElse(semmelRamda.isNil, nothing, of), | ||
fromNilable = ramda.ifElse(ramda.isNil, nothing, of), | ||
// fromContentHolding :: a -> Maybe a | ||
fromContentHolding = semmelRamda.ifElse(semmelRamda.isEmpty, nothing, of), | ||
fromContentHolding = ramda.ifElse(ramda.isEmpty, nothing, of), | ||
// :: (a -> Boolean) -> a -> Maybe a | ||
fromPredicate = semmelRamda.curry((predicate, x) => | ||
fromPredicate = ramda.curry((predicate, x) => | ||
predicate(x) ? of(x) : nothing() | ||
@@ -115,5 +115,5 @@ ), | ||
// equals :: Maybe a -> Maybe b -> Boolean | ||
equals = semmelRamda.curry((ma, mb) => | ||
equals = ramda.curry((ma, mb) => | ||
isJust(ma) ? | ||
isJust(mb) && semmelRamda.equals(ma[0], mb[0]) : | ||
isJust(mb) && ramda.equals(ma[0], mb[0]) : | ||
isNothing(mb) | ||
@@ -135,3 +135,3 @@ ), | ||
reduce = semmelRamda.reduce,//curry((f, initial, mx) => mx.reduce(f, initial)), | ||
reduce = ramda.reduce,//curry((f, initial, mx) => mx.reduce(f, initial)), | ||
@@ -144,4 +144,4 @@ // Side effects // | ||
// tap :: (a -> *) -> Maybe a -> Maybe a | ||
tap = semmelRamda.curry((fn, mx) => { | ||
mx.forEach(semmelRamda.unary(fn)); | ||
tap = ramda.curry((fn, mx) => { | ||
mx.forEach(ramda.unary(fn)); | ||
return mx; | ||
@@ -161,11 +161,11 @@ }), | ||
lift = fn => | ||
semmelRamda.nAry( | ||
ramda.nAry( | ||
fn.length, | ||
semmelRamda.unapply(semmelRamda.ifElse( | ||
semmelRamda.any(isNothing), | ||
ramda.unapply(ramda.ifElse( | ||
ramda.any(isNothing), | ||
nothing, | ||
/* alternative implementations may differ in performance */ | ||
//compose(of, apply(fn), mapR(nth(0))) // here the same as the line below | ||
semmelRamda.apply(semmelRamda.lift(fn)) // here the same as the line above | ||
ramda.apply(ramda.lift(fn)) // here the same as the line above | ||
)) | ||
@@ -177,4 +177,4 @@ ), | ||
typeString = maybe( | ||
semmelRamda.always('Nothing'), | ||
value => `Just(${semmelRamda.pathOr(typeof value, ['constructor', 'name'], value)})` | ||
ramda.always('Nothing'), | ||
value => `Just(${ramda.pathOr(typeof value, ['constructor', 'name'], value)})` | ||
); | ||
@@ -181,0 +181,0 @@ |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.36 visisoft.de | ||
(Build date: 1/13/2022 - 4:48:59 PM) | ||
@visisoft/staticland v.0.1.37 visisoft.de | ||
(Build date: 1/17/2022 - 8:06:27 PM) | ||
*/ | ||
@@ -9,6 +9,6 @@ 'use strict'; | ||
var semmelRamda = require('semmel-ramda'); | ||
var ramda = require('ramda'); | ||
// map :: (a -> b) -> Promise e a -> Promise e b | ||
var map = semmelRamda.curry((fn, aPromise) => aPromise.then(fn)); | ||
var map = ramda.curry((fn, aPromise) => aPromise.then(fn)); | ||
@@ -24,3 +24,3 @@ /** | ||
// tap :: (a -> *) -> Promise a -> Promise a | ||
tap = semmelRamda.curry((fn, p) => | ||
tap = ramda.curry((fn, p) => | ||
p.then(x => { | ||
@@ -31,3 +31,3 @@ fn(x); | ||
bi_tap = semmelRamda.curry((onFailure, onSuccess, p) => | ||
bi_tap = ramda.curry((onFailure, onSuccess, p) => | ||
p.then( | ||
@@ -60,3 +60,3 @@ x => { | ||
// tapRegardless :: (a -> *) -> Promise a -> Promise a | ||
tapRegardless = semmelRamda.curry((fn, p) => { | ||
tapRegardless = ramda.curry((fn, p) => { | ||
p.then(fn).catch(x => x); | ||
@@ -85,3 +85,3 @@ | ||
// ap :: Promise (a -> b) -> Promise a -> Promise b | ||
ap_p = semmelRamda.curry((fnPromise, aPromise) => | ||
ap_p = ramda.curry((fnPromise, aPromise) => | ||
Promise.all([ | ||
@@ -102,7 +102,7 @@ fnPromise, | ||
const // later :: Number -> t -> Promise e t | ||
later = semmelRamda.curry((dt, value) => new Promise(resolve => | ||
later = ramda.curry((dt, value) => new Promise(resolve => | ||
setTimeout(resolve, dt, value) | ||
)); | ||
var liftA2 = semmelRamda.curry((f, ma, mb) => ap_p(map(f, ma), mb)); | ||
var liftA2 = ramda.curry((f, ma, mb) => ap_p(map(f, ma), mb)); | ||
@@ -147,3 +147,3 @@ /** | ||
// mapRej :: (e -> c) -> Promise e b -> Promise c b | ||
mapRej = semmelRamda.curry((fn, aPromise) => aPromise.catch(semmelRamda.o(reject, fn))); | ||
mapRej = ramda.curry((fn, aPromise) => aPromise.catch(ramda.o(reject, fn))); | ||
@@ -153,6 +153,6 @@ /** | ||
*/ | ||
semmelRamda.curry((fn, aPromise) => aPromise.then(null, fn)); | ||
ramda.curry((fn, aPromise) => aPromise.then(null, fn)); | ||
const // this implementation enforces fn to return a promise | ||
// chainRej :: (e -> Promise g b) -> Promise e a -> Promise (e | g) (a | b) | ||
chainRej = semmelRamda.curry((fn, aPromise) => | ||
chainRej = ramda.curry((fn, aPromise) => | ||
new Promise((resolve, reject_) => { | ||
@@ -164,8 +164,8 @@ aPromise.then(resolve, a => fn(a).then(resolve, reject_)); | ||
// bimap :: Bifunctor m => (a -> c) -> (b -> d) -> m a b -> m c d | ||
bimap = semmelRamda.curry((failureMap, successMap, aPromise) => | ||
aPromise.then(successMap, semmelRamda.o(reject, failureMap))), | ||
bimap = ramda.curry((failureMap, successMap, aPromise) => | ||
aPromise.then(successMap, ramda.o(reject, failureMap))), | ||
// this implementation enforces fn to return a promise | ||
// chain :: (a -> Promise e b) -> Promise g a -> Promise (e|g) b | ||
chain = semmelRamda.curry((fn, aPromise) => | ||
chain = ramda.curry((fn, aPromise) => | ||
new Promise((resolve, reject_) => { | ||
@@ -180,3 +180,3 @@ aPromise | ||
// chainIf :: (a -> Boolean) -> (a -> Promise a) -> Promise a -> Promise a | ||
chainIf = semmelRamda.curry((predicate, fn, aPromise) => | ||
chainIf = ramda.curry((predicate, fn, aPromise) => | ||
new Promise((resolve, reject_) => { | ||
@@ -190,3 +190,3 @@ aPromise | ||
// coalesce :: (e -> b) -> (a -> b) -> Promise e a -> Promise e b | ||
coalesce = semmelRamda.curry((left, right, p) => | ||
coalesce = ramda.curry((left, right, p) => | ||
p.then(right, left) | ||
@@ -204,3 +204,3 @@ ), | ||
// chainTap :: (a -> Promise g *) -> Promise e a -> Promise (e|g) a | ||
chainTap = semmelRamda.curry((fn, p) => | ||
chainTap = ramda.curry((fn, p) => | ||
new Promise((resolve, reject_) => { | ||
@@ -284,3 +284,3 @@ p | ||
duplexRace = semmelRamda.curry((pa, pb) => Promise.race([pa, pb])), | ||
duplexRace = ramda.curry((pa, pb) => Promise.race([pa, pb])), | ||
@@ -293,3 +293,3 @@ /** | ||
// :: Promise e a -> Promise e a -> Promise e a | ||
alt = semmelRamda.curry((pa, pb) => new Promise((resolve_, reject_) => { | ||
alt = ramda.curry((pa, pb) => new Promise((resolve_, reject_) => { | ||
const | ||
@@ -306,3 +306,3 @@ rejectGenerator = function* () { | ||
let join = semmelRamda.identity; | ||
let join = ramda.identity; | ||
/** @deprecated */ | ||
@@ -309,0 +309,0 @@ let unit = empty; |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.36 visisoft.de | ||
(Build date: 1/13/2022 - 4:48:59 PM) | ||
@visisoft/staticland v.0.1.37 visisoft.de | ||
(Build date: 1/17/2022 - 8:06:27 PM) | ||
*/ | ||
@@ -9,3 +9,3 @@ 'use strict'; | ||
var semmelRamda = require('semmel-ramda'); | ||
var ramda = require('ramda'); | ||
var Bacon = require('baconjs'); | ||
@@ -34,3 +34,3 @@ | ||
// map :: (a -> b) -> Promise e a -> Promise e b | ||
var map_p = semmelRamda.curry((fn, aPromise) => aPromise.then(fn)); | ||
var map_p = ramda.curry((fn, aPromise) => aPromise.then(fn)); | ||
@@ -47,3 +47,3 @@ /** | ||
// tap :: (a -> *) -> Promise a -> Promise a | ||
tap$1 = semmelRamda.curry((fn, p) => | ||
tap$1 = ramda.curry((fn, p) => | ||
p.then(x => { | ||
@@ -54,3 +54,3 @@ fn(x); | ||
bi_tap = semmelRamda.curry((onFailure, onSuccess, p) => | ||
bi_tap = ramda.curry((onFailure, onSuccess, p) => | ||
p.then( | ||
@@ -83,3 +83,3 @@ x => { | ||
// tapRegardless :: (a -> *) -> Promise a -> Promise a | ||
tapRegardless = semmelRamda.curry((fn, p) => { | ||
tapRegardless = ramda.curry((fn, p) => { | ||
p.then(fn).catch(x => x); | ||
@@ -109,3 +109,3 @@ | ||
// ap :: Promise (a -> b) -> Promise a -> Promise b | ||
ap_p = semmelRamda.curry((fnPromise, aPromise) => | ||
ap_p = ramda.curry((fnPromise, aPromise) => | ||
Promise.all([ | ||
@@ -127,7 +127,7 @@ fnPromise, | ||
// later :: Number -> t -> Promise e t | ||
later = semmelRamda.curry((dt, value) => new Promise(resolve => | ||
later = ramda.curry((dt, value) => new Promise(resolve => | ||
setTimeout(resolve, dt, value) | ||
)); | ||
var liftA2$2 = semmelRamda.curry((f, ma, mb) => ap_p(map_p(f, ma), mb)); | ||
var liftA2$2 = ramda.curry((f, ma, mb) => ap_p(map_p(f, ma), mb)); | ||
@@ -172,3 +172,3 @@ /** | ||
// mapRej :: (e -> c) -> Promise e b -> Promise c b | ||
mapRej = semmelRamda.curry((fn, aPromise) => aPromise.catch(semmelRamda.o(reject$1, fn))); | ||
mapRej = ramda.curry((fn, aPromise) => aPromise.catch(ramda.o(reject$1, fn))); | ||
@@ -178,6 +178,6 @@ /** | ||
*/ | ||
semmelRamda.curry((fn, aPromise) => aPromise.then(null, fn)); | ||
ramda.curry((fn, aPromise) => aPromise.then(null, fn)); | ||
const // this implementation enforces fn to return a promise | ||
// chainRej :: (e -> Promise g b) -> Promise e a -> Promise (e | g) (a | b) | ||
chainRej = semmelRamda.curry((fn, aPromise) => | ||
chainRej = ramda.curry((fn, aPromise) => | ||
new Promise((resolve, reject_) => { | ||
@@ -189,8 +189,8 @@ aPromise.then(resolve, a => fn(a).then(resolve, reject_)); | ||
// bimap :: Bifunctor m => (a -> c) -> (b -> d) -> m a b -> m c d | ||
bimap = semmelRamda.curry((failureMap, successMap, aPromise) => | ||
aPromise.then(successMap, semmelRamda.o(reject$1, failureMap))), | ||
bimap = ramda.curry((failureMap, successMap, aPromise) => | ||
aPromise.then(successMap, ramda.o(reject$1, failureMap))), | ||
// this implementation enforces fn to return a promise | ||
// chain :: (a -> Promise e b) -> Promise g a -> Promise (e|g) b | ||
chain$3 = semmelRamda.curry((fn, aPromise) => | ||
chain$3 = ramda.curry((fn, aPromise) => | ||
new Promise((resolve, reject_) => { | ||
@@ -205,3 +205,3 @@ aPromise | ||
// chainIf :: (a -> Boolean) -> (a -> Promise a) -> Promise a -> Promise a | ||
chainIf = semmelRamda.curry((predicate, fn, aPromise) => | ||
chainIf = ramda.curry((predicate, fn, aPromise) => | ||
new Promise((resolve, reject_) => { | ||
@@ -215,3 +215,3 @@ aPromise | ||
// coalesce :: (e -> b) -> (a -> b) -> Promise e a -> Promise e b | ||
coalesce = semmelRamda.curry((left, right, p) => | ||
coalesce = ramda.curry((left, right, p) => | ||
p.then(right, left) | ||
@@ -229,3 +229,3 @@ ), | ||
// chainTap :: (a -> Promise g *) -> Promise e a -> Promise (e|g) a | ||
chainTap = semmelRamda.curry((fn, p) => | ||
chainTap = ramda.curry((fn, p) => | ||
new Promise((resolve, reject_) => { | ||
@@ -309,3 +309,3 @@ p | ||
duplexRace = semmelRamda.curry((pa, pb) => Promise.race([pa, pb])), | ||
duplexRace = ramda.curry((pa, pb) => Promise.race([pa, pb])), | ||
@@ -318,3 +318,3 @@ /** | ||
// :: Promise e a -> Promise e a -> Promise e a | ||
alt$1 = semmelRamda.curry((pa, pb) => new Promise((resolve_, reject_) => { | ||
alt$1 = ramda.curry((pa, pb) => new Promise((resolve_, reject_) => { | ||
const | ||
@@ -331,3 +331,3 @@ rejectGenerator = function* () { | ||
let join$2 = semmelRamda.identity; | ||
let join$2 = ramda.identity; | ||
/** @deprecated */ | ||
@@ -379,7 +379,7 @@ let unit = empty; | ||
// getOrElse :: a -> Maybe a -> a | ||
var getOrElse = semmelRamda.reduce((acc, x) => x); // alt: xs => xs[0] | ||
var getOrElse = ramda.reduce((acc, x) => x); // alt: xs => xs[0] | ||
//map = curry((f, mx) => isJust(mx) ? mx.map(unary(f)) : singleNothing), // alt mx.map(unary(f)) | ||
// map :: (a -> b) -> Maybe a -> Maybe b | ||
var map$3 = semmelRamda.curry((f, mx) => mx.map(semmelRamda.unary(f))); | ||
var map$3 = ramda.curry((f, mx) => mx.map(ramda.unary(f))); | ||
@@ -397,3 +397,3 @@ /** | ||
// maybe :: (() -> b) -> (a -> b) -> Maybe a -> b | ||
var maybe$1 = semmelRamda.curry((nothingFn, justFn, ma) => | ||
var maybe$1 = ramda.curry((nothingFn, justFn, ma) => | ||
isJust(ma) ? getOrElse("THIS_VALUE_SHOWING_ANYWHERE_IS_AN_ERROR", map$3(justFn, ma)) | ||
@@ -414,7 +414,7 @@ : nothingFn() | ||
//chain = curry((f, mx) => mx.flatMap(unary(f))), | ||
var chain$2 = semmelRamda.curry((f, mx) => isJust(mx) ? f(mx[0]) : nothing()); | ||
var chain$2 = ramda.curry((f, mx) => isJust(mx) ? f(mx[0]) : nothing()); | ||
var ap$1 = semmelRamda.curry((mf, mx) => chain$2(f => map$3(f, mx), mf)); | ||
var ap$1 = ramda.curry((mf, mx) => chain$2(f => map$3(f, mx), mf)); | ||
var liftA2$1 = semmelRamda.curry((f, ma, mb) => ap$1(map$3(f, ma), mb)); | ||
var liftA2$1 = ramda.curry((f, ma, mb) => ap$1(map$3(f, ma), mb)); | ||
@@ -429,5 +429,5 @@ /** | ||
// :: Applicative f => ((a → f a), ((a → b) → f a → f b) → Maybe (f a) → f (Maybe a) | ||
const sequence$1 = semmelRamda.curry((of_f, map_f, mfa) => | ||
const sequence$1 = ramda.curry((of_f, map_f, mfa) => | ||
maybe$1( // :: (() -> b) -> (a -> b) -> Maybe a -> b | ||
semmelRamda.compose(of_f, nothing), // :: () -> f Nothing | ||
ramda.compose(of_f, nothing), // :: () -> f Nothing | ||
map_f(just), // :: f a -> f Just a | ||
@@ -438,3 +438,3 @@ mfa // :: Maybe f a | ||
var traverse$1 = semmelRamda.curry((of_f, map_f, effect_to_f, ma) => sequence$1(of_f, map_f, map$3(effect_to_f, ma))); | ||
var traverse$1 = ramda.curry((of_f, map_f, effect_to_f, ma) => sequence$1(of_f, map_f, map$3(effect_to_f, ma))); | ||
@@ -451,9 +451,9 @@ /** | ||
// fromNilable :: (a|undefined|null) -> Maybe a | ||
fromNilable = semmelRamda.ifElse(semmelRamda.isNil, nothing, of$2), | ||
fromNilable = ramda.ifElse(ramda.isNil, nothing, of$2), | ||
// fromContentHolding :: a -> Maybe a | ||
fromContentHolding = semmelRamda.ifElse(semmelRamda.isEmpty, nothing, of$2), | ||
fromContentHolding = ramda.ifElse(ramda.isEmpty, nothing, of$2), | ||
// :: (a -> Boolean) -> a -> Maybe a | ||
fromPredicate = semmelRamda.curry((predicate, x) => | ||
fromPredicate = ramda.curry((predicate, x) => | ||
predicate(x) ? of$2(x) : nothing() | ||
@@ -470,5 +470,5 @@ ), | ||
// equals :: Maybe a -> Maybe b -> Boolean | ||
equals = semmelRamda.curry((ma, mb) => | ||
equals = ramda.curry((ma, mb) => | ||
isJust(ma) ? | ||
isJust(mb) && semmelRamda.equals(ma[0], mb[0]) : | ||
isJust(mb) && ramda.equals(ma[0], mb[0]) : | ||
isNothing(mb) | ||
@@ -490,3 +490,3 @@ ), | ||
reduce = semmelRamda.reduce,//curry((f, initial, mx) => mx.reduce(f, initial)), | ||
reduce = ramda.reduce,//curry((f, initial, mx) => mx.reduce(f, initial)), | ||
@@ -499,4 +499,4 @@ // Side effects // | ||
// tap :: (a -> *) -> Maybe a -> Maybe a | ||
tap = semmelRamda.curry((fn, mx) => { | ||
mx.forEach(semmelRamda.unary(fn)); | ||
tap = ramda.curry((fn, mx) => { | ||
mx.forEach(ramda.unary(fn)); | ||
return mx; | ||
@@ -516,11 +516,11 @@ }), | ||
lift = fn => | ||
semmelRamda.nAry( | ||
ramda.nAry( | ||
fn.length, | ||
semmelRamda.unapply(semmelRamda.ifElse( | ||
semmelRamda.any(isNothing), | ||
ramda.unapply(ramda.ifElse( | ||
ramda.any(isNothing), | ||
nothing, | ||
/* alternative implementations may differ in performance */ | ||
//compose(of, apply(fn), mapR(nth(0))) // here the same as the line below | ||
semmelRamda.apply(semmelRamda.lift(fn)) // here the same as the line above | ||
ramda.apply(ramda.lift(fn)) // here the same as the line above | ||
)) | ||
@@ -532,4 +532,4 @@ ), | ||
typeString = maybe$1( | ||
semmelRamda.always('Nothing'), | ||
value => `Just(${semmelRamda.pathOr(typeof value, ['constructor', 'name'], value)})` | ||
ramda.always('Nothing'), | ||
value => `Just(${ramda.pathOr(typeof value, ['constructor', 'name'], value)})` | ||
); | ||
@@ -583,6 +583,6 @@ | ||
// :: (…b -> a) -> …b -> Either c a | ||
fromThrowable = f => semmelRamda.tryCatch(semmelRamda.o(of$1, f), left), | ||
fromThrowable = f => ramda.tryCatch(ramda.o(of$1, f), left), | ||
// :: (a -> Boolean) -> (a -> b) -> a -> Either b a | ||
fromAssertedValue = semmelRamda.curry((predicate, createLeftValue, a) => | ||
fromAssertedValue = ramda.curry((predicate, createLeftValue, a) => | ||
predicate(a) ? of$1 (a) : left(createLeftValue(a)) | ||
@@ -597,12 +597,12 @@ ), | ||
isEither = semmelRamda.either(isLeft, isRight), | ||
isEither = ramda.either(isLeft, isRight), | ||
// Transformation // | ||
map$2 = semmelRamda.curry((f, mx) => | ||
semmelRamda.when(isRight, semmelRamda.compose(of$1, semmelRamda.unary(f), semmelRamda.nth(1)))(mx) | ||
map$2 = ramda.curry((f, mx) => | ||
ramda.when(isRight, ramda.compose(of$1, ramda.unary(f), ramda.nth(1)))(mx) | ||
), | ||
chain$1 = semmelRamda.curry((f, mx) => | ||
semmelRamda.when(isRight, semmelRamda.o(semmelRamda.unary(f), semmelRamda.nth(1)))(mx) | ||
chain$1 = ramda.curry((f, mx) => | ||
ramda.when(isRight, ramda.o(ramda.unary(f), ramda.nth(1)))(mx) | ||
), | ||
@@ -616,3 +616,3 @@ | ||
// :: (c -> b) -> (a -> b) -> Either c a -> b | ||
either = semmelRamda.curry((leftFn, rightFn, ma) => | ||
either = ramda.curry((leftFn, rightFn, ma) => | ||
isLeft(ma) ? leftFn(ma[0]) : rightFn(ma[1]) | ||
@@ -628,4 +628,4 @@ ), | ||
// :: Either b a -> Either b a -> Either b a | ||
alt = semmelRamda.curry((ma, mb) => | ||
either(semmelRamda.always(mb), of$1, ma) | ||
alt = ramda.curry((ma, mb) => | ||
either(ramda.always(mb), of$1, ma) | ||
); | ||
@@ -702,3 +702,3 @@ | ||
// :: Number -> a -> Cancelable * a | ||
laterSucceed = semmelRamda.curry((dt, value) => (resolve, unused) => { | ||
laterSucceed = ramda.curry((dt, value) => (resolve, unused) => { | ||
const timer = setTimeout(resolve, dt, value); | ||
@@ -713,3 +713,3 @@ return () => { clearTimeout(timer); }; | ||
// :: Number -> e -> Cancelable e * | ||
const laterFail = semmelRamda.curry((dt, value) => (unused, reject) => { | ||
const laterFail = ramda.curry((dt, value) => (unused, reject) => { | ||
const timer = setTimeout(reject, dt, value); | ||
@@ -727,9 +727,9 @@ return () => { clearTimeout(timer); }; | ||
const maybeOfBaconObservableToBaconObservableOfMaybe = | ||
maybe$1(semmelRamda.compose(Bacon__namespace.once, nothing), observable => observable.toEventStream().map(of$2)); | ||
maybe$1(ramda.compose(Bacon__namespace.once, nothing), observable => observable.toEventStream().map(of$2)); | ||
var map$1 = semmelRamda.curry((fn, cc) => (resolve, reject) => cc(semmelRamda.o(resolve, fn), reject)); | ||
var map$1 = ramda.curry((fn, cc) => (resolve, reject) => cc(ramda.o(resolve, fn), reject)); | ||
// A specialisation of the Maybe sequence: | ||
// sequence(of_c, map_c) | ||
var maybeOfCancelableToCancelableOfMaybe = maybe$1(semmelRamda.compose(of, nothing), map$1(just)); | ||
var maybeOfCancelableToCancelableOfMaybe = maybe$1(ramda.compose(of, nothing), map$1(just)); | ||
@@ -751,7 +751,7 @@ /** | ||
// maybeToPromise :: e -> Maybe a -> Promise e a | ||
maybeToPromise = semmelRamda.curry((e, ma) => maybe$1(semmelRamda.thunkify(reject$1)(e), of$3, ma)), | ||
maybeToPromise = ramda.curry((e, ma) => maybe$1(ramda.thunkify(reject$1)(e), of$3, ma)), | ||
// maybeToObj :: key -> Maybe a -> ({}|{key: a}) | ||
// key = String | ||
maybeToObj = semmelRamda.curry((keyName, ma) => maybe$1(semmelRamda.always({}), semmelRamda.objOf(keyName), ma)), | ||
maybeToObj = ramda.curry((keyName, ma) => maybe$1(ramda.always({}), ramda.objOf(keyName), ma)), | ||
@@ -765,4 +765,4 @@ /** | ||
// keyMaybeToMaybeObj :: key -> {key: Maybe a, …} -> Maybe {key: a, …} | ||
keyMaybeToMaybeObj = semmelRamda.curry((keyName, obj) => | ||
maybe$1(nothing, semmelRamda.o(just, semmelRamda.assoc(keyName, semmelRamda.__, obj)), obj[keyName]) | ||
keyMaybeToMaybeObj = ramda.curry((keyName, obj) => | ||
maybe$1(nothing, ramda.o(just, ramda.assoc(keyName, ramda.__, obj)), obj[keyName]) | ||
// TODO: Is that the same as | ||
@@ -778,3 +778,3 @@ // map_mb(assoc(key, __, obj), obj[key]) | ||
// maybeOfPromiseToPromiseOfMaybe :: Maybe Promise e a -> Promise e Maybe a | ||
maybeOfPromiseToPromiseOfMaybe = maybe$1(semmelRamda.compose(of$3, nothing), map_p(of$2)), | ||
maybeOfPromiseToPromiseOfMaybe = maybe$1(ramda.compose(of$3, nothing), map_p(of$2)), | ||
@@ -784,4 +784,4 @@ /** @deprecated */ | ||
// keyPromiseToPromiseCollection :: Int -> [v,…, Promise e v, v,…] -> Promise e [v] | ||
keyPromiseToPromiseCollection = semmelRamda.curry((key, obj) => | ||
map_p(semmelRamda.assoc(key, semmelRamda.__, obj), obj[key]) | ||
keyPromiseToPromiseCollection = ramda.curry((key, obj) => | ||
map_p(ramda.assoc(key, ramda.__, obj), obj[key]) | ||
); | ||
@@ -809,3 +809,3 @@ | ||
const race = semmelRamda.curry((ccA, ccB) => (resolve, reject) => { | ||
const race = ramda.curry((ccA, ccB) => (resolve, reject) => { | ||
let | ||
@@ -842,4 +842,4 @@ cancelB, | ||
var chain = semmelRamda.curry((fn, cc) => (resolve, reject) => { | ||
let cancel = semmelRamda.identity; | ||
var chain = ramda.curry((fn, cc) => (resolve, reject) => { | ||
let cancel = ramda.identity; | ||
const resolveInner = x => { | ||
@@ -862,3 +862,3 @@ cancel = fn(x)(resolve, reject); | ||
// Sequential execution is derived from chain and map: ap(mf, ma) = chain(f => map(f, ma), mf) | ||
ap = semmelRamda.curry((ccF, ccB) => (res, rej) => { | ||
ap = ramda.curry((ccF, ccB) => (res, rej) => { | ||
let theF, theB, cancelB, hasB; | ||
@@ -908,3 +908,3 @@ const cancelF = ccF( | ||
var liftA2 = semmelRamda.curry((f, ma, mb) => ap(map$1(f, ma), mb)); | ||
var liftA2 = ramda.curry((f, ma, mb) => ap(map$1(f, ma), mb)); | ||
@@ -979,3 +979,3 @@ /*** | ||
const | ||
cancelify = fn => semmelRamda.curryN(fn.length, (...args) => | ||
cancelify = fn => ramda.curryN(fn.length, (...args) => | ||
(res, rej) => { | ||
@@ -995,5 +995,5 @@ let | ||
var biTap = semmelRamda.curry((fnf, fns, cc) => (resolve, reject) => cc( | ||
semmelRamda.tryCatch(semmelRamda.o(resolve, semmelRamda.tap(fns)), (e, ...args) => reject(e)), | ||
semmelRamda.tryCatch(semmelRamda.o(reject, semmelRamda.tap(fnf)), (e_fnf, e) => reject(e_fnf)) | ||
var biTap = ramda.curry((fnf, fns, cc) => (resolve, reject) => cc( | ||
ramda.tryCatch(ramda.o(resolve, ramda.tap(fns)), (e, ...args) => reject(e)), | ||
ramda.tryCatch(ramda.o(reject, ramda.tap(fnf)), (e_fnf, e) => reject(e_fnf)) | ||
)); | ||
@@ -1570,5 +1570,5 @@ | ||
// :: Applicative f => ((a → f a), ((a → b → c) → f a → f b → f c) → [f a] → f [a] | ||
const sequence = semmelRamda.curry((of_f, liftA2_f, lfa) => | ||
semmelRamda.reduce( | ||
(acc, x) => liftA2_f(semmelRamda.append, x, acc), | ||
const sequence = ramda.curry((of_f, liftA2_f, lfa) => | ||
ramda.reduce( | ||
(acc, x) => liftA2_f(ramda.append, x, acc), | ||
of_f([]), | ||
@@ -1579,4 +1579,4 @@ lfa | ||
var traverse = semmelRamda.curry((of_f, liftA2_f, effect_to_f, ma) => | ||
sequence(of_f, liftA2_f, semmelRamda.map(effect_to_f, ma))); | ||
var traverse = ramda.curry((of_f, liftA2_f, effect_to_f, ma) => | ||
sequence(of_f, liftA2_f, ramda.map(effect_to_f, ma))); | ||
@@ -1591,3 +1591,3 @@ /** | ||
const | ||
find = semmelRamda.curryN(2, (predicate, list) => { | ||
find = ramda.curryN(2, (predicate, list) => { | ||
// shameless copy from Ramda | ||
@@ -1606,3 +1606,3 @@ let idx = 0; | ||
// map :: (a -> b) -> [a] -> [b] | ||
var map = semmelRamda.curry((f, mx) => mx.map(semmelRamda.unary(f))); | ||
var map = ramda.curry((f, mx) => mx.map(ramda.unary(f))); | ||
@@ -1609,0 +1609,0 @@ var list = /*#__PURE__*/Object.freeze({ |
/* @license Apache-2.0 | ||
@visisoft/staticland v.0.1.36 visisoft.de | ||
(Build date: 1/13/2022 - 4:48:59 PM) | ||
@visisoft/staticland v.0.1.37 visisoft.de | ||
(Build date: 1/17/2022 - 8:06:27 PM) | ||
*/ | ||
@@ -9,3 +9,3 @@ 'use strict'; | ||
var semmelRamda = require('semmel-ramda'); | ||
var ramda = require('ramda'); | ||
var Bacon = require('baconjs'); | ||
@@ -52,3 +52,3 @@ | ||
// :: (a -> Boolean) -> (a -> b) -> a -> Either b a | ||
semmelRamda.curry((predicate, createLeftValue, a) => | ||
ramda.curry((predicate, createLeftValue, a) => | ||
predicate(a) ? of$3 (a) : left(createLeftValue(a)) | ||
@@ -63,12 +63,12 @@ ); | ||
semmelRamda.either(isLeft, isRight); | ||
ramda.either(isLeft, isRight); | ||
// Transformation // | ||
semmelRamda.curry((f, mx) => | ||
semmelRamda.when(isRight, semmelRamda.compose(of$3, semmelRamda.unary(f), semmelRamda.nth(1)))(mx) | ||
ramda.curry((f, mx) => | ||
ramda.when(isRight, ramda.compose(of$3, ramda.unary(f), ramda.nth(1)))(mx) | ||
); | ||
semmelRamda.curry((f, mx) => | ||
semmelRamda.when(isRight, semmelRamda.o(semmelRamda.unary(f), semmelRamda.nth(1)))(mx) | ||
ramda.curry((f, mx) => | ||
ramda.when(isRight, ramda.o(ramda.unary(f), ramda.nth(1)))(mx) | ||
); | ||
@@ -79,3 +79,3 @@ | ||
// :: (c -> b) -> (a -> b) -> Either c a -> b | ||
either = semmelRamda.curry((leftFn, rightFn, ma) => | ||
either = ramda.curry((leftFn, rightFn, ma) => | ||
isLeft(ma) ? leftFn(ma[0]) : rightFn(ma[1]) | ||
@@ -91,4 +91,4 @@ ); | ||
// :: Either b a -> Either b a -> Either b a | ||
semmelRamda.curry((ma, mb) => | ||
either(semmelRamda.always(mb), of$3, ma) | ||
ramda.curry((ma, mb) => | ||
either(ramda.always(mb), of$3, ma) | ||
); | ||
@@ -99,3 +99,3 @@ | ||
// map :: (a -> b) -> Promise e a -> Promise e b | ||
var map_p = semmelRamda.curry((fn, aPromise) => aPromise.then(fn)); | ||
var map_p = ramda.curry((fn, aPromise) => aPromise.then(fn)); | ||
@@ -111,3 +111,3 @@ /** | ||
// tap :: (a -> *) -> Promise a -> Promise a | ||
semmelRamda.curry((fn, p) => | ||
ramda.curry((fn, p) => | ||
p.then(x => { | ||
@@ -118,3 +118,3 @@ fn(x); | ||
semmelRamda.curry((onFailure, onSuccess, p) => | ||
ramda.curry((onFailure, onSuccess, p) => | ||
p.then( | ||
@@ -147,3 +147,3 @@ x => { | ||
// tapRegardless :: (a -> *) -> Promise a -> Promise a | ||
semmelRamda.curry((fn, p) => { | ||
ramda.curry((fn, p) => { | ||
p.then(fn).catch(x => x); | ||
@@ -173,3 +173,3 @@ | ||
// ap :: Promise (a -> b) -> Promise a -> Promise b | ||
ap_p = semmelRamda.curry((fnPromise, aPromise) => | ||
ap_p = ramda.curry((fnPromise, aPromise) => | ||
Promise.all([ | ||
@@ -190,7 +190,7 @@ fnPromise, | ||
// later :: Number -> t -> Promise e t | ||
semmelRamda.curry((dt, value) => new Promise(resolve => | ||
ramda.curry((dt, value) => new Promise(resolve => | ||
setTimeout(resolve, dt, value) | ||
)); | ||
semmelRamda.curry((f, ma, mb) => ap_p(map_p(f, ma), mb)); | ||
ramda.curry((f, ma, mb) => ap_p(map_p(f, ma), mb)); | ||
@@ -228,3 +228,3 @@ /** | ||
// mapRej :: (e -> c) -> Promise e b -> Promise c b | ||
semmelRamda.curry((fn, aPromise) => aPromise.catch(semmelRamda.o(reject$1, fn))); | ||
ramda.curry((fn, aPromise) => aPromise.catch(ramda.o(reject$1, fn))); | ||
@@ -234,6 +234,6 @@ /** | ||
*/ | ||
semmelRamda.curry((fn, aPromise) => aPromise.then(null, fn)); | ||
ramda.curry((fn, aPromise) => aPromise.then(null, fn)); | ||
// this implementation enforces fn to return a promise | ||
// chainRej :: (e -> Promise g b) -> Promise e a -> Promise (e | g) (a | b) | ||
semmelRamda.curry((fn, aPromise) => | ||
ramda.curry((fn, aPromise) => | ||
new Promise((resolve, reject_) => { | ||
@@ -245,8 +245,8 @@ aPromise.then(resolve, a => fn(a).then(resolve, reject_)); | ||
// bimap :: Bifunctor m => (a -> c) -> (b -> d) -> m a b -> m c d | ||
semmelRamda.curry((failureMap, successMap, aPromise) => | ||
aPromise.then(successMap, semmelRamda.o(reject$1, failureMap))); | ||
ramda.curry((failureMap, successMap, aPromise) => | ||
aPromise.then(successMap, ramda.o(reject$1, failureMap))); | ||
// this implementation enforces fn to return a promise | ||
// chain :: (a -> Promise e b) -> Promise g a -> Promise (e|g) b | ||
semmelRamda.curry((fn, aPromise) => | ||
ramda.curry((fn, aPromise) => | ||
new Promise((resolve, reject_) => { | ||
@@ -261,3 +261,3 @@ aPromise | ||
// chainIf :: (a -> Boolean) -> (a -> Promise a) -> Promise a -> Promise a | ||
semmelRamda.curry((predicate, fn, aPromise) => | ||
ramda.curry((predicate, fn, aPromise) => | ||
new Promise((resolve, reject_) => { | ||
@@ -271,3 +271,3 @@ aPromise | ||
// coalesce :: (e -> b) -> (a -> b) -> Promise e a -> Promise e b | ||
coalesce = semmelRamda.curry((left, right, p) => | ||
coalesce = ramda.curry((left, right, p) => | ||
p.then(right, left) | ||
@@ -285,3 +285,3 @@ ); | ||
// chainTap :: (a -> Promise g *) -> Promise e a -> Promise (e|g) a | ||
semmelRamda.curry((fn, p) => | ||
ramda.curry((fn, p) => | ||
new Promise((resolve, reject_) => { | ||
@@ -296,3 +296,3 @@ p | ||
semmelRamda.curry((pa, pb) => Promise.race([pa, pb])); | ||
ramda.curry((pa, pb) => Promise.race([pa, pb])); | ||
@@ -305,3 +305,3 @@ /** | ||
// :: Promise e a -> Promise e a -> Promise e a | ||
semmelRamda.curry((pa, pb) => new Promise((resolve_, reject_) => { | ||
ramda.curry((pa, pb) => new Promise((resolve_, reject_) => { | ||
const | ||
@@ -332,7 +332,7 @@ rejectGenerator = function* () { | ||
// getOrElse :: a -> Maybe a -> a | ||
var getOrElse = semmelRamda.reduce((acc, x) => x); // alt: xs => xs[0] | ||
var getOrElse = ramda.reduce((acc, x) => x); // alt: xs => xs[0] | ||
//map = curry((f, mx) => isJust(mx) ? mx.map(unary(f)) : singleNothing), // alt mx.map(unary(f)) | ||
// map :: (a -> b) -> Maybe a -> Maybe b | ||
var map = semmelRamda.curry((f, mx) => mx.map(semmelRamda.unary(f))); | ||
var map = ramda.curry((f, mx) => mx.map(ramda.unary(f))); | ||
@@ -350,3 +350,3 @@ /** | ||
// maybe :: (() -> b) -> (a -> b) -> Maybe a -> b | ||
var maybe = semmelRamda.curry((nothingFn, justFn, ma) => | ||
var maybe = ramda.curry((nothingFn, justFn, ma) => | ||
isJust(ma) ? getOrElse("THIS_VALUE_SHOWING_ANYWHERE_IS_AN_ERROR", map(justFn, ma)) | ||
@@ -367,7 +367,7 @@ : nothingFn() | ||
//chain = curry((f, mx) => mx.flatMap(unary(f))), | ||
var chain = semmelRamda.curry((f, mx) => isJust(mx) ? f(mx[0]) : nothing()); | ||
var chain = ramda.curry((f, mx) => isJust(mx) ? f(mx[0]) : nothing()); | ||
var ap = semmelRamda.curry((mf, mx) => chain(f => map(f, mx), mf)); | ||
var ap = ramda.curry((mf, mx) => chain(f => map(f, mx), mf)); | ||
semmelRamda.curry((f, ma, mb) => ap(map(f, ma), mb)); | ||
ramda.curry((f, ma, mb) => ap(map(f, ma), mb)); | ||
@@ -382,5 +382,5 @@ /** | ||
// :: Applicative f => ((a → f a), ((a → b) → f a → f b) → Maybe (f a) → f (Maybe a) | ||
const sequence = semmelRamda.curry((of_f, map_f, mfa) => | ||
const sequence = ramda.curry((of_f, map_f, mfa) => | ||
maybe( // :: (() -> b) -> (a -> b) -> Maybe a -> b | ||
semmelRamda.compose(of_f, nothing), // :: () -> f Nothing | ||
ramda.compose(of_f, nothing), // :: () -> f Nothing | ||
map_f(just), // :: f a -> f Just a | ||
@@ -391,3 +391,3 @@ mfa // :: Maybe f a | ||
semmelRamda.curry((of_f, map_f, effect_to_f, ma) => sequence(of_f, map_f, map(effect_to_f, ma))); | ||
ramda.curry((of_f, map_f, effect_to_f, ma) => sequence(of_f, map_f, map(effect_to_f, ma))); | ||
@@ -404,9 +404,9 @@ /** | ||
// fromNilable :: (a|undefined|null) -> Maybe a | ||
semmelRamda.ifElse(semmelRamda.isNil, nothing, of$1); | ||
ramda.ifElse(ramda.isNil, nothing, of$1); | ||
// fromContentHolding :: a -> Maybe a | ||
semmelRamda.ifElse(semmelRamda.isEmpty, nothing, of$1); | ||
ramda.ifElse(ramda.isEmpty, nothing, of$1); | ||
// :: (a -> Boolean) -> a -> Maybe a | ||
semmelRamda.curry((predicate, x) => | ||
ramda.curry((predicate, x) => | ||
predicate(x) ? of$1(x) : nothing() | ||
@@ -423,5 +423,5 @@ ); | ||
// equals :: Maybe a -> Maybe b -> Boolean | ||
semmelRamda.curry((ma, mb) => | ||
ramda.curry((ma, mb) => | ||
isJust(ma) ? | ||
isJust(mb) && semmelRamda.equals(ma[0], mb[0]) : | ||
isJust(mb) && ramda.equals(ma[0], mb[0]) : | ||
isNothing(mb) | ||
@@ -436,4 +436,4 @@ ); | ||
// tap :: (a -> *) -> Maybe a -> Maybe a | ||
semmelRamda.curry((fn, mx) => { | ||
mx.forEach(semmelRamda.unary(fn)); | ||
ramda.curry((fn, mx) => { | ||
mx.forEach(ramda.unary(fn)); | ||
return mx; | ||
@@ -445,4 +445,4 @@ }); | ||
maybe( | ||
semmelRamda.always('Nothing'), | ||
value => `Just(${semmelRamda.pathOr(typeof value, ['constructor', 'name'], value)})` | ||
ramda.always('Nothing'), | ||
value => `Just(${ramda.pathOr(typeof value, ['constructor', 'name'], value)})` | ||
); | ||
@@ -498,3 +498,3 @@ | ||
// :: Number -> a -> Cancelable * a | ||
laterSucceed = semmelRamda.curry((dt, value) => (resolve, unused) => { | ||
laterSucceed = ramda.curry((dt, value) => (resolve, unused) => { | ||
const timer = setTimeout(resolve, dt, value); | ||
@@ -509,3 +509,3 @@ return () => { clearTimeout(timer); }; | ||
// :: Number -> e -> Cancelable e * | ||
const laterFail = semmelRamda.curry((dt, value) => (unused, reject) => { | ||
const laterFail = ramda.curry((dt, value) => (unused, reject) => { | ||
const timer = setTimeout(reject, dt, value); | ||
@@ -523,9 +523,9 @@ return () => { clearTimeout(timer); }; | ||
const maybeOfBaconObservableToBaconObservableOfMaybe = | ||
maybe(semmelRamda.compose(Bacon__namespace.once, nothing), observable => observable.toEventStream().map(of$1)); | ||
maybe(ramda.compose(Bacon__namespace.once, nothing), observable => observable.toEventStream().map(of$1)); | ||
var map_c = semmelRamda.curry((fn, cc) => (resolve, reject) => cc(semmelRamda.o(resolve, fn), reject)); | ||
var map_c = ramda.curry((fn, cc) => (resolve, reject) => cc(ramda.o(resolve, fn), reject)); | ||
// A specialisation of the Maybe sequence: | ||
// sequence(of_c, map_c) | ||
var maybeOfCancelableToCancelableOfMaybe = maybe(semmelRamda.compose(of, nothing), map_c(just)); | ||
var maybeOfCancelableToCancelableOfMaybe = maybe(ramda.compose(of, nothing), map_c(just)); | ||
@@ -546,7 +546,7 @@ /** | ||
// maybeToPromise :: e -> Maybe a -> Promise e a | ||
maybeToPromise = semmelRamda.curry((e, ma) => maybe(semmelRamda.thunkify(reject$1)(e), of$2, ma)), | ||
maybeToPromise = ramda.curry((e, ma) => maybe(ramda.thunkify(reject$1)(e), of$2, ma)), | ||
// maybeToObj :: key -> Maybe a -> ({}|{key: a}) | ||
// key = String | ||
maybeToObj = semmelRamda.curry((keyName, ma) => maybe(semmelRamda.always({}), semmelRamda.objOf(keyName), ma)), | ||
maybeToObj = ramda.curry((keyName, ma) => maybe(ramda.always({}), ramda.objOf(keyName), ma)), | ||
@@ -560,4 +560,4 @@ /** | ||
// keyMaybeToMaybeObj :: key -> {key: Maybe a, …} -> Maybe {key: a, …} | ||
keyMaybeToMaybeObj = semmelRamda.curry((keyName, obj) => | ||
maybe(nothing, semmelRamda.o(just, semmelRamda.assoc(keyName, semmelRamda.__, obj)), obj[keyName]) | ||
keyMaybeToMaybeObj = ramda.curry((keyName, obj) => | ||
maybe(nothing, ramda.o(just, ramda.assoc(keyName, ramda.__, obj)), obj[keyName]) | ||
// TODO: Is that the same as | ||
@@ -573,3 +573,3 @@ // map_mb(assoc(key, __, obj), obj[key]) | ||
// maybeOfPromiseToPromiseOfMaybe :: Maybe Promise e a -> Promise e Maybe a | ||
maybeOfPromiseToPromiseOfMaybe = maybe(semmelRamda.compose(of$2, nothing), map_p(of$1)), | ||
maybeOfPromiseToPromiseOfMaybe = maybe(ramda.compose(of$2, nothing), map_p(of$1)), | ||
@@ -579,4 +579,4 @@ /** @deprecated */ | ||
// keyPromiseToPromiseCollection :: Int -> [v,…, Promise e v, v,…] -> Promise e [v] | ||
keyPromiseToPromiseCollection = semmelRamda.curry((key, obj) => | ||
map_p(semmelRamda.assoc(key, semmelRamda.__, obj), obj[key]) | ||
keyPromiseToPromiseCollection = ramda.curry((key, obj) => | ||
map_p(ramda.assoc(key, ramda.__, obj), obj[key]) | ||
); | ||
@@ -583,0 +583,0 @@ |
@@ -8,3 +8,3 @@ { | ||
"emittery": "^0.10.0", | ||
"semmel-ramda": "^0.33.0" | ||
"ramda": "^0.28.0" | ||
}, | ||
@@ -109,3 +109,3 @@ "description": "StaticLand functions for Algebraic Data Types based on native JavaScript types", | ||
"type": "module", | ||
"version": "0.1.36" | ||
"version": "0.1.37" | ||
} |
@@ -5,4 +5,6 @@ [![NPM Version](https://img.shields.io/npm/v/@visisoft/staticland.svg?style=flat-square)](https://www.npmjs.com/package/@visisoft/staticland) ![Statements](https://img.shields.io/badge/statements-91.2%25-brightgreen.svg?style=flat-square) | ||
==================== | ||
Operations on Algebraic Data Types (ADT) (Either, Maybe, Promise, CancelableComputation) realised with *free static functions*. The static functions do not expect custom-made ADT classes but work on the *native JavaScript types* as `Array`, `Promise` and `Function`. Fairness demands to confess that `Function` carries some data in [closed over](#closed-over) variables. | ||
Operations (Mapping, Lensing, etc.) on Algebraic Data Types (ADT) (Either, Maybe, Promise, CancelableComputation) realised with *free static functions*. | ||
The data-holding types are modelled with "simple" *native JavaScript constructs* as `Array`, `Promise` or `Function`. Thus, the algebraic operations do not expect objects from ADT classes but work on those "simple" *JavaScript types*. | ||
Using simple native types means that | ||
@@ -111,3 +113,3 @@ | ||
As FP utility library [Ramda][ramda-homepage] is used. The patch fork [semmel-ramda][semmel-ramda] will be replaced with Ramda when it gets published as proper dual-mode or [hybrid][2-ality-hybrid] module. | ||
As FP utility library [Ramda][ramda-homepage] is used. | ||
@@ -120,6 +122,4 @@ ###### closed over | ||
[ramda-homepage]: https://ramdajs.com | ||
[2-ality-hybrid]: https://2ality.com/2019/10/hybrid-npm-packages.html | ||
[semmel-ramda]: https://github.com/semmel/ramda | ||
[wikipedia-fcompose]: https://en.wikipedia.org/wiki/Function_composition_(computer_science) | ||
[ramda-fantasy]: https://github.com/ramda/ramda-fantasy | ||
[crocks]: https://crocks.dev/docs/crocks/ |
@@ -8,3 +8,3 @@ /** | ||
import { curry } from "semmel-ramda"; | ||
import { curry } from 'ramda'; | ||
const | ||
@@ -11,0 +11,0 @@ // Note: parallel execution |
@@ -1,2 +0,2 @@ | ||
import {curry, o, tap, tryCatch} from "semmel-ramda"; | ||
import {curry, o, tap, tryCatch} from 'ramda'; | ||
@@ -3,0 +3,0 @@ export default curry((fnf, fns, cc) => (resolve, reject) => cc( |
@@ -1,2 +0,2 @@ | ||
import { curryN } from "semmel-ramda"; | ||
import { curryN } from 'ramda'; | ||
@@ -3,0 +3,0 @@ const |
@@ -1,2 +0,2 @@ | ||
import {curry, identity} from "semmel-ramda"; | ||
import {curry, identity} from 'ramda'; | ||
@@ -3,0 +3,0 @@ export default curry((fn, cc) => (resolve, reject) => { |
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
import { once } from "semmel-ramda"; | ||
import { once } from 'ramda'; | ||
@@ -10,0 +10,0 @@ const |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
@@ -3,0 +3,0 @@ // :: Number -> e -> Cancelable e * |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
@@ -3,0 +3,0 @@ const |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
import ap from "./ap.js"; | ||
@@ -3,0 +3,0 @@ import map from './map.js'; |
@@ -1,3 +0,3 @@ | ||
import {curry, o} from "semmel-ramda"; | ||
import {curry, o} from 'ramda'; | ||
export default curry((fn, cc) => (resolve, reject) => cc(o(resolve, fn), reject)); |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
@@ -3,0 +3,0 @@ const race = curry((ccA, ccB) => (resolve, reject) => { |
@@ -8,3 +8,3 @@ /** | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
@@ -11,0 +11,0 @@ const |
@@ -8,3 +8,3 @@ /** | ||
import { always, compose, curry, either as eitherThisOr, nth, o, tryCatch, unary, when } from 'semmel-ramda'; | ||
import { always, compose, curry, either as eitherThisOr, nth, o, tryCatch, unary, when } from 'ramda'; | ||
@@ -11,0 +11,0 @@ const |
@@ -8,3 +8,3 @@ /** | ||
import {curry} from 'semmel-ramda'; | ||
import {curry} from 'ramda'; | ||
@@ -11,0 +11,0 @@ const |
@@ -8,4 +8,3 @@ /** | ||
import {always, call, compose, curry, flip, o, partial} from | ||
'semmel-ramda'; | ||
import {always, call, compose, curry, flip, o, partial} from 'ramda'; | ||
@@ -54,2 +53,1 @@ // Construction // | ||
@@ -8,3 +8,3 @@ /** | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
import {map as map_i} from '../identity.js'; | ||
@@ -11,0 +11,0 @@ |
@@ -8,3 +8,3 @@ /** | ||
import {view} from './view.js'; | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
@@ -11,0 +11,0 @@ const |
@@ -10,3 +10,3 @@ /** | ||
import {map as map_c} from '../constant.js'; | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
import {over} from "./over.js"; | ||
@@ -13,0 +13,0 @@ |
@@ -9,3 +9,3 @@ /** | ||
import {just, nothing} from "../maybe.js"; | ||
import {curryN} from "semmel-ramda"; | ||
import {curryN} from 'ramda'; | ||
@@ -12,0 +12,0 @@ const |
@@ -1,3 +0,3 @@ | ||
import {curry, unary} from "semmel-ramda"; | ||
import {curry, unary} from 'ramda'; | ||
// map :: (a -> b) -> [a] -> [b] | ||
export default curry((f, mx) => mx.map(unary(f))); |
@@ -9,3 +9,3 @@ /** | ||
import {append, curry, reduce} from 'semmel-ramda'; | ||
import {append, curry, reduce} from 'ramda'; | ||
@@ -12,0 +12,0 @@ // :: Applicative f => ((a → f a), ((a → b → c) → f a → f b → f c) → [f a] → f [a] |
@@ -1,2 +0,2 @@ | ||
import {curry, map} from "semmel-ramda"; | ||
import {curry, map} from 'ramda'; | ||
import sequence from "./sequence.js"; | ||
@@ -3,0 +3,0 @@ |
@@ -16,3 +16,3 @@ /** | ||
nAry, unary, pathOr, reduce as reduce_l, unapply | ||
} from 'semmel-ramda'; | ||
} from 'ramda'; | ||
@@ -19,0 +19,0 @@ import maybe from './maybe/maybe.js'; |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
import chain from "./chain.js"; | ||
@@ -3,0 +3,0 @@ import map from "./map.js"; |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
import {isJust} from "./inspection.js"; | ||
@@ -3,0 +3,0 @@ import {nothing} from "./creation.js"; |
@@ -1,2 +0,2 @@ | ||
import {reduce} from "semmel-ramda"; | ||
import {reduce} from 'ramda'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
import ap from "./ap.js"; | ||
@@ -3,0 +3,0 @@ import map from './map.js'; |
@@ -1,4 +0,4 @@ | ||
import {curry, unary} from "semmel-ramda"; | ||
import {curry, unary} from 'ramda'; | ||
//map = curry((f, mx) => isJust(mx) ? mx.map(unary(f)) : singleNothing), // alt mx.map(unary(f)) | ||
// map :: (a -> b) -> Maybe a -> Maybe b | ||
export default curry((f, mx) => mx.map(unary(f))); |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
import {isJust} from './inspection.js'; | ||
@@ -3,0 +3,0 @@ import getOrElse from './getOrElse.js'; |
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
import {compose, curry} from "semmel-ramda"; | ||
import {compose, curry} from 'ramda'; | ||
import maybe from './maybe.js'; | ||
@@ -10,0 +10,0 @@ import {just, nothing} from './creation.js'; |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
import map from "./map.js"; | ||
@@ -3,0 +3,0 @@ import sequence from "./sequence.js"; |
@@ -8,3 +8,3 @@ /** | ||
import { curry, o, identity } from 'semmel-ramda'; | ||
import { curry, o, identity } from 'ramda'; | ||
import map from './promise/map.js'; | ||
@@ -11,0 +11,0 @@ import {bi_tap, tap, tapRegardless} from "./promise/tap.js"; |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -8,3 +8,3 @@ /** | ||
import {curry} from 'semmel-ramda'; | ||
import {curry} from 'ramda'; | ||
@@ -11,0 +11,0 @@ const |
@@ -1,2 +0,2 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
import ap from "./ap.js"; | ||
@@ -3,0 +3,0 @@ import map from './map.js'; |
@@ -1,4 +0,4 @@ | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
// map :: (a -> b) -> Promise e a -> Promise e b | ||
export default curry((fn, aPromise) => aPromise.then(fn)); |
@@ -9,3 +9,3 @@ /** | ||
import {curry} from "semmel-ramda"; | ||
import {curry} from 'ramda'; | ||
@@ -12,0 +12,0 @@ const |
@@ -12,3 +12,3 @@ /** | ||
import { maybe, nothing, of as of_mb, just } from './maybe.js'; | ||
import { __, always, assoc, compose, curry, nth, o, objOf, prop, thunkify, update } from 'semmel-ramda'; | ||
import { __, always, assoc, compose, curry, nth, o, objOf, prop, thunkify, update } from 'ramda'; | ||
export {default as promiseToCancelable} from './transformations/promiseToCancelable.js'; | ||
@@ -15,0 +15,0 @@ export {default as cancelableToPromise} from './transformations/cancelableToPromise.js'; |
import {maybe, of as of_mb, nothing} from "../maybe.js"; | ||
import * as Bacon from "baconjs"; | ||
import {compose} from "semmel-ramda"; | ||
import {compose} from 'ramda'; | ||
@@ -5,0 +5,0 @@ // A specialisation of the Maybe sequence: |
@@ -1,2 +0,2 @@ | ||
import {compose} from "semmel-ramda"; | ||
import {compose} from 'ramda'; | ||
import {just, maybe, nothing} from "../maybe.js"; | ||
@@ -3,0 +3,0 @@ import map_c from '../cancelable/map.js'; |
195722
5304
+ Addedramda@^0.28.0
+ Addedramda@0.28.0(transitive)
- Removedsemmel-ramda@^0.33.0
- Removedsemmel-ramda@0.33.0(transitive)