UNPKG

crocks

Version:

A collection of well known Algebraic Datatypes for your utter enjoyment.

2,059 lines (1,508 loc) 290 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["crocks"] = factory(); else root["crocks"] = factory(); })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ /** @author Henrique Limas */ var combinators = __webpack_require__(1) var logic = __webpack_require__(14) var predicates = __webpack_require__(27) var crocks = { Arrow: __webpack_require__(111), Async: __webpack_require__(114), Const: __webpack_require__(120), Either: __webpack_require__(121), Equiv: __webpack_require__(124), Identity: __webpack_require__(125), IO: __webpack_require__(126), List: __webpack_require__(127), Maybe: __webpack_require__(130), Pair: __webpack_require__(131), Pred: __webpack_require__(133), Reader: __webpack_require__(135), ReaderT: __webpack_require__(136), Result: __webpack_require__(137), Star: __webpack_require__(138), State: __webpack_require__(139), Tuple: __webpack_require__(141), Unit: __webpack_require__(142), Writer: __webpack_require__(143) } var helpers = Object.assign({}, __webpack_require__(144), { branch: __webpack_require__(190), fanout: __webpack_require__(191), find: __webpack_require__(192), getPath: __webpack_require__(193), getProp: __webpack_require__(194), prop: __webpack_require__(195), propPath: __webpack_require__(196), safe: __webpack_require__(197), safeAfter: __webpack_require__(198), safeLift: __webpack_require__(199), toPairs: __webpack_require__(200), tryCatch: __webpack_require__(201) } ) var monoids = { All: __webpack_require__(202), Any: __webpack_require__(203), Assign: __webpack_require__(204), Endo: __webpack_require__(205), First: __webpack_require__(206), Last: __webpack_require__(207), Max: __webpack_require__(208), Min: __webpack_require__(209), Prod: __webpack_require__(210), Sum: __webpack_require__(211) } var pointfree = Object.assign({}, __webpack_require__(212), { evalWith: __webpack_require__(251), execWith: __webpack_require__(252), fst: __webpack_require__(253), log: __webpack_require__(254), nmap: __webpack_require__(255), project: __webpack_require__(256), race: __webpack_require__(257), read: __webpack_require__(258), snd: __webpack_require__(259) } ) var transforms = { arrayToList: __webpack_require__(260), asyncToPromise: __webpack_require__(261), eitherToAsync: __webpack_require__(262), eitherToFirst: __webpack_require__(263), eitherToLast: __webpack_require__(264), eitherToMaybe: __webpack_require__(265), eitherToResult: __webpack_require__(266), firstToAsync: __webpack_require__(267), firstToEither: __webpack_require__(268), firstToLast: __webpack_require__(269), firstToMaybe: __webpack_require__(270), firstToResult: __webpack_require__(271), lastToAsync: __webpack_require__(272), lastToEither: __webpack_require__(273), lastToFirst: __webpack_require__(274), lastToMaybe: __webpack_require__(275), lastToResult: __webpack_require__(276), listToArray: __webpack_require__(277), maybeToArray: __webpack_require__(278), maybeToAsync: __webpack_require__(279), maybeToEither: __webpack_require__(280), maybeToFirst: __webpack_require__(281), maybeToLast: __webpack_require__(282), maybeToList: __webpack_require__(283), maybeToResult: __webpack_require__(284), resultToAsync: __webpack_require__(285), resultToEither: __webpack_require__(286), resultToFirst: __webpack_require__(287), resultToLast: __webpack_require__(288), resultToMaybe: __webpack_require__(289), tupleToArray: __webpack_require__(290), writerToPair: __webpack_require__(291) } module.exports = Object.assign( {}, combinators, crocks, helpers, logic, monoids, pointfree, predicates, transforms ) /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { applyTo: __webpack_require__(2), compose2: __webpack_require__(5), composeB: __webpack_require__(6), constant: __webpack_require__(8), converge: __webpack_require__(9), flip: __webpack_require__(10), identity: __webpack_require__(11), psi: __webpack_require__(12), substitution: __webpack_require__(13) } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isFunction = __webpack_require__(4) // Application (Thrush) // applyTo :: a -> (a -> b) -> b function applyTo(x, f) { if(!isFunction(f)) { throw new TypeError('applyTo: Function required for second argument') } return f(x) } module.exports = curry(applyTo) /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isFunction = __webpack_require__(4) var CURRY_SYMB = '@@crocks/curried' function applyCurry(fn, arg) { if(!isFunction(fn)) { return fn } return fn.length > 1 ? fn.bind(null, arg) : fn.call(null, arg) } // curry : ((a, b, c) -> d) -> a -> b -> c -> d function curry(fn) { if(fn[CURRY_SYMB]) { return fn } function curried() { var xs = [], len = arguments.length; while ( len-- ) xs[ len ] = arguments[ len ]; var args = xs.length ? xs : [ undefined ] if(args.length < fn.length) { return curry(Function.bind.apply(fn, [ null ].concat(args))) } var val = args.length === fn.length ? fn.apply(null, args) : args.reduce(applyCurry, fn) if(isFunction(val)) { return curry(val) } return val } Object.defineProperty(curried, CURRY_SYMB, { enumerable: false, writable: false, value: true }) return curried } module.exports = curry /***/ }), /* 4 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ // isFunction : a -> Boolean function isFunction(fn) { return typeof fn === 'function' } module.exports = isFunction /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2019 original and current authors */ /** @author Dale Francis (dalefrancis88) */ var curry = __webpack_require__(3) var isFunction = __webpack_require__(4) // compose2 :: (c -> d -> e) -> (a -> c) -> (b -> d) -> a -> b -> e function compose2(f, g, h, x, y) { if(!isFunction(f) || !isFunction(g) || !isFunction(h)) { throw new TypeError('compose2: First, second and third arguments must be functions') } return curry(f)(g(x), h(y)) } module.exports = curry(compose2) /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var compose = __webpack_require__(7) var curry = __webpack_require__(3) var isFunction = __webpack_require__(4) // Composition (Bluebird) // composeB :: (b -> c) -> (a -> b) -> a -> c function composeB(f, g) { if(!(isFunction(f) && isFunction(g))) { throw new TypeError( 'composeB: Functions required for first two arguments' ) } return compose(f, g) } module.exports = curry(composeB) /***/ }), /* 7 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ // Composition (Bluebird) // compose : (b -> c) -> (a -> b) -> a -> c function compose(f, g) { return function(x) { return f(g(x)) } } module.exports = compose /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) // Constant (Kestrel) // constant : a -> b -> a var constant = function (x) { return function () { return x; }; } module.exports = curry(constant) /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2018 original and current authors */ /** @author Matt Ross (amsross) */ var curry = __webpack_require__(3) var isFunction = __webpack_require__(4) // converge (Phoenix or Starling Prime) // (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d function converge(f, g, h, x) { if(!isFunction(f) || !isFunction(g) || !isFunction(h)) { throw new TypeError('converge: Functions required for first three arguments') } return curry(f)(g(x), h(x)) } module.exports = curry(converge) /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isFunction = __webpack_require__(4) // Flip (Cardinal) // flip :: (a -> b -> c) -> b -> a -> c function flip(f, x, y) { if(!isFunction(f)) { throw new TypeError( 'flip: Function required for first argument' ) } return curry(f)(y, x) } module.exports = curry(flip) /***/ }), /* 11 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ // Identity (Idiot) // identity :: a -> a var identity = function (x) { return x; } module.exports = identity /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2019 original and current authors */ /** @author Dale Francis (dalefrancis88) */ var curry = __webpack_require__(3) var isFunction = __webpack_require__(4) // PSI (P) // psi :: (b -> b -> c) -> (a -> b) -> a -> a -> c function psi(f, g, x, y) { if(!isFunction(f) || !isFunction(g)) { throw new TypeError('psi: First and second arguments must be functions') } return curry(f)(g(x), g(y)) } module.exports = curry(psi) /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isFunction = __webpack_require__(4) // Substitution (Starling) // substitution : (a -> b -> c) -> (a -> b) -> a -> c function substitution(f, g, x) { if(!(isFunction(f) && isFunction(g))) { throw new TypeError( 'substitution: Functions required for first two arguments' ) } return curry(f)(x, g(x)) } module.exports = curry(substitution) /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { and: __webpack_require__(15), ifElse: __webpack_require__(21), implies: __webpack_require__(22), not: __webpack_require__(23), or: __webpack_require__(24), unless: __webpack_require__(25), when: __webpack_require__(26) } /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isPredOrFunc = __webpack_require__(16) var predOrFunc = __webpack_require__(20) // and : (a -> Boolean) | Pred -> (a -> Boolean) | Pred -> a -> Boolean function and(f, g) { if(!(isPredOrFunc(f) && isPredOrFunc(g))) { throw new TypeError( 'and: Preds or predicate functions required for first two arguments' ) } return function (x) { return !!(predOrFunc(f, x) && predOrFunc(g, x)); } } module.exports = curry(and) /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2018 original and current authors */ /** @author Dale Francis (dalefrancis88) */ var Pred = __webpack_require__(17).proxy('Pred') var isFunction = __webpack_require__(4) var isSameType = __webpack_require__(18) // isPredOrFunc :: ((a -> b) | pred) -> bool var isPredOrFunc = function (predOrFunc) { return isFunction(predOrFunc) || isSameType(Pred, predOrFunc); } module.exports = isPredOrFunc /***/ }), /* 17 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var _types = { 'unk': function () { return 'unknown'; }, 'All': function () { return 'All'; }, 'Any': function () { return 'Any'; }, 'Arrow': function () { return 'Arrow'; }, 'Assign': function () { return 'Assign'; }, 'Async': function () { return 'Async'; }, 'Const': function (inner) { return ("Const(" + inner + ")"); }, 'Either': function () { return 'Either'; }, 'Endo': function () { return 'Endo'; }, 'Equiv': function () { return 'Equiv'; }, 'First': function () { return 'First'; }, 'Identity': function () { return 'Identity'; }, 'IO': function () { return 'IO'; }, 'Last': function () { return 'Last'; }, 'List': function () { return 'List'; }, 'Max': function () { return 'Max'; }, 'Maybe': function () { return 'Maybe'; }, 'Min': function () { return 'Min'; }, 'Pair': function () { return 'Pair'; }, 'Pred': function () { return 'Pred'; }, 'Prod': function () { return 'Prod'; }, 'Reader': function () { return 'Reader'; }, 'Result': function () { return 'Result'; }, 'Star': function () { return 'Star'; }, 'State': function () { return 'State'; }, 'Sum': function () { return 'Sum'; }, 'Tuple': function (n) { return (n + "-Tuple"); }, 'Unit': function () { return 'Unit'; }, 'Writer': function () { return 'Writer'; } } var type = function (type) { return _types[type] || _types['unk']; } var proxy = function (t, ctx) { return ({ type: function () { return type(t)(ctx); } }); } var typeFn = function (t, ver, ctx) { var typeStr = type(t)(ctx) return ("crocks/" + typeStr + "@" + (ver || 0)) } module.exports = { proxy: proxy, type: type, typeFn: typeFn } /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isFunction = __webpack_require__(4) var type = __webpack_require__(19) // isSameType :: Container m => (m, m) -> Boolean function isSameType(x, y) { var tX = type(x) var tY = type(y) return tX === tY || isFunction(x) && x.name === tY || isFunction(y) && y.name === tX } module.exports = curry(isSameType) /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isFunction = __webpack_require__(4) function type(x) { if(x) { if(isFunction(x.type)) { return x.type() } } return {}.toString.call(x).slice(8, -1) } module.exports = type /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isFunction = __webpack_require__(4) function predOrFunc(pred, x) { if(isFunction(pred)) { return pred(x) } return pred.runWith(x) } module.exports = predOrFunc /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isFunction = __webpack_require__(4) var isPredOrFunc = __webpack_require__(16) var predOrFunc = __webpack_require__(20) // ifElse : (a -> Boolean) | Pred -> (a -> b) -> (a -> c) -> a -> (a | c) function ifElse(pred, f, g) { if(!isPredOrFunc(pred)) { throw new TypeError( 'ifElse: Pred or predicate function required for first argument' ) } if(!(isFunction(f) && isFunction(g))) { throw new TypeError( 'ifElse: Functions required for second and third arguments' ) } return function (x) { return predOrFunc(pred, x) ? f(x) : g(x); } } module.exports = curry(ifElse) /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2018 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isPredOrFunc = __webpack_require__(16) var predOrFunc = __webpack_require__(20) // implies :: (a -> Boolean) | Pred -> (a -> Boolean) -> a -> Boolean function implies(p, q) { if(!(isPredOrFunc(p) && isPredOrFunc(q))) { throw new TypeError( 'implies: Preds or predicate functions required for first two arguments' ) } return function (x) { return !predOrFunc(p, x) || !!predOrFunc(q, x); } } module.exports = curry(implies) /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isPredOrFunc = __webpack_require__(16) var predOrFunc = __webpack_require__(20) // not : (a -> Boolean) | Pred -> a -> Boolean function not(pred, x) { if(!isPredOrFunc(pred)) { throw new TypeError( 'not: Pred or predicate function required for first argument' ) } return !predOrFunc(pred, x) } module.exports = curry(not) /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isPredOrFunc = __webpack_require__(16) var predOrFunc = __webpack_require__(20) // or : (a -> Boolean) | Pred -> (a -> Boolean) | Pred -> a -> Boolean function or(f, g) { if(!(isPredOrFunc(f) && isPredOrFunc(g))) { throw new TypeError( 'or: Preds or predicate functions required for first two arguments' ) } return function (x) { return !!(predOrFunc(f, x) || predOrFunc(g, x)); } } module.exports = curry(or) /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isPredOrFunc = __webpack_require__(16) var isFunction = __webpack_require__(4) var predOrFunc = __webpack_require__(20) // unless : (a -> Boolean) | Pred -> (a -> b) -> a | b function unless(pred, f) { if(!isPredOrFunc(pred)) { throw new TypeError( 'unless: Pred or predicate function required for first argument' ) } if(!isFunction(f)) { throw new TypeError( 'unless: Function required for second argument' ) } return function (x) { return !predOrFunc(pred, x) ? f(x) : x; } } module.exports = curry(unless) /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var predOrFunc = __webpack_require__(20) var isPredOrFunc = __webpack_require__(16) var isFunction = __webpack_require__(4) // when : (a -> Boolean) | Pred -> (a -> b) -> a -> b | a function when(pred, f) { if(!isPredOrFunc(pred)) { throw new TypeError( 'when: Pred or predicate function required for first argument' ) } if(!isFunction(f)) { throw new TypeError( 'when: Function required for second argument' ) } return function (x) { return predOrFunc(pred, x) ? f(x) : x; } } module.exports = curry(when) /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { hasProp: __webpack_require__(28), hasProps: __webpack_require__(42), hasPropPath: __webpack_require__(44), isAlt: __webpack_require__(46), isAlternative: __webpack_require__(49), isApplicative: __webpack_require__(53), isApply: __webpack_require__(54), isArray: __webpack_require__(55), isBifunctor: __webpack_require__(56), isBichain: __webpack_require__(58), isBoolean: __webpack_require__(60), isCategory: __webpack_require__(61), isChain: __webpack_require__(63), isContravariant: __webpack_require__(65), isDate: __webpack_require__(67), isDefined: __webpack_require__(69), isEmpty: __webpack_require__(70), isExtend: __webpack_require__(71), isFalse: __webpack_require__(73), isFalsy: __webpack_require__(74), isFoldable: __webpack_require__(75), isFunction: __webpack_require__(76), isFunctor: __webpack_require__(77), isInteger: __webpack_require__(78), isIterable: __webpack_require__(79), isMap: __webpack_require__(81), isMonad: __webpack_require__(83), isMonoid: __webpack_require__(85), isNil: __webpack_require__(86), isNumber: __webpack_require__(87), isObject: __webpack_require__(88), isPlus: __webpack_require__(89), isProfunctor: __webpack_require__(90), isPromise: __webpack_require__(92), isSame: __webpack_require__(94), isSameType: __webpack_require__(95), isSemigroup: __webpack_require__(96), isSemigroupoid: __webpack_require__(97), isSetoid: __webpack_require__(98), isString: __webpack_require__(99), isSymbol: __webpack_require__(100), isTraversable: __webpack_require__(102), isTrue: __webpack_require__(103), isTruthy: __webpack_require__(104), pathEq: __webpack_require__(105), pathSatisfies: __webpack_require__(106), propEq: __webpack_require__(107), propPathEq: __webpack_require__(108), propSatisfies: __webpack_require__(109), propPathSatisfies: __webpack_require__(110) } /***/ }), /* 28 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isDefined = __webpack_require__(29) var isEmpty = __webpack_require__(30) var isInteger = __webpack_require__(39) var isNil = __webpack_require__(41) var isString = __webpack_require__(36) // hasProp : (String | Integer) -> a -> Boolean function hasProp(key, x) { if(!(isString(key) && !isEmpty(key) || isInteger(key))) { throw new TypeError( 'hasProp: Non-empty String or Integer required for first argument' ) } if(isNil(x)) { return false } return isDefined(x[key]) } module.exports = curry(hasProp) /***/ }), /* 29 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ function isDefined(x) { return x !== undefined } module.exports = isDefined /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isObject = __webpack_require__(31) var isMonoid = __webpack_require__(32) var equals = __webpack_require__(37) var fl = __webpack_require__(34) function isEmpty(x) { if(isMonoid(x)) { var empty = x.constructor[fl['empty']] || x.constructor['empty'] || x['empty'] return equals(x, empty()) } if(isObject(x)) { return !Object.keys(x).length } if(x && x.length !== undefined) { return !x.length } return true } module.exports = isEmpty /***/ }), /* 31 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var toString = Object.prototype.toString // isObject : a -> Boolean function isObject(x) { return !!x && toString.call(x) === '[object Object]' } module.exports = isObject /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isSemigroup = __webpack_require__(35) // isMonoid :: a -> Boolean function isMonoid(m) { return isSemigroup(m) && (hasAlg('empty', m) || hasAlg('empty', m.constructor)) } module.exports = isMonoid /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isFunction = __webpack_require__(4) var fl = __webpack_require__(34) var check = function (alg, m) { return isFunction(m[fl[alg]]) || isFunction(m[alg]); } var checkImpl = function (alg, m) { return isFunction(m['@@implements']) && !!m['@@implements'](alg); } var hasAlg = function (alg, m) { return !!m && (check(alg, m) || checkImpl(alg, m)); } module.exports = hasAlg /***/ }), /* 34 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2018 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = { alt: 'fantasy-land/alt', bimap: 'fantasy-land/bimap', chain: 'fantasy-land/chain', compose: 'fantasy-land/compose', concat: 'fantasy-land/concat', contramap: 'fantasy-land/contramap', empty: 'fantasy-land/empty', equals: 'fantasy-land/equals', extend: 'fantasy-land/extend', filter: 'fantasy-land/filter', id: 'fantasy-land/id', map: 'fantasy-land/map', of: 'fantasy-land/of', promap: 'fantasy-land/promap', reduce: 'fantasy-land/reduce', zero: 'fantasy-land/zero' } /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isString = __webpack_require__(36) var hasAlg = __webpack_require__(33) // isSemigroup : a -> Boolean function isSemigroup(m) { return isString(m) || !!m && hasAlg('concat', m) } module.exports = isSemigroup /***/ }), /* 36 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ // isString : a -> Boolean function isString(x) { return typeof x === 'string' } module.exports = isString /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isSameType = __webpack_require__(18) var isSame = __webpack_require__(38) var hasAlg = __webpack_require__(33) var type = __webpack_require__(19) var fl = __webpack_require__(34) var comp = function (a, b) { return a.valueOf() === b.valueOf(); } var strats = { 'Array': function (a, b) { return a.length === b.length && deepEquals(a, b); }, 'Date': function (a, b) { return isSame(a.valueOf(), b.valueOf()); }, 'Error': function (a, b) { return a.name === b.name && a.message === b.message; }, 'Object': function (a, b) { return Object.keys(a).length === Object.keys(b).length && deepEquals(a, b); }, 'RegExp': function (a, b) { return a.source === b.source && a.ignoreCase === b.ignoreCase && a.global === b.global && a.multiline === b.multiline && a.unicode === b.unicode; } } function deepEquals(a, b) { for(var key in a) { if(!equals(a[key], b[key])) { return false } } return true } function equals(a, b) { if(isSame(a, b)) { return true } if(!isSameType(a, b)) { return false } if(hasAlg('equals', a)) { return (b[fl.equals] || b.equals).call(b, a) } return (strats[type(a)] || comp)(a, b) } module.exports = equals /***/ }), /* 38 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ // isSame : (a, b) -> Boolean function isSame(x, y) { if(x === y) { return x !== 0 || 1 / x === 1 / y } return x !== x && y !== y } module.exports = isSame /***/ }), /* 39 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isNumber = __webpack_require__(40) // isInteger : a -> Boolean function isInteger(x) { return isNumber(x) && isFinite(x) && Math.floor(x) === x } module.exports = isInteger /***/ }), /* 40 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ // isNumber : a -> Boolean function isNumber(x) { return typeof x === 'number' && !isNaN(x) } module.exports = isNumber /***/ }), /* 41 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ /* eslint eqeqeq: "off" */ // isNil : a -> Boolean function isNil(x) { return x == null || x !== x } module.exports = isNil /***/ }), /* 42 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2019 original and current authors */ /** @author Dale Francis (dalefrancis88) */ var curry = __webpack_require__(3) var isDefined = __webpack_require__(29) var isEmpty = __webpack_require__(30) var isFoldable = __webpack_require__(43) var isInteger = __webpack_require__(39) var isNil = __webpack_require__(41) var isString = __webpack_require__(36) // err :: String var err = 'hasProps: First argument must be a Foldable of Non-empty Strings or Integers' // isKeyValid :: a -> Boolean var isKeyValid = function (key) { return isString(key) && !isEmpty(key) || isInteger(key); } // hasKey :: a -> (String | Integer) -> Boolean var hasKey = function (obj) { return function (key) { if(!isKeyValid(key)) { throw new TypeError(err) } return isDefined(obj[key]) }; } // every :: (a -> Boolean) -> ((Null | Boolean), a) -> Boolean var every = function (fn) { return function (acc, x) { return (acc === null ? true : acc) && fn(x); }; } // hasProps :: Foldable f => f (String | Integer) -> a -> Boolean function hasProps(keys, x) { if(!isFoldable(keys)) { throw new TypeError(err) } if(isNil(x)) { return false } var result = keys.reduce( every(hasKey(x)), null ) return result === null || result } module.exports = curry(hasProps) /***/ }), /* 43 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) // isFoldable : a -> Boolean function isFoldable(m) { return !!m && hasAlg('reduce', m) } module.exports = isFoldable /***/ }), /* 44 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = __webpack_require__(3) var isArray = __webpack_require__(45) var isDefined = __webpack_require__(29) var isEmpty = __webpack_require__(30) var isInteger = __webpack_require__(39) var isNil = __webpack_require__(41) var isString = __webpack_require__(36) // hasPropPath : [ String | Integer ] -> a -> Boolean function hasPropPath(keys, target) { if(!isArray(keys)) { throw new TypeError( 'hasPropPath: Array of Non-empty Strings or Integers required for first argument' ) } if(isNil(target)) { return false } var value = target for(var i = 0; i < keys.length; i++) { var key = keys[i] if(!(isString(key) && !isEmpty(key) || isInteger(key))) { throw new TypeError( 'hasPropPath: Array of Non-empty Strings or Integers required for first argument' ) } if(isNil(value)) { return false } value = value[key] if(!isDefined(value)) { return false } } return true } module.exports = curry(hasPropPath) /***/ }), /* 45 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ function isArray(x) { return Array.isArray(x) } module.exports = isArray /***/ }), /* 46 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(47) /***/ }), /* 47 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isFunctor = __webpack_require__(48) // isAlt : a -> Boolean function isAlt(m) { return isFunctor(m) && hasAlg('alt', m) } module.exports = isAlt /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) // isFunctor : a -> Boolean function isFunctor(m) { return !!m && hasAlg('map', m) } module.exports = isFunctor /***/ }), /* 49 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isApplicative = __webpack_require__(50) var isPlus = __webpack_require__(52) // isAlternative : a -> Boolean function isAlternative(m) { return isPlus(m) && isApplicative(m) } module.exports = isAlternative /***/ }), /* 50 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isApply = __webpack_require__(51) // isApplicative : a -> Boolean function isApplicative(m) { return isApply(m) && (hasAlg('of', m) || hasAlg('of', m.constructor)) } module.exports = isApplicative /***/ }), /* 51 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isFunctor = __webpack_require__(48) // isApply : a -> Boolean function isApply(m) { return isFunctor(m) && hasAlg('ap', m) } module.exports = isApply /***/ }), /* 52 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isAlt = __webpack_require__(47) // isPlus : a -> Boolean function isPlus(m) { return isAlt(m) && (hasAlg('zero', m) || hasAlg('zero', m.constructor)) } module.exports = isPlus /***/ }), /* 53 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(50) /***/ }), /* 54 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(51) /***/ }), /* 55 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(45) /***/ }), /* 56 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(57) /***/ }), /* 57 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isFunctor = __webpack_require__(48) // isBifunctor : a -> Boolean function isBifunctor(m) { return isFunctor(m) && hasAlg('bimap', m) } module.exports = isBifunctor /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2019 original and current authors */ /** @author Dale Francis (dalefrancis88) */ module.exports = __webpack_require__(59) /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2019 original and current authors */ /** @author Dale Francis (dalefrancis88) */ var hasAlg = __webpack_require__(33) // isBichain : a -> Boolean function isBichain(m) { return hasAlg('bichain', m) } module.exports = isBichain /***/ }), /* 60 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ // isBoolean : a -> Boolean function isBoolean(x) { return typeof x === 'boolean' } module.exports = isBoolean /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isSemigroupoid = __webpack_require__(62) // isCategory : a -> Boolean function isCategory(m) { return isSemigroupoid(m) && (hasAlg('id', m) || hasAlg('id', m.constructor)) } module.exports = isCategory /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) // isSemigroupoid : a -> Boolean function isSemigroupoid(m) { return !!m && hasAlg('compose', m) } module.exports = isSemigroupoid /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(64) /***/ }), /* 64 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isApply = __webpack_require__(51) // isChain : a -> Boolean function isChain(m) { return isApply(m) && hasAlg('chain', m) } module.exports = isChain /***/ }), /* 65 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(66) /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) // isContravariant : a -> Boolean function isContravariant(m) { return !!m && hasAlg('contramap', m) } module.exports = isContravariant /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2018 original and current authors */ /** @author Dale Francis (dalefrancis88) */ module.exports = __webpack_require__(68) /***/ }), /* 68 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2018 original and current authors */ /** @author Dale Francis (dalefrancis88) */ // isDate : a -> Boolean function isDate(x) { return Object.prototype.toString.apply(x) === '[object Date]' && !isNaN(x.valueOf()) } module.exports = isDate /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(29) /***/ }), /* 70 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(30) /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(72) /***/ }), /* 72 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2016 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isFunctor = __webpack_require__(48) // isExtend : a -> Boolean function isExtend(m) { return isFunctor(m) && hasAlg('extend', m) } module.exports = isExtend /***/ }), /* 73 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2019 original and current authors */ /** @author Dale Francis (dalefrancis88) */ // isFalse : a -> Boolean function isFalse(x) { return x === false } module.exports = isFalse /***/ }), /* 74 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2019 original and current authors */ /** @author Dale Francis (dalefrancis88) */ // isFalsy : a -> Boolean function isFalsy(x) { return !x } module.exports = isFalsy /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(43) /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(4) /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(48) /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(39) /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2018 original and current authors */ /** @author Dale Francis (dalefrancis88) */ module.exports = __webpack_require__(80) /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2018 original and current authors */ /** @author Dale Francis (dalefrancis88) */ var isFunction = __webpack_require__(4) var isNil = __webpack_require__(41) function isIterable(iterable) { return !isNil(iterable) && isFunction(iterable[Symbol.iterator]) } module.exports = isIterable /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2019 original and current authors */ /** @author Benny Powers (bennypowers) */ module.exports = __webpack_require__(82) /***/ }), /* 82 */ /***/ (function(module, exports) { /** @license ISC License (c) copyright 2019 original and current authors */ /** @author Benny Powers (bennypowers) */ function isMap(x) { return x instanceof Map } module.exports = isMap /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(84) /***/ }), /* 84 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isApplicative = __webpack_require__(50) // isMonad : a -> Boolean function isMonad(m) { return isApplicative(m) && hasAlg('chain', m) } module.exports = isMonad /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(32) /***/ }), /* 86 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(41) /***/ }), /* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(40) /***/ }), /* 88 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(31) /***/ }), /* 89 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(52) /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ module.exports = __webpack_require__(91) /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var hasAlg = __webpack_require__(33) var isContravariant = __webpack_require__(66) var isFunctor = __webpack_require__(48) // isProfunctor :: a -> Boolean function isProfunctor(m) { return isContravariant(m) && isFunctor(m) && hasAlg('promap', m) } module.exports = isProfunctor /***/ }), /* 92 */ /***/ (function(module, exports, __webpack_require__) { /** @license ISC License (c) copyright 2017 original and current authors */ /** @autho