From cf711e9ecba8b7899423bb09c1b90818c24b1699 Mon Sep 17 00:00:00 2001 From: Quildreen Motta Date: Wed, 3 May 2017 00:46:20 -0300 Subject: [PATCH] (docs -) Move published docs to gh-pages --- .gitignore | 1 + ...ktale.data.future._deferred.prototype.html | 37 -- ...e.data.future._executionstate.inspect.html | 26 - ...executionstate.variants.0.constructor.html | 28 - ...executionstate.variants.0.hasinstance.html | 30 - ...nts.0.prototype.cancelled.constructor.html | 28 - ...nts.0.prototype.cancelled.hasinstance.html | 30 - ...celled.prototype.rejected.constructor.html | 28 - ...celled.prototype.rejected.hasinstance.html | 30 - ...jected.prototype.resolved.constructor.html | 28 - ...jected.prototype.resolved.hasinstance.html | 30 - ...otype.rejected.prototype.resolved.tag.html | 28 - ...type.rejected.prototype.resolved.type.html | 28 - ...type.cancelled.prototype.rejected.tag.html | 28 - ...ype.cancelled.prototype.rejected.type.html | 28 - ...te.variants.0.prototype.cancelled.tag.html | 28 - ...e.variants.0.prototype.cancelled.type.html | 28 - ...iants.0.prototype.fantasy-land-equals.html | 29 - ...tate.variants.0.prototype.hasinstance.html | 29 - ...future._executionstate.variants.0.tag.html | 28 - ...uture._executionstate.variants.0.type.html | 28 - ....data.future._executionstate.variants.html | 31 - ...dule-.folktale.data.future._future.ap.html | 29 - ...e.data.future._future.fantasy-land-ap.html | 29 - ...e.data.future._future.fantasy-land-of.html | 30 - ...._future.prototype.fantasy-land-bimap.html | 30 - ...._future.prototype.fantasy-land-chain.html | 30 - ...re._future.prototype.fantasy-land-map.html | 29 - ...olktale.data.future._future.prototype.html | 45 -- ...-module-.folktale.data.maybe.fromjson.html | 57 -- ...dule-.folktale.data.maybe.hasinstance.html | 38 -- ....folktale.data.maybe.just.constructor.html | 28 - ....folktale.data.maybe.just.hasinstance.html | 42 -- ...tale.data.maybe.just.prototype.equals.html | 46 -- ...ale.data.maybe.just.prototype.inspect.html | 28 - ...tale.data.maybe.just.prototype.isjust.html | 33 - ...e.data.maybe.just.prototype.matchwith.html | 44 -- ...tale.data.maybe.just.prototype.tojson.html | 48 -- ...just.prototype.variants.0.constructor.html | 28 - ...just.prototype.variants.0.hasinstance.html | 39 -- ...prototype.variants.0.prototype.equals.html | 46 -- ...rototype.variants.0.prototype.inspect.html | 28 - ...totype.variants.0.prototype.isnothing.html | 33 - ...totype.variants.0.prototype.matchwith.html | 44 -- ...prototype.variants.0.prototype.tojson.html | 48 -- ...a.maybe.just.prototype.variants.0.tag.html | 28 - ....maybe.just.prototype.variants.0.type.html | 28 - ...le.data.maybe.just.prototype.variants.html | 29 - ...-module-.folktale.data.maybe.just.tag.html | 28 - ...module-.folktale.data.maybe.just.type.html | 28 - ...olktale.data.result.error.constructor.html | 28 - ...olktale.data.result.error.hasinstance.html | 42 -- ...le.data.result.error.prototype.equals.html | 46 -- ...e.data.result.error.prototype.inspect.html | 28 - ...e.data.result.error.prototype.iserror.html | 33 - ...data.result.error.prototype.matchwith.html | 44 -- ...le.data.result.error.prototype.tojson.html | 51 -- ...rror.prototype.variants.1.constructor.html | 28 - ...rror.prototype.variants.1.hasinstance.html | 42 -- ...prototype.variants.1.prototype.equals.html | 46 -- ...rototype.variants.1.prototype.inspect.html | 28 - ...r.prototype.variants.1.prototype.isok.html | 33 - ...totype.variants.1.prototype.matchwith.html | 44 -- ...prototype.variants.1.prototype.tojson.html | 51 -- ...result.error.prototype.variants.1.tag.html | 28 - ...esult.error.prototype.variants.1.type.html | 28 - ....data.result.error.prototype.variants.html | 29 - ...odule-.folktale.data.result.error.tag.html | 28 - ...dule-.folktale.data.result.error.type.html | 28 - ...module-.folktale.data.result.fromjson.html | 57 -- ...ule-.folktale.data.result.hasinstance.html | 41 -- ...e-.folktale.data.task._task.prototype.html | 46 -- ....task._taskexecution.prototype.cancel.html | 49 -- ....task._taskexecution.prototype.future.html | 39 -- ...le.data.task._taskexecution.prototype.html | 34 - ....task._taskexecution.prototype.listen.html | 47 -- ...task._taskexecution.prototype.promise.html | 50 -- ...e.data.validation.failure.constructor.html | 28 - ...e.data.validation.failure.hasinstance.html | 42 -- ...a.validation.failure.prototype.equals.html | 47 -- ...failure.prototype.fantasy-land-concat.html | 29 - ....validation.failure.prototype.inspect.html | 28 - ...alidation.failure.prototype.isfailure.html | 33 - ...alidation.failure.prototype.matchwith.html | 44 -- ...a.validation.failure.prototype.tojson.html | 48 -- ...lure.prototype.variants.1.constructor.html | 28 - ...lure.prototype.variants.1.hasinstance.html | 42 -- ...prototype.variants.1.prototype.equals.html | 47 -- ...rototype.variants.1.prototype.inspect.html | 28 - ...totype.variants.1.prototype.issuccess.html | 33 - ...totype.variants.1.prototype.matchwith.html | 44 -- ...prototype.variants.1.prototype.tojson.html | 48 -- ...tion.failure.prototype.variants.1.tag.html | 28 - ...ion.failure.prototype.variants.1.type.html | 28 - ...validation.failure.prototype.variants.html | 29 - ....folktale.data.validation.failure.tag.html | 28 - ...folktale.data.validation.failure.type.html | 28 - ...le-.folktale.data.validation.fromjson.html | 57 -- ....folktale.data.validation.hasinstance.html | 41 -- docs/api/en/folktale.core.adt.data.adt.html | 40 -- .../folktale.core.adt.data.constructor.html | 28 - docs/api/en/folktale.core.adt.data.data.html | 469 ------------- .../api/en/folktale.core.adt.data.derive.html | 44 -- .../en/folktale.core.adt.data.prototype.html | 64 -- ...ug-representation.debugrepresentation.html | 115 ---- ...ore.adt.derivations.equality.equality.html | 351 ---------- .../api/en/folktale.core.adt.derivations.html | 33 - ...rivations.serialization.serialization.html | 177 ----- docs/api/en/folktale.core.adt.html | 87 --- ...olktale.core.fantasy-land.apply.apply.html | 33 - ...ktale.core.fantasy-land.apply.curried.html | 28 - ...olktale.core.fantasy-land.apply.infix.html | 30 - ...olktale.core.fantasy-land.bimap.bimap.html | 33 - ...ktale.core.fantasy-land.bimap.curried.html | 30 - ...olktale.core.fantasy-land.bimap.infix.html | 30 - ...olktale.core.fantasy-land.chain.chain.html | 33 - ...ktale.core.fantasy-land.concat.concat.html | 33 - .../folktale.core.fantasy-land.curried.html | 43 -- ...olktale.core.fantasy-land.empty.empty.html | 35 - ...ktale.core.fantasy-land.equals.equals.html | 33 - docs/api/en/folktale.core.fantasy-land.html | 50 -- .../en/folktale.core.fantasy-land.infix.html | 45 -- .../folktale.core.fantasy-land.map.map.html | 33 - ...folktale.core.fantasy-land.of.curried.html | 28 - .../folktale.core.fantasy-land.of.infix.html | 30 - .../en/folktale.core.fantasy-land.of.of.html | 35 - docs/api/en/folktale.core.html | 68 -- .../en/folktale.core.lambda.compose.all.html | 48 -- .../folktale.core.lambda.compose.compose.html | 40 -- .../folktale.core.lambda.compose.infix.html | 36 - ...olktale.core.lambda.constant.constant.html | 63 -- .../en/folktale.core.lambda.curry.curry.html | 285 -------- docs/api/en/folktale.core.lambda.html | 99 --- ...olktale.core.lambda.identity.identity.html | 50 -- .../folktale.core.lambda.partialize.hole.html | 26 - ...ale.core.lambda.partialize.partialize.html | 169 ----- ...tale.core.object.from-pairs.frompairs.html | 53 -- docs/api/en/folktale.core.object.html | 74 --- ...le.core.object.map-entries.mapentries.html | 75 --- ...ale.core.object.map-entries.overwrite.html | 39 -- ...lktale.core.object.map-entries.unique.html | 37 -- ...folktale.core.object.map-values.infix.html | 36 - ...tale.core.object.map-values.mapvalues.html | 53 -- ...folktale.core.object.to-pairs.topairs.html | 66 -- .../folktale.core.object.values.values.html | 66 -- docs/api/en/folktale.data.conversions.html | 58 -- ...ersions.maybe-to-result.maybetoresult.html | 43 -- ...maybe-to-validation.maybetovalidation.html | 43 -- ...sions.nodeback-to-task.nodebacktotask.html | 43 -- ...ons.nullable-to-maybe.nullabletomaybe.html | 42 -- ...s.nullable-to-result.nullabletoresult.html | 40 -- ...le-to-validation.nullabletovalidation.html | 45 -- ...ersions.result-to-maybe.resulttomaybe.html | 43 -- ...sult-to-validation.resulttovalidation.html | 41 -- ...validation-to-maybe.validationtomaybe.html | 43 -- ...lidation-to-result.validationtoresult.html | 41 -- ...ktale.data.future._deferred._deferred.html | 41 -- ...tale.data.future._deferred._listeners.html | 28 - ...folktale.data.future._deferred._state.html | 28 - ...folktale.data.future._deferred.cancel.html | 29 - ...folktale.data.future._deferred.future.html | 35 - ...olktale.data.future._deferred.inspect.html | 28 - ...folktale.data.future._deferred.listen.html | 34 - ...ale.data.future._deferred.maybecancel.html | 31 - ...olktale.data.future._deferred.promise.html | 34 - ...folktale.data.future._deferred.reject.html | 29 - ...olktale.data.future._deferred.resolve.html | 29 - ...lktale.data.future._deferred.tostring.html | 31 - ...lktale.data.future._execution-state.0.html | 44 -- ...ture._execution-state._executionstate.html | 59 -- ...ata.future._execution-state.cancelled.html | 44 -- ....data.future._execution-state.inspect.html | 26 - ...data.future._execution-state.rejected.html | 44 -- ...data.future._execution-state.resolved.html | 44 -- .../folktale.data.future._future._future.html | 252 ------- ...lktale.data.future._future._listeners.html | 28 - .../folktale.data.future._future._state.html | 28 - .../folktale.data.future._future.apply.html | 45 -- .../folktale.data.future._future.bimap.html | 49 -- .../folktale.data.future._future.chain.html | 56 -- .../folktale.data.future._future.inspect.html | 28 - .../folktale.data.future._future.listen.html | 44 -- .../en/folktale.data.future._future.map.html | 39 -- ...ktale.data.future._future.maprejected.html | 40 -- .../en/folktale.data.future._future.of.html | 38 -- .../folktale.data.future._future.recover.html | 56 -- ...folktale.data.future._future.rejected.html | 37 -- .../en/folktale.data.future._future.swap.html | 46 -- ...folktale.data.future._future.tostring.html | 31 - ...ale.data.future._future.willmatchwith.html | 67 -- docs/api/en/folktale.data.future.html | 47 -- docs/api/en/folktale.data.html | 45 -- .../en/folktale.data.maybe.fromnullable.html | 40 -- .../en/folktale.data.maybe.fromresult.html | 39 -- .../folktale.data.maybe.fromvalidation.html | 39 -- docs/api/en/folktale.data.maybe.html | 331 ---------- docs/api/en/folktale.data.maybe.maybe.0.html | 74 --- .../en/folktale.data.maybe.maybe.apply.html | 58 -- .../en/folktale.data.maybe.maybe.cata.html | 65 -- .../en/folktale.data.maybe.maybe.chain.html | 64 -- .../en/folktale.data.maybe.maybe.fold.html | 55 -- .../api/en/folktale.data.maybe.maybe.get.html | 33 - .../folktale.data.maybe.maybe.getorelse.html | 44 -- .../en/folktale.data.maybe.maybe.inspect.html | 26 - .../en/folktale.data.maybe.maybe.just.html | 82 --- .../api/en/folktale.data.maybe.maybe.map.html | 73 -- docs/api/en/folktale.data.maybe.maybe.of.html | 35 - .../en/folktale.data.maybe.maybe.orelse.html | 66 -- .../folktale.data.maybe.maybe.toresult.html | 38 -- ...olktale.data.maybe.maybe.tovalidation.html | 38 -- .../folktale.data.maybe.maybe.unsafeget.html | 58 -- .../en/folktale.data.maybe.maybe.value.html | 38 -- .../en/folktale.data.result.frommaybe.html | 38 -- .../en/folktale.data.result.fromnullable.html | 42 -- .../folktale.data.result.fromvalidation.html | 40 -- docs/api/en/folktale.data.result.html | 604 ----------------- .../api/en/folktale.data.result.result.1.html | 87 --- .../en/folktale.data.result.result.apply.html | 64 -- .../en/folktale.data.result.result.bimap.html | 57 -- .../en/folktale.data.result.result.chain.html | 62 -- .../en/folktale.data.result.result.error.html | 87 --- .../en/folktale.data.result.result.fold.html | 53 -- .../en/folktale.data.result.result.get.html | 33 - ...folktale.data.result.result.getorelse.html | 47 -- .../folktale.data.result.result.inspect.html | 26 - .../en/folktale.data.result.result.map.html | 56 -- .../folktale.data.result.result.maperror.html | 51 -- .../en/folktale.data.result.result.merge.html | 37 -- .../en/folktale.data.result.result.of.html | 34 - .../folktale.data.result.result.orelse.html | 55 -- .../en/folktale.data.result.result.swap.html | 49 -- .../folktale.data.result.result.tomaybe.html | 38 -- ...ktale.data.result.result.tovalidation.html | 40 -- ...folktale.data.result.result.unsafeget.html | 60 -- .../en/folktale.data.result.result.value.html | 38 -- docs/api/en/folktale.data.result.try.try.html | 53 -- ...a.task._task-execution._taskexecution.html | 69 -- .../en/folktale.data.task._task._task.html | 394 ----------- docs/api/en/folktale.data.task._task.and.html | 96 --- .../en/folktale.data.task._task.apply.html | 47 -- .../en/folktale.data.task._task.bimap.html | 59 -- .../en/folktale.data.task._task.chain.html | 70 -- docs/api/en/folktale.data.task._task.map.html | 55 -- .../folktale.data.task._task.maprejected.html | 55 -- docs/api/en/folktale.data.task._task.of.html | 35 - docs/api/en/folktale.data.task._task.or.html | 93 --- .../en/folktale.data.task._task.orelse.html | 65 -- .../en/folktale.data.task._task.rejected.html | 39 -- docs/api/en/folktale.data.task._task.run.html | 71 -- .../api/en/folktale.data.task._task.swap.html | 52 -- ...olktale.data.task._task.willmatchwith.html | 77 --- .../en/folktale.data.task.fromnodeback.html | 41 -- docs/api/en/folktale.data.task.html | 310 --------- docs/api/en/folktale.data.task.task.task.html | 94 --- .../folktale.data.task.wait-all.waitall.html | 56 -- .../folktale.data.task.wait-any.waitany.html | 56 -- ...ktale.data.validation.collect.collect.html | 53 -- .../folktale.data.validation.frommaybe.html | 38 -- ...folktale.data.validation.fromnullable.html | 40 -- .../folktale.data.validation.fromresult.html | 38 -- docs/api/en/folktale.data.validation.html | 354 ---------- ...folktale.data.validation.validation.1.html | 74 --- ...tale.data.validation.validation.apply.html | 57 -- ...tale.data.validation.validation.bimap.html | 53 -- ...ale.data.validation.validation.concat.html | 60 -- ...le.data.validation.validation.failure.html | 74 --- ...ktale.data.validation.validation.fold.html | 53 -- ...lktale.data.validation.validation.get.html | 33 - ....data.validation.validation.getorelse.html | 45 -- ...le.data.validation.validation.inspect.html | 26 - ...lktale.data.validation.validation.map.html | 49 -- ...data.validation.validation.mapfailure.html | 50 -- ...tale.data.validation.validation.merge.html | 37 -- ...olktale.data.validation.validation.of.html | 34 - ...ale.data.validation.validation.orelse.html | 51 -- ...ktale.data.validation.validation.swap.html | 45 -- ...le.data.validation.validation.tomaybe.html | 38 -- ...e.data.validation.validation.toresult.html | 39 -- ....data.validation.validation.unsafeget.html | 60 -- ...tale.data.validation.validation.value.html | 38 -- docs/api/en/folktale.html | 48 -- ...use-folktale-with-flow-or-typescript-.html | 33 - docs/api/en/guides.coding-style.html | 54 -- docs/api/en/guides.contributing-code.html | 89 --- ...des.design-principles-behind-folktale.html | 135 ---- .../guides.development-tasks-and-tooling.html | 51 -- ...le-structures-implement-fantasy-land-.html | 364 ---------- .../en/guides.frequently-asked-questions.html | 32 - docs/api/en/guides.git-commit-guidelines.html | 94 --- ...ow-stable-are-the-folktale-libraries-.html | 39 -- ...es.improving-folktale-s-documentation.html | 42 -- .../en/guides.improving-folktale-s-tests.html | 88 --- docs/api/en/guides.installing-folktale.html | 146 ---- ...es.navigating-the-folktale-repository.html | 173 ----- .../guides.navigating-the-issue-tracker.html | 63 -- docs/api/en/guides.reporting-bugs.html | 122 ---- .../en/guides.requesting-new-features.html | 89 --- ....setting-up-a-development-environment.html | 86 --- ...ides.type-notation-used-in-signatures.html | 359 ---------- ...des.when-will-folktale-2-be-released-.html | 26 - ...-saying----apply--is-not-a-function--.html | 75 --- ...-is-there-no---chain--for-validation-.html | 65 -- docs/api/en/prism.css | 139 ---- docs/api/en/prism.js | 120 ---- docs/api/en/style.css | 624 ------------------ 305 files changed, 1 insertion(+), 18402 deletions(-) delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._deferred.prototype.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.inspect.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.fantasy-land-equals.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._future.ap.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._future.fantasy-land-ap.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._future.fantasy-land-of.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-bimap.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-chain.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-map.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.future._future.prototype.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.fromjson.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.equals.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.inspect.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.isjust.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.matchwith.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.tojson.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.equals.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.inspect.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.isnothing.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.matchwith.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.tojson.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.maybe.just.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.equals.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.inspect.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.iserror.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.matchwith.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.tojson.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.equals.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.inspect.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.isok.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.matchwith.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.tojson.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.error.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.fromjson.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.result.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.task._task.prototype.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.cancel.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.future.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.listen.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.promise.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.equals.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.fantasy-land-concat.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.inspect.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.isfailure.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.matchwith.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.tojson.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.constructor.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.hasinstance.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.equals.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.inspect.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.issuccess.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.matchwith.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.tojson.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.tag.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.failure.type.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.fromjson.html delete mode 100644 docs/api/en/-unknown-module-.folktale.data.validation.hasinstance.html delete mode 100644 docs/api/en/folktale.core.adt.data.adt.html delete mode 100644 docs/api/en/folktale.core.adt.data.constructor.html delete mode 100644 docs/api/en/folktale.core.adt.data.data.html delete mode 100644 docs/api/en/folktale.core.adt.data.derive.html delete mode 100644 docs/api/en/folktale.core.adt.data.prototype.html delete mode 100644 docs/api/en/folktale.core.adt.derivations.debug-representation.debugrepresentation.html delete mode 100644 docs/api/en/folktale.core.adt.derivations.equality.equality.html delete mode 100644 docs/api/en/folktale.core.adt.derivations.html delete mode 100644 docs/api/en/folktale.core.adt.derivations.serialization.serialization.html delete mode 100644 docs/api/en/folktale.core.adt.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.apply.apply.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.apply.curried.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.apply.infix.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.bimap.bimap.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.bimap.curried.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.bimap.infix.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.chain.chain.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.concat.concat.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.curried.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.empty.empty.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.equals.equals.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.infix.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.map.map.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.of.curried.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.of.infix.html delete mode 100644 docs/api/en/folktale.core.fantasy-land.of.of.html delete mode 100644 docs/api/en/folktale.core.html delete mode 100644 docs/api/en/folktale.core.lambda.compose.all.html delete mode 100644 docs/api/en/folktale.core.lambda.compose.compose.html delete mode 100644 docs/api/en/folktale.core.lambda.compose.infix.html delete mode 100644 docs/api/en/folktale.core.lambda.constant.constant.html delete mode 100644 docs/api/en/folktale.core.lambda.curry.curry.html delete mode 100644 docs/api/en/folktale.core.lambda.html delete mode 100644 docs/api/en/folktale.core.lambda.identity.identity.html delete mode 100644 docs/api/en/folktale.core.lambda.partialize.hole.html delete mode 100644 docs/api/en/folktale.core.lambda.partialize.partialize.html delete mode 100644 docs/api/en/folktale.core.object.from-pairs.frompairs.html delete mode 100644 docs/api/en/folktale.core.object.html delete mode 100644 docs/api/en/folktale.core.object.map-entries.mapentries.html delete mode 100644 docs/api/en/folktale.core.object.map-entries.overwrite.html delete mode 100644 docs/api/en/folktale.core.object.map-entries.unique.html delete mode 100644 docs/api/en/folktale.core.object.map-values.infix.html delete mode 100644 docs/api/en/folktale.core.object.map-values.mapvalues.html delete mode 100644 docs/api/en/folktale.core.object.to-pairs.topairs.html delete mode 100644 docs/api/en/folktale.core.object.values.values.html delete mode 100644 docs/api/en/folktale.data.conversions.html delete mode 100644 docs/api/en/folktale.data.conversions.maybe-to-result.maybetoresult.html delete mode 100644 docs/api/en/folktale.data.conversions.maybe-to-validation.maybetovalidation.html delete mode 100644 docs/api/en/folktale.data.conversions.nodeback-to-task.nodebacktotask.html delete mode 100644 docs/api/en/folktale.data.conversions.nullable-to-maybe.nullabletomaybe.html delete mode 100644 docs/api/en/folktale.data.conversions.nullable-to-result.nullabletoresult.html delete mode 100644 docs/api/en/folktale.data.conversions.nullable-to-validation.nullabletovalidation.html delete mode 100644 docs/api/en/folktale.data.conversions.result-to-maybe.resulttomaybe.html delete mode 100644 docs/api/en/folktale.data.conversions.result-to-validation.resulttovalidation.html delete mode 100644 docs/api/en/folktale.data.conversions.validation-to-maybe.validationtomaybe.html delete mode 100644 docs/api/en/folktale.data.conversions.validation-to-result.validationtoresult.html delete mode 100644 docs/api/en/folktale.data.future._deferred._deferred.html delete mode 100644 docs/api/en/folktale.data.future._deferred._listeners.html delete mode 100644 docs/api/en/folktale.data.future._deferred._state.html delete mode 100644 docs/api/en/folktale.data.future._deferred.cancel.html delete mode 100644 docs/api/en/folktale.data.future._deferred.future.html delete mode 100644 docs/api/en/folktale.data.future._deferred.inspect.html delete mode 100644 docs/api/en/folktale.data.future._deferred.listen.html delete mode 100644 docs/api/en/folktale.data.future._deferred.maybecancel.html delete mode 100644 docs/api/en/folktale.data.future._deferred.promise.html delete mode 100644 docs/api/en/folktale.data.future._deferred.reject.html delete mode 100644 docs/api/en/folktale.data.future._deferred.resolve.html delete mode 100644 docs/api/en/folktale.data.future._deferred.tostring.html delete mode 100644 docs/api/en/folktale.data.future._execution-state.0.html delete mode 100644 docs/api/en/folktale.data.future._execution-state._executionstate.html delete mode 100644 docs/api/en/folktale.data.future._execution-state.cancelled.html delete mode 100644 docs/api/en/folktale.data.future._execution-state.inspect.html delete mode 100644 docs/api/en/folktale.data.future._execution-state.rejected.html delete mode 100644 docs/api/en/folktale.data.future._execution-state.resolved.html delete mode 100644 docs/api/en/folktale.data.future._future._future.html delete mode 100644 docs/api/en/folktale.data.future._future._listeners.html delete mode 100644 docs/api/en/folktale.data.future._future._state.html delete mode 100644 docs/api/en/folktale.data.future._future.apply.html delete mode 100644 docs/api/en/folktale.data.future._future.bimap.html delete mode 100644 docs/api/en/folktale.data.future._future.chain.html delete mode 100644 docs/api/en/folktale.data.future._future.inspect.html delete mode 100644 docs/api/en/folktale.data.future._future.listen.html delete mode 100644 docs/api/en/folktale.data.future._future.map.html delete mode 100644 docs/api/en/folktale.data.future._future.maprejected.html delete mode 100644 docs/api/en/folktale.data.future._future.of.html delete mode 100644 docs/api/en/folktale.data.future._future.recover.html delete mode 100644 docs/api/en/folktale.data.future._future.rejected.html delete mode 100644 docs/api/en/folktale.data.future._future.swap.html delete mode 100644 docs/api/en/folktale.data.future._future.tostring.html delete mode 100644 docs/api/en/folktale.data.future._future.willmatchwith.html delete mode 100644 docs/api/en/folktale.data.future.html delete mode 100644 docs/api/en/folktale.data.html delete mode 100644 docs/api/en/folktale.data.maybe.fromnullable.html delete mode 100644 docs/api/en/folktale.data.maybe.fromresult.html delete mode 100644 docs/api/en/folktale.data.maybe.fromvalidation.html delete mode 100644 docs/api/en/folktale.data.maybe.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.0.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.apply.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.cata.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.chain.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.fold.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.get.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.getorelse.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.inspect.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.just.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.map.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.of.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.orelse.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.toresult.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.tovalidation.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.unsafeget.html delete mode 100644 docs/api/en/folktale.data.maybe.maybe.value.html delete mode 100644 docs/api/en/folktale.data.result.frommaybe.html delete mode 100644 docs/api/en/folktale.data.result.fromnullable.html delete mode 100644 docs/api/en/folktale.data.result.fromvalidation.html delete mode 100644 docs/api/en/folktale.data.result.html delete mode 100644 docs/api/en/folktale.data.result.result.1.html delete mode 100644 docs/api/en/folktale.data.result.result.apply.html delete mode 100644 docs/api/en/folktale.data.result.result.bimap.html delete mode 100644 docs/api/en/folktale.data.result.result.chain.html delete mode 100644 docs/api/en/folktale.data.result.result.error.html delete mode 100644 docs/api/en/folktale.data.result.result.fold.html delete mode 100644 docs/api/en/folktale.data.result.result.get.html delete mode 100644 docs/api/en/folktale.data.result.result.getorelse.html delete mode 100644 docs/api/en/folktale.data.result.result.inspect.html delete mode 100644 docs/api/en/folktale.data.result.result.map.html delete mode 100644 docs/api/en/folktale.data.result.result.maperror.html delete mode 100644 docs/api/en/folktale.data.result.result.merge.html delete mode 100644 docs/api/en/folktale.data.result.result.of.html delete mode 100644 docs/api/en/folktale.data.result.result.orelse.html delete mode 100644 docs/api/en/folktale.data.result.result.swap.html delete mode 100644 docs/api/en/folktale.data.result.result.tomaybe.html delete mode 100644 docs/api/en/folktale.data.result.result.tovalidation.html delete mode 100644 docs/api/en/folktale.data.result.result.unsafeget.html delete mode 100644 docs/api/en/folktale.data.result.result.value.html delete mode 100644 docs/api/en/folktale.data.result.try.try.html delete mode 100644 docs/api/en/folktale.data.task._task-execution._taskexecution.html delete mode 100644 docs/api/en/folktale.data.task._task._task.html delete mode 100644 docs/api/en/folktale.data.task._task.and.html delete mode 100644 docs/api/en/folktale.data.task._task.apply.html delete mode 100644 docs/api/en/folktale.data.task._task.bimap.html delete mode 100644 docs/api/en/folktale.data.task._task.chain.html delete mode 100644 docs/api/en/folktale.data.task._task.map.html delete mode 100644 docs/api/en/folktale.data.task._task.maprejected.html delete mode 100644 docs/api/en/folktale.data.task._task.of.html delete mode 100644 docs/api/en/folktale.data.task._task.or.html delete mode 100644 docs/api/en/folktale.data.task._task.orelse.html delete mode 100644 docs/api/en/folktale.data.task._task.rejected.html delete mode 100644 docs/api/en/folktale.data.task._task.run.html delete mode 100644 docs/api/en/folktale.data.task._task.swap.html delete mode 100644 docs/api/en/folktale.data.task._task.willmatchwith.html delete mode 100644 docs/api/en/folktale.data.task.fromnodeback.html delete mode 100644 docs/api/en/folktale.data.task.html delete mode 100644 docs/api/en/folktale.data.task.task.task.html delete mode 100644 docs/api/en/folktale.data.task.wait-all.waitall.html delete mode 100644 docs/api/en/folktale.data.task.wait-any.waitany.html delete mode 100644 docs/api/en/folktale.data.validation.collect.collect.html delete mode 100644 docs/api/en/folktale.data.validation.frommaybe.html delete mode 100644 docs/api/en/folktale.data.validation.fromnullable.html delete mode 100644 docs/api/en/folktale.data.validation.fromresult.html delete mode 100644 docs/api/en/folktale.data.validation.html delete mode 100644 docs/api/en/folktale.data.validation.validation.1.html delete mode 100644 docs/api/en/folktale.data.validation.validation.apply.html delete mode 100644 docs/api/en/folktale.data.validation.validation.bimap.html delete mode 100644 docs/api/en/folktale.data.validation.validation.concat.html delete mode 100644 docs/api/en/folktale.data.validation.validation.failure.html delete mode 100644 docs/api/en/folktale.data.validation.validation.fold.html delete mode 100644 docs/api/en/folktale.data.validation.validation.get.html delete mode 100644 docs/api/en/folktale.data.validation.validation.getorelse.html delete mode 100644 docs/api/en/folktale.data.validation.validation.inspect.html delete mode 100644 docs/api/en/folktale.data.validation.validation.map.html delete mode 100644 docs/api/en/folktale.data.validation.validation.mapfailure.html delete mode 100644 docs/api/en/folktale.data.validation.validation.merge.html delete mode 100644 docs/api/en/folktale.data.validation.validation.of.html delete mode 100644 docs/api/en/folktale.data.validation.validation.orelse.html delete mode 100644 docs/api/en/folktale.data.validation.validation.swap.html delete mode 100644 docs/api/en/folktale.data.validation.validation.tomaybe.html delete mode 100644 docs/api/en/folktale.data.validation.validation.toresult.html delete mode 100644 docs/api/en/folktale.data.validation.validation.unsafeget.html delete mode 100644 docs/api/en/folktale.data.validation.validation.value.html delete mode 100644 docs/api/en/folktale.html delete mode 100644 docs/api/en/guides.can-i-use-folktale-with-flow-or-typescript-.html delete mode 100644 docs/api/en/guides.coding-style.html delete mode 100644 docs/api/en/guides.contributing-code.html delete mode 100644 docs/api/en/guides.design-principles-behind-folktale.html delete mode 100644 docs/api/en/guides.development-tasks-and-tooling.html delete mode 100644 docs/api/en/guides.do-folktale-structures-implement-fantasy-land-.html delete mode 100644 docs/api/en/guides.frequently-asked-questions.html delete mode 100644 docs/api/en/guides.git-commit-guidelines.html delete mode 100644 docs/api/en/guides.how-stable-are-the-folktale-libraries-.html delete mode 100644 docs/api/en/guides.improving-folktale-s-documentation.html delete mode 100644 docs/api/en/guides.improving-folktale-s-tests.html delete mode 100644 docs/api/en/guides.installing-folktale.html delete mode 100644 docs/api/en/guides.navigating-the-folktale-repository.html delete mode 100644 docs/api/en/guides.navigating-the-issue-tracker.html delete mode 100644 docs/api/en/guides.reporting-bugs.html delete mode 100644 docs/api/en/guides.requesting-new-features.html delete mode 100644 docs/api/en/guides.setting-up-a-development-environment.html delete mode 100644 docs/api/en/guides.type-notation-used-in-signatures.html delete mode 100644 docs/api/en/guides.when-will-folktale-2-be-released-.html delete mode 100644 docs/api/en/guides.why-do-i-get-an-error-saying----apply--is-not-a-function--.html delete mode 100644 docs/api/en/guides.why-is-there-no---chain--for-validation-.html delete mode 100644 docs/api/en/prism.css delete mode 100644 docs/api/en/prism.js delete mode 100644 docs/api/en/style.css diff --git a/.gitignore b/.gitignore index 37b5a27..b773112 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ npm-debug.log *.swp /dist/ /docs/build/ +/docs/api/ /annotated/ /releases/ /tools/static-docs/lib/ diff --git a/docs/api/en/-unknown-module-.folktale.data.future._deferred.prototype.html b/docs/api/en/-unknown-module-.folktale.data.future._deferred.prototype.html deleted file mode 100644 index b4d401a..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._deferred.prototype.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -

(Anonymous)

A container for methods of Deferreds.

-

Documentation

A container for methods of Deferreds.

-

Properties

Data Fields

get _listeners

An array of visitors providing functions to be ran when the deferred's state changes.

-
Abstract
get _state

The current state of the deferred, as an ExecutionState.

-
Abstract

Debugging

inspect()

Returns a textual description of the object.

-
toString()

Returns a textual description of the object.

-

Extracting Values

future()

Retrieves the value of a deferred as a Future.

-
promise()

Retrieves the value of a deferred as a Promise. Cancellations are mapped to a rejected promise with a special object.

-

Reacting to Deferreds

listen(pattern)

Adds a visitor to be invoked when the deferred's state changes.

-

Resolving

cancel()

Resolves a deferred with a cancellation value.

-
maybeCancel()

Resolves a deferred with a cancellation value, but doesn't throw if the deferred has already been resolved.

-
reject(reason)

Resolves a deferred with a failure value.

-
resolve(value)

Resolves a deferred successfully with a value.

-
Authors
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.inspect.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.inspect.html deleted file mode 100644 index 86b4882..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.inspect.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - toString - - - - - -

toString

A textual representation of the state.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

toString()
() => String

Documentation

A textual representation of the state.

-

Properties

Source Code

() => typeName
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.constructor.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.constructor.html deleted file mode 100644 index 42ccfe4..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

constructor

The constructor for the variant

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get constructor()

Documentation

The constructor for the variant

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get constructor() {
-        return constructor;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.hasinstance.html deleted file mode 100644 index 831b2dc..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.hasinstance.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

True if the value is an instance of the state.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

hasInstance(value)
(Variant) => Boolean

Documentation

True if the value is an instance of the state.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
hasInstance(value) {
-        return Boolean(value) 
-        &&     adt.hasInstance(value) 
-        &&     value[TAG] === name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.constructor.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.constructor.html deleted file mode 100644 index 42ccfe4..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

constructor

The constructor for the variant

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get constructor()

Documentation

The constructor for the variant

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get constructor() {
-        return constructor;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.hasinstance.html deleted file mode 100644 index 831b2dc..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.hasinstance.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

True if the value is an instance of the state.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

hasInstance(value)
(Variant) => Boolean

Documentation

True if the value is an instance of the state.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
hasInstance(value) {
-        return Boolean(value) 
-        &&     adt.hasInstance(value) 
-        &&     value[TAG] === name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.constructor.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.constructor.html deleted file mode 100644 index 42ccfe4..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

constructor

The constructor for the variant

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get constructor()

Documentation

The constructor for the variant

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get constructor() {
-        return constructor;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.hasinstance.html deleted file mode 100644 index 831b2dc..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.hasinstance.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

True if the value is an instance of the state.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

hasInstance(value)
(Variant) => Boolean

Documentation

True if the value is an instance of the state.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
hasInstance(value) {
-        return Boolean(value) 
-        &&     adt.hasInstance(value) 
-        &&     value[TAG] === name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.constructor.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.constructor.html deleted file mode 100644 index 42ccfe4..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

constructor

The constructor for the variant

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get constructor()

Documentation

The constructor for the variant

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get constructor() {
-        return constructor;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.hasinstance.html deleted file mode 100644 index 831b2dc..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.hasinstance.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

True if the value is an instance of the state.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

hasInstance(value)
(Variant) => Boolean

Documentation

True if the value is an instance of the state.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
hasInstance(value) {
-        return Boolean(value) 
-        &&     adt.hasInstance(value) 
-        &&     value[TAG] === name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.tag.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.tag.html deleted file mode 100644 index 79782bf..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

tag

The internal tag of the variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get tag()

Documentation

The internal tag of the variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get tag() {
-        return name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.type.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.type.html deleted file mode 100644 index 5ced380..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.prototype.resolved.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

type

The internal type of the variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get type()

Documentation

The internal type of the variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get type() {
-        return typeId;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.tag.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.tag.html deleted file mode 100644 index 79782bf..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

tag

The internal tag of the variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get tag()

Documentation

The internal tag of the variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get tag() {
-        return name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.type.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.type.html deleted file mode 100644 index 5ced380..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.prototype.rejected.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

type

The internal type of the variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get type()

Documentation

The internal type of the variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get type() {
-        return typeId;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.tag.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.tag.html deleted file mode 100644 index 79782bf..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

tag

The internal tag of the variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get tag()

Documentation

The internal tag of the variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get tag() {
-        return name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.type.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.type.html deleted file mode 100644 index 5ced380..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.cancelled.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

type

The internal type of the variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get type()

Documentation

The internal type of the variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get type() {
-        return typeId;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.fantasy-land-equals.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.fantasy-land-equals.html deleted file mode 100644 index a0f0615..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.fantasy-land-equals.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - fantasy-land/equals - - - - - -

fantasy-land/equals

Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

-

Signature

fantasy-land/equals(that)
('S 'a).('S 'a) => Boolean
-where 'S is Setoid

Documentation

Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

-

Properties

Source Code

Defined in src/helpers/provide-fantasy-land-aliases.js at line 12, column 10
'fantasy-land/equals'(that) {
-      return this.equals(that);
-    }
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.hasinstance.html deleted file mode 100644 index 6502933..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.prototype.hasinstance.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

True if the value is any execution state instance.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

hasInstance(value)
ADT.(Variant) -> Boolean

Documentation

True if the value is any execution state instance.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 161, column 33
hasInstance(value) {
-      return Boolean(value)
-      &&     value[TYPE] === this[TYPE];
-    }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.tag.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.tag.html deleted file mode 100644 index 79782bf..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

tag

The internal tag of the variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get tag()

Documentation

The internal tag of the variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get tag() {
-        return name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.type.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.type.html deleted file mode 100644 index 5ced380..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.0.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

type

The internal type of the variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get type()

Documentation

The internal type of the variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get type() {
-        return typeId;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.html b/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.html deleted file mode 100644 index f004e73..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._executionstate.variants.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - variants - - - - - -

variants

The variants in the ExecutionState

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

Array Variant

Documentation

The variants in the ExecutionState

-

Properties

Variant

0: Pending()

The state of a future that's still not resolved.

-
Experimental
1: Cancelled()

The state of a future that has been cancelled.

-
Experimental
2: Resolved(value)

The state of a future that has been successfully resolved with a value.

-
Experimental
3: Rejected(reason)

The state of a future that has been resolved with a failure.

-
Experimental

(Uncategorised)

Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited

A Number.

-
Experimental
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited

Source Code

Defined in src/core/adt/data.js at line 161, column 33
values(variants)
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._future.ap.html b/docs/api/en/-unknown-module-.folktale.data.future._future.ap.html deleted file mode 100644 index 63ff4e2..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._future.ap.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - ap - - - - - -

ap

Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

-

Signature

ap(that)
('F ('a) => b).('F 'a) => 'F 'b
-where 'F is Apply

Documentation

Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

-

Properties

Source Code

Defined in src/helpers/provide-fantasy-land-aliases.js at line 60, column 9
ap(that) {
-      return this.apply(that);
-    }
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._future.fantasy-land-ap.html b/docs/api/en/-unknown-module-.folktale.data.future._future.fantasy-land-ap.html deleted file mode 100644 index 338c340..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._future.fantasy-land-ap.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - fantasy-land/ap - - - - - -

fantasy-land/ap

Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

-

Signature

fantasy-land/ap(that)
('F 'a).('F ('a) => 'b) => 'F 'b
-where 'F is Apply

Documentation

Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

-

Properties

Source Code

Defined in src/helpers/provide-fantasy-land-aliases.js at line 60, column 9
'fantasy-land/ap'(that) {
-      return that.apply(this);
-    }
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._future.fantasy-land-of.html b/docs/api/en/-unknown-module-.folktale.data.future._future.fantasy-land-of.html deleted file mode 100644 index cf0334a..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._future.fantasy-land-of.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - fantasy-land/of - - - - - -

fantasy-land/of

Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

-

Signature

fantasy-land/of(value)
forall F, a:
-  (F).(a) => F a
-where F is Applicative

Documentation

Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

-

Properties

Source Code

Defined in src/helpers/provide-fantasy-land-aliases.js at line 82, column 6
'fantasy-land/of'(value) {
-      return this.of(value);
-    }
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-bimap.html b/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-bimap.html deleted file mode 100644 index 280938b..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-bimap.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - fantasy-land/bimap - - - - - -

fantasy-land/bimap

Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

-

Signature

fantasy-land/bimap(f, g)
forall F, a, b, c, d:
-  (F a b).((a) => c, (b) => d) => F c d
-where F is Bifunctor

Documentation

Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

-

Properties

Source Code

Defined in src/helpers/provide-fantasy-land-aliases.js at line 190, column 9
'fantasy-land/bimap'(f, g) {
-      return this.bimap(f, g);
-    }
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-chain.html b/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-chain.html deleted file mode 100644 index 8a5a584..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-chain.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - fantasy-land/chain - - - - - -

fantasy-land/chain

Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

-

Signature

fantasy-land/chain(transformation)
forall M, a, b:
-  (M a).((a) => M b) => M b
-where M is Chain

Documentation

Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

-

Properties

Source Code

Defined in src/helpers/provide-fantasy-land-aliases.js at line 121, column 9
'fantasy-land/chain'(transformation) {
-      return this.chain(transformation);
-    }
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-map.html b/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-map.html deleted file mode 100644 index 814c0e7..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.fantasy-land-map.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - fantasy-land/map - - - - - -

fantasy-land/map

Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

-

Signature

fantasy-land/map(transformation)
('F 'a).(('a) => 'b) => 'F 'b
-where 'F is Functor

Documentation

Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

-

Properties

Source Code

Defined in src/helpers/provide-fantasy-land-aliases.js at line 48, column 7
'fantasy-land/map'(transformation) {
-      return this.map(transformation);
-    }
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.html b/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.html deleted file mode 100644 index 0d3b82d..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.future._future.prototype.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - -

(Anonymous)

A container for methods of Futures.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Documentation

A container for methods of Futures.

-

Properties

Debugging

inspect: value()

Returns a textual representation of the Future.

-
Experimental
toString: value()

Returns a textual representation of the Future.

-
Experimental

Fantasy Land

ap(that)

Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

-
fantasy-land/ap(that)

Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

-
fantasy-land/bimap(f, g)

Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

-
fantasy-land/chain(transformation)

Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

-
fantasy-land/map(transformation)

Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

-

Internal Fields

get _listeners

A list of visitors to be invoked when the state of the future changes.

-
Abstract
get _state

The current state of the Future.

-
Abstract

Pattern Matching

willMatchWith: value(pattern)

Limited pattern matching for futures.

-
Experimental

Reacting to Futures

listen: value(pattern)

Adds a visitor to the Future, which will be invoked when the Future's state changes.

-
Experimental

Recovering From Errors

recover: value(handler)

Transforms a failed future into a new future.

-
Experimental
swap: value()

Inverts the state of a Future: successes become failures, failures become successes.

-
Experimental

Transforming

apply: value(future)

Transforms the succesful value of a future by using a function stored in another future.

-
Experimental
bimap: value(rejectionTransformation, successTransformation)

Transforms both successful and failure values in a Future, without touching its state.

-
Experimental
chain: value(transformation)

Transforms a Future's successful value along with its state.

-
Experimental
map: value(transformation)

Transforms the successful value of a Future, without touching its state.

-
Experimental
mapRejected: value(transformation)

Transforms failure values in a Future without touching its state.

-
Experimental

Types

constructor()

Models the eventual result of asynchronous computations.

-
Experimental
Stability
experimental
Authors
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.fromjson.html b/docs/api/en/-unknown-module-.folktale.data.maybe.fromjson.html deleted file mode 100644 index ff55f6c..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.fromjson.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - fromJSON - - - - - -

fromJSON

Parses a JavaScript object previously serialised as aMaybe.toJSON() into a proper Maybe structure.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)
type JSONSerialisation = {
-  "@@type":  String,
-  "@@tag":   String,
-  "@@value": Object Any
-}
-type JSONParser = {
-  fromJSON: (JSONSerialisation, Array JSONParser) => Variant
-}
-
-(JSONSerialisation, Array JSONParser) => Variant

Documentation

Parses a JavaScript object previously serialised as aMaybe.toJSON() into a proper Maybe structure.

-

See the docs for core/adt/derivations/serialization for more details.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.fromJSON(Maybe.Just(1).toJSON());
-// ==> Maybe.Just(1)
-
-Maybe.fromJSON(Maybe.Nothing().toJSON());
-// ==> Maybe.Nothing()
-

Properties

Source Code

function(value, parsers = { [typeName]: adt }, keysIndicateType = false) {
-    const valueTypeName = value[typeJsonKey];
-    const valueTagName = value[tagJsonKey];
-    const valueContents = value[valueJsonKey];
-    assertType(typeName, valueTypeName);
-    const parsersByType = keysIndicateType ? parsers
-          : /*otherwise*/                    indexByType(values(parsers));
-
-    const parsedValue = mapValues(valueContents, parseValue(parsersByType));
-    return extend(Object.create(adt[valueTagName].prototype), parsedValue);
-  }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.maybe.hasinstance.html deleted file mode 100644 index 6a6640b..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.hasinstance.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

Tests if an arbitrary value is a Maybe instance.

-

Signature

hasInstance(value)
ADT.(Variant) -> Boolean

Documentation

Tests if an arbitrary value is a Maybe instance.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.hasInstance({ value: 1 });
-// ==> false
-
-Maybe.hasInstance(Maybe.Just(1));
-// ==> true
-

Properties

Source Code

Defined in src/core/adt/data.js at line 161, column 33
hasInstance(value) {
-      return Boolean(value)
-      &&     value[TYPE] === this[TYPE];
-    }
Stability
stable
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.constructor.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.constructor.html deleted file mode 100644 index 6be90f7..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

constructor

The constructor function for this variant.

-

Signature

get constructor()

Documentation

The constructor function for this variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get constructor() {
-        return constructor;
-      }
Stability
stable
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.hasinstance.html deleted file mode 100644 index 004dbbd..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.hasinstance.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

Tests if an arbitrary value is a Just case of a Maybe instance.

-

Signature

hasInstance(value)
(Variant) => Boolean

Documentation

Tests if an arbitrary value is a Just case of a Maybe instance.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.Just.hasInstance({ value: 1 });
-// ==> false
-
-Maybe.Just.hasInstance(Maybe.Just(1));
-// ==> true
-
-Maybe.Just.hasInstance(Maybe.Nothing());
-// ==> false
-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
hasInstance(value) {
-        return Boolean(value) 
-        &&     adt.hasInstance(value) 
-        &&     value[TAG] === name;
-      }
Stability
stable
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.equals.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.equals.html deleted file mode 100644 index 416c420..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.equals.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - equals - - - - - -

equals

Performs a deep-comparison of two Maybe values for equality. See core/adt/derivations/equality for details.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

equals(value)
forall S, a:
-  (S a).(S a) => Boolean
-where S is Setoid

Documentation

Performs a deep-comparison of two Maybe values for equality. See core/adt/derivations/equality for details.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.Just(1).equals(Maybe.Just(1));
-// ==> true
-
-Maybe.Just(1).equals(Maybe.Nothing());
-// ==> false
-
-Maybe.Nothing().equals(Maybe.Nothing());
-// ==> true
-
-Maybe.Just(Maybe.Just(1)).equals(Maybe.Just(Maybe.Just(1)));
-// ==> true
-

Properties

Source Code

function(value) {
-      assertType(adt)(`${this[tagSymbol]}#equals`, value);
-      return sameType(this, value) && compositesEqual(this, value, Object.keys(this));
-    }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.inspect.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.inspect.html deleted file mode 100644 index 2bd5a11..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.inspect.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - toString - - - - - -

toString

A textual representation for Maybe instances.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

toString()
(ADT).() => String

Documentation

A textual representation for Maybe instances.

-

Properties

Source Code

function() {
-    return `${variantName}(${plainObjectToString.call(this)})`;
-  }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.isjust.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.isjust.html deleted file mode 100644 index 1e71139..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.isjust.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - -

(Anonymous)

True if the value is a Just instance.

-
Deprecated since 2.0.0

The .isJust field is deprecated in favour of the new Just.hasInstance(value) method. -The .hasInstance() version allow safely testing any value, even non-objects, and also -do union instance checking, rather than a simple tag check;

-

Documentation

True if the value is a Just instance.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 55, column 42
get [`is${name}`]() {
-        warnDeprecation(`.is${name} is deprecated. Use ${name}.hasInstance(value)
-instead to check if a value belongs to the ADT variant.`);
-        return true;
-      }
Stability
deprecated
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.matchwith.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.matchwith.html deleted file mode 100644 index 94533ec..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.matchwith.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - matchWith - - - - - -

matchWith

Chooses and executes a function for each variant in the Maybe structure.

-

Signature

matchWith(pattern)
('a is Variant).({ 'b: (Object Any) => 'c }) => 'c
-where 'b = 'a[`@@folktale:adt:tag]

Documentation

Chooses and executes a function for each variant in the Maybe structure.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.Just(1).matchWith({
-  Nothing: () => 'nothing',
-  Just: ({ value }) => `got ${value}`
-});
-// ==> 'got 1'
-
-Maybe.Nothing().matchWith({
-  Nothing: () => 'nothing',
-  Just: ({ value }) => `got ${value}`
-});
-// ==> 'nothing'
-

Properties

Source Code

Defined in src/core/adt/data.js at line 55, column 42
matchWith(pattern) {
-        return pattern[name](this);
-      }
Stability
stable
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.tojson.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.tojson.html deleted file mode 100644 index a23ef62..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.tojson.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - toJSON - - - - - -

toJSON

Converts a Maybe value to a JavaScript object that may be stored as a JSON value.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

toJSON()
type JSONSerialisation = {
-  "@@type":  String,
-  "@@tag":   String,
-  "@@value": Object Any
-}
-
-Variant . () => JSONSerialisation

Documentation

Converts a Maybe value to a JavaScript object that may be stored as a JSON value.

-

See the docs for core/adt/derivations/serialization for more details.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.Just(1).toJSON();
-// ==> { '@@type': 'folktale:Data.Maybe', '@@tag': 'Just', '@@value': { value: 1 } }
-
-Maybe.Nothing().toJSON();
-// ==> { '@@type': 'folktale:Data.Maybe', '@@tag': 'Nothing', '@@value': {} }
-

Properties

Source Code

function() {
-    return { 
-      [typeJsonKey]:  typeName, 
-      [tagJsonKey]:   tagName, 
-      [valueJsonKey]: mapValues(this, serializeValue) 
-    };
-  }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.constructor.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.constructor.html deleted file mode 100644 index 6be90f7..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

constructor

The constructor function for this variant.

-

Signature

get constructor()

Documentation

The constructor function for this variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get constructor() {
-        return constructor;
-      }
Stability
stable
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.hasinstance.html deleted file mode 100644 index b75e6c2..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.hasinstance.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

Tests if an arbitrary value is a Nothing case of a Maybe instance.

-

Signature

hasInstance(value)
(Variant) => Boolean

Documentation

Tests if an arbitrary value is a Nothing case of a Maybe instance.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.Nothing.hasInstance(Maybe.Just(1));
-// ==> false
-
-Maybe.Nothing.hasInstance(Maybe.Nothing());
-// ==> true
-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
hasInstance(value) {
-        return Boolean(value) 
-        &&     adt.hasInstance(value) 
-        &&     value[TAG] === name;
-      }
Stability
stable
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.equals.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.equals.html deleted file mode 100644 index 416c420..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.equals.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - equals - - - - - -

equals

Performs a deep-comparison of two Maybe values for equality. See core/adt/derivations/equality for details.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

equals(value)
forall S, a:
-  (S a).(S a) => Boolean
-where S is Setoid

Documentation

Performs a deep-comparison of two Maybe values for equality. See core/adt/derivations/equality for details.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.Just(1).equals(Maybe.Just(1));
-// ==> true
-
-Maybe.Just(1).equals(Maybe.Nothing());
-// ==> false
-
-Maybe.Nothing().equals(Maybe.Nothing());
-// ==> true
-
-Maybe.Just(Maybe.Just(1)).equals(Maybe.Just(Maybe.Just(1)));
-// ==> true
-

Properties

Source Code

function(value) {
-      assertType(adt)(`${this[tagSymbol]}#equals`, value);
-      return sameType(this, value) && compositesEqual(this, value, Object.keys(this));
-    }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.inspect.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.inspect.html deleted file mode 100644 index 2bd5a11..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.inspect.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - toString - - - - - -

toString

A textual representation for Maybe instances.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

toString()
(ADT).() => String

Documentation

A textual representation for Maybe instances.

-

Properties

Source Code

function() {
-    return `${variantName}(${plainObjectToString.call(this)})`;
-  }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.isnothing.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.isnothing.html deleted file mode 100644 index 355e774..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.isnothing.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - -

(Anonymous)

True if the value is a Nothing instance.

-
Deprecated since 2.0.0

The .isNothing field is deprecated in favour of the new Nothing.hasInstance(value) method. -The .hasInstance() version allow safely testing any value, even non-objects, and also -do union instance checking, rather than a simple tag check;

-

Documentation

True if the value is a Nothing instance.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 55, column 42
get [`is${name}`]() {
-        warnDeprecation(`.is${name} is deprecated. Use ${name}.hasInstance(value)
-instead to check if a value belongs to the ADT variant.`);
-        return true;
-      }
Stability
deprecated
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.matchwith.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.matchwith.html deleted file mode 100644 index 94533ec..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.matchwith.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - matchWith - - - - - -

matchWith

Chooses and executes a function for each variant in the Maybe structure.

-

Signature

matchWith(pattern)
('a is Variant).({ 'b: (Object Any) => 'c }) => 'c
-where 'b = 'a[`@@folktale:adt:tag]

Documentation

Chooses and executes a function for each variant in the Maybe structure.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.Just(1).matchWith({
-  Nothing: () => 'nothing',
-  Just: ({ value }) => `got ${value}`
-});
-// ==> 'got 1'
-
-Maybe.Nothing().matchWith({
-  Nothing: () => 'nothing',
-  Just: ({ value }) => `got ${value}`
-});
-// ==> 'nothing'
-

Properties

Source Code

Defined in src/core/adt/data.js at line 55, column 42
matchWith(pattern) {
-        return pattern[name](this);
-      }
Stability
stable
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.tojson.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.tojson.html deleted file mode 100644 index a23ef62..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.prototype.tojson.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - toJSON - - - - - -

toJSON

Converts a Maybe value to a JavaScript object that may be stored as a JSON value.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

toJSON()
type JSONSerialisation = {
-  "@@type":  String,
-  "@@tag":   String,
-  "@@value": Object Any
-}
-
-Variant . () => JSONSerialisation

Documentation

Converts a Maybe value to a JavaScript object that may be stored as a JSON value.

-

See the docs for core/adt/derivations/serialization for more details.

-

Example:

-
const Maybe = require('folktale/data/maybe');
-
-Maybe.Just(1).toJSON();
-// ==> { '@@type': 'folktale:Data.Maybe', '@@tag': 'Just', '@@value': { value: 1 } }
-
-Maybe.Nothing().toJSON();
-// ==> { '@@type': 'folktale:Data.Maybe', '@@tag': 'Nothing', '@@value': {} }
-

Properties

Source Code

function() {
-    return { 
-      [typeJsonKey]:  typeName, 
-      [tagJsonKey]:   tagName, 
-      [valueJsonKey]: mapValues(this, serializeValue) 
-    };
-  }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.tag.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.tag.html deleted file mode 100644 index 2bc0311..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

tag

The tag for this variant, unique among the Maybe variants.

-

Signature

get tag()

Documentation

The tag for this variant, unique among the Maybe variants.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get tag() {
-        return name;
-      }
Stability
stable
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.type.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.type.html deleted file mode 100644 index e08a96d..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.0.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

type

The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

-

Signature

get type()

Documentation

The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get type() {
-        return typeId;
-      }
Stability
stable
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.html deleted file mode 100644 index ca6af6d..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.prototype.variants.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - variants - - - - - -

variants

The variants in the Maybe structure.

-

Signature

Array Variant

Documentation

The variants in the Maybe structure.

-

Properties

Variants

0: Nothing()

Constructs a Maybe value that represents a failure (a Nothing).

-
1: Just(value)

Constructs a Maybe value that represents a successful value (a Just).

-

(Uncategorised)

Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited

A Number.

-
Experimental
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited

Source Code

Defined in src/core/adt/data.js at line 161, column 33
values(variants)
Stability
stable
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.tag.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.tag.html deleted file mode 100644 index 2bc0311..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

tag

The tag for this variant, unique among the Maybe variants.

-

Signature

get tag()

Documentation

The tag for this variant, unique among the Maybe variants.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get tag() {
-        return name;
-      }
Stability
stable
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.maybe.just.type.html b/docs/api/en/-unknown-module-.folktale.data.maybe.just.type.html deleted file mode 100644 index e08a96d..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.maybe.just.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

type

The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

-

Signature

get type()

Documentation

The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get type() {
-        return typeId;
-      }
Stability
stable
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.constructor.html b/docs/api/en/-unknown-module-.folktale.data.result.error.constructor.html deleted file mode 100644 index 0081f91..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

constructor

The constructor for this variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get constructor()

Documentation

The constructor for this variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get constructor() {
-        return constructor;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.result.error.hasinstance.html deleted file mode 100644 index 4dee682..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.hasinstance.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

Tests if an arbitrary value is a Error case of a Result instance.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

hasInstance(value)
(Variant) => Boolean

Documentation

Tests if an arbitrary value is a Error case of a Result instance.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.Error.hasInstance({ value: 1 });
-// ==> false
-
-Result.Error.hasInstance(Result.Error(1));
-// ==> true
-
-Result.Error.hasInstance(Result.Ok(1));
-// ==> false
-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
hasInstance(value) {
-        return Boolean(value) 
-        &&     adt.hasInstance(value) 
-        &&     value[TAG] === name;
-      }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.equals.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.equals.html deleted file mode 100644 index f7f6f2b..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.equals.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - equals - - - - - -

equals

Performs a deep-comparison of two Result values for equality. See core/adt/derivations/equality for details.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

equals(value)
forall S, a:
-  (S a).(S a) => Boolean
-where S is Setoid

Documentation

Performs a deep-comparison of two Result values for equality. See core/adt/derivations/equality for details.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.Ok(1).equals(Result.Ok(1));
-// ==> true
-
-Result.Error(1).equals(Result.Error(1));
-// ==> true
-
-Result.Ok(1).equals(Result.Error(1));
-// ==> false
-
-Result.Ok(Result.Ok(1)).equals(Result.Ok(Result.Ok(1)));
-// ==> true
-

Properties

Source Code

function(value) {
-      assertType(adt)(`${this[tagSymbol]}#equals`, value);
-      return sameType(this, value) && compositesEqual(this, value, Object.keys(this));
-    }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.inspect.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.inspect.html deleted file mode 100644 index 4f60e74..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.inspect.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - toString - - - - - -

toString

A textual representation for Result instances.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

toString()
(ADT).() => String

Documentation

A textual representation for Result instances.

-

Properties

Source Code

function() {
-    return `${variantName}(${plainObjectToString.call(this)})`;
-  }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.iserror.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.iserror.html deleted file mode 100644 index 676d6b6..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.iserror.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - -

(Anonymous)

True if the value is a Error instance.

-
Deprecated since 2.0.0

The .isError field is deprecated in favour of the new Error.hasInstance(value) method. -The .hasInstance() version allow safely testing any value, even non-objects, and also -do union instance checking, rather than a simple tag check;

-

Documentation

True if the value is a Error instance.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 55, column 42
get [`is${name}`]() {
-        warnDeprecation(`.is${name} is deprecated. Use ${name}.hasInstance(value)
-instead to check if a value belongs to the ADT variant.`);
-        return true;
-      }
Stability
deprecated
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.matchwith.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.matchwith.html deleted file mode 100644 index 6ef30d9..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.matchwith.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - matchWith - - - - - -

matchWith

Chooses and executes a function for each variant in the Result structure.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

matchWith(pattern)
('a is Variant).({ 'b: (Object Any) => 'c }) => 'c
-where 'b = 'a[`@@folktale:adt:tag]

Documentation

Chooses and executes a function for each variant in the Result structure.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.Ok(1).matchWith({
-  Ok: ({ value }) => `ok ${value}`,
-  Error: ({ value }) => `error ${value}`
-});
-// ==> 'ok 1'
-
-Result.Error(1).matchWith({
-  Ok: ({ value }) => `ok ${value}`,
-  Error: ({ value }) => `error ${value}`
-});
-// ==> 'error 1'
-

Properties

Source Code

Defined in src/core/adt/data.js at line 55, column 42
matchWith(pattern) {
-        return pattern[name](this);
-      }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.tojson.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.tojson.html deleted file mode 100644 index 6368040..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.tojson.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - toJSON - - - - - -

toJSON

Converts a Result value to a JavaScript object that may be stored as a JSON value.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

toJSON()
type JSONSerialisation = {
-  "@@type":  String,
-  "@@tag":   String,
-  "@@value": Object Any
-}
-
-Variant . () => JSONSerialisation

Documentation

Converts a Result value to a JavaScript object that may be stored as a JSON value.

-

See the docs for core/adt/derivations/serialization for more details.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.Ok(1).toJSON();
-// ==> { '@@type': 'folktale:Data.Result', '@@tag': 'Ok', '@@value': { value: 1 } }
-
-Result.Error(1).toJSON();
-// ==> { '@@type': 'folktale:Data.Result', '@@tag': 'Error', '@@value': { value: 1 } }
-
-Result.Error(undefined).toJSON();
-// ==> { '@@type': 'folktale:Data.Result', '@@tag': 'Error', '@@value': { value: null } }
-

Properties

Source Code

function() {
-    return { 
-      [typeJsonKey]:  typeName, 
-      [tagJsonKey]:   tagName, 
-      [valueJsonKey]: mapValues(this, serializeValue) 
-    };
-  }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.constructor.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.constructor.html deleted file mode 100644 index 0081f91..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

constructor

The constructor for this variant.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get constructor()

Documentation

The constructor for this variant.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get constructor() {
-        return constructor;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.hasinstance.html deleted file mode 100644 index bf4a333..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.hasinstance.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

Tests if an arbitrary value is a Ok case of a Result instance.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

hasInstance(value)
(Variant) => Boolean

Documentation

Tests if an arbitrary value is a Ok case of a Result instance.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.Ok.hasInstance({ value: 1 });
-// ==> false
-
-Result.Ok.hasInstance(Result.Error(1));
-// ==> false
-
-Result.Ok.hasInstance(Result.Ok(1));
-// ==> true
-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
hasInstance(value) {
-        return Boolean(value) 
-        &&     adt.hasInstance(value) 
-        &&     value[TAG] === name;
-      }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.equals.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.equals.html deleted file mode 100644 index f7f6f2b..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.equals.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - equals - - - - - -

equals

Performs a deep-comparison of two Result values for equality. See core/adt/derivations/equality for details.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

equals(value)
forall S, a:
-  (S a).(S a) => Boolean
-where S is Setoid

Documentation

Performs a deep-comparison of two Result values for equality. See core/adt/derivations/equality for details.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.Ok(1).equals(Result.Ok(1));
-// ==> true
-
-Result.Error(1).equals(Result.Error(1));
-// ==> true
-
-Result.Ok(1).equals(Result.Error(1));
-// ==> false
-
-Result.Ok(Result.Ok(1)).equals(Result.Ok(Result.Ok(1)));
-// ==> true
-

Properties

Source Code

function(value) {
-      assertType(adt)(`${this[tagSymbol]}#equals`, value);
-      return sameType(this, value) && compositesEqual(this, value, Object.keys(this));
-    }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.inspect.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.inspect.html deleted file mode 100644 index 4f60e74..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.inspect.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - toString - - - - - -

toString

A textual representation for Result instances.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

toString()
(ADT).() => String

Documentation

A textual representation for Result instances.

-

Properties

Source Code

function() {
-    return `${variantName}(${plainObjectToString.call(this)})`;
-  }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.isok.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.isok.html deleted file mode 100644 index e072f80..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.isok.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - -

(Anonymous)

True if the value is a Ok instance.

-
Deprecated since 2.0.0

The .isOk field is deprecated in favour of the new Ok.hasInstance(value) method. -The .hasInstance() version allow safely testing any value, even non-objects, and also -do union instance checking, rather than a simple tag check;

-

Documentation

True if the value is a Ok instance.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 55, column 42
get [`is${name}`]() {
-        warnDeprecation(`.is${name} is deprecated. Use ${name}.hasInstance(value)
-instead to check if a value belongs to the ADT variant.`);
-        return true;
-      }
Stability
deprecated
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.matchwith.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.matchwith.html deleted file mode 100644 index 6ef30d9..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.matchwith.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - matchWith - - - - - -

matchWith

Chooses and executes a function for each variant in the Result structure.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

matchWith(pattern)
('a is Variant).({ 'b: (Object Any) => 'c }) => 'c
-where 'b = 'a[`@@folktale:adt:tag]

Documentation

Chooses and executes a function for each variant in the Result structure.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.Ok(1).matchWith({
-  Ok: ({ value }) => `ok ${value}`,
-  Error: ({ value }) => `error ${value}`
-});
-// ==> 'ok 1'
-
-Result.Error(1).matchWith({
-  Ok: ({ value }) => `ok ${value}`,
-  Error: ({ value }) => `error ${value}`
-});
-// ==> 'error 1'
-

Properties

Source Code

Defined in src/core/adt/data.js at line 55, column 42
matchWith(pattern) {
-        return pattern[name](this);
-      }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.tojson.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.tojson.html deleted file mode 100644 index 6368040..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.prototype.tojson.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - toJSON - - - - - -

toJSON

Converts a Result value to a JavaScript object that may be stored as a JSON value.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

toJSON()
type JSONSerialisation = {
-  "@@type":  String,
-  "@@tag":   String,
-  "@@value": Object Any
-}
-
-Variant . () => JSONSerialisation

Documentation

Converts a Result value to a JavaScript object that may be stored as a JSON value.

-

See the docs for core/adt/derivations/serialization for more details.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.Ok(1).toJSON();
-// ==> { '@@type': 'folktale:Data.Result', '@@tag': 'Ok', '@@value': { value: 1 } }
-
-Result.Error(1).toJSON();
-// ==> { '@@type': 'folktale:Data.Result', '@@tag': 'Error', '@@value': { value: 1 } }
-
-Result.Error(undefined).toJSON();
-// ==> { '@@type': 'folktale:Data.Result', '@@tag': 'Error', '@@value': { value: null } }
-

Properties

Source Code

function() {
-    return { 
-      [typeJsonKey]:  typeName, 
-      [tagJsonKey]:   tagName, 
-      [valueJsonKey]: mapValues(this, serializeValue) 
-    };
-  }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.tag.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.tag.html deleted file mode 100644 index bdce171..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

tag

The tag for this variant, unique among the Result variants.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get tag()

Documentation

The tag for this variant, unique among the Result variants.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get tag() {
-        return name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.type.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.type.html deleted file mode 100644 index 8270475..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.1.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

type

The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get type()

Documentation

The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get type() {
-        return typeId;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.html b/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.html deleted file mode 100644 index c4c6f0a..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.prototype.variants.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - variants - - - - - -

variants

The variants in the Result structure.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

Array Variant

Documentation

The variants in the Result structure.

-

Properties

Variants

0: Error(value)

Constructs a Result whose value represents a failure.

-
Experimental
1: Ok(value)

Constructs a Result whose value represents a success.

-
Experimental

(Uncategorised)

Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited

A Number.

-
Experimental
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited
Inherited

Source Code

Defined in src/core/adt/data.js at line 161, column 33
values(variants)
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.tag.html b/docs/api/en/-unknown-module-.folktale.data.result.error.tag.html deleted file mode 100644 index bdce171..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

tag

The tag for this variant, unique among the Result variants.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get tag()

Documentation

The tag for this variant, unique among the Result variants.

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get tag() {
-        return name;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.error.type.html b/docs/api/en/-unknown-module-.folktale.data.result.error.type.html deleted file mode 100644 index 8270475..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.error.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

type

The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

get type()

Documentation

The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

-

Properties

Source Code

Defined in src/core/adt/data.js at line 95, column 25
get type() {
-        return typeId;
-      }
Stability
experimental
Licence
MIT
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.fromjson.html b/docs/api/en/-unknown-module-.folktale.data.result.fromjson.html deleted file mode 100644 index dff300e..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.fromjson.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - fromJSON - - - - - -

fromJSON

Parses a JavaScript object previously serialised as aResult.toJSON() into a proper Result structure.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)
type JSONSerialisation = {
-  "@@type":  String,
-  "@@tag":   String,
-  "@@value": Object Any
-}
-type JSONParser = {
-  fromJSON: (JSONSerialisation, Array JSONParser) => Variant
-}
-
-(JSONSerialisation, Array JSONParser) => Variant

Documentation

Parses a JavaScript object previously serialised as aResult.toJSON() into a proper Result structure.

-

See the docs for core/adt/derivations/serialization for more details.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.fromJSON(Result.Ok(1).toJSON());
-// ==> Result.Ok(1)
-
-Result.fromJSON(Result.Error(1).toJSON());
-// ==> Result.Error(1)
-

Properties

Source Code

function(value, parsers = { [typeName]: adt }, keysIndicateType = false) {
-    const valueTypeName = value[typeJsonKey];
-    const valueTagName = value[tagJsonKey];
-    const valueContents = value[valueJsonKey];
-    assertType(typeName, valueTypeName);
-    const parsersByType = keysIndicateType ? parsers
-          : /*otherwise*/                    indexByType(values(parsers));
-
-    const parsedValue = mapValues(valueContents, parseValue(parsersByType));
-    return extend(Object.create(adt[valueTagName].prototype), parsedValue);
-  }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.result.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.result.hasinstance.html deleted file mode 100644 index 8db0bb2..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.result.hasinstance.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - hasInstance - - - - - -

hasInstance

Tests if an arbitrary value is a Result instance.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

hasInstance(value)
ADT.(Variant) -> Boolean

Documentation

Tests if an arbitrary value is a Result instance.

-

Example:

-
const Result = require('folktale/data/result');
-
-Result.hasInstance({ value: 1 });
-// ==> false
-
-Result.hasInstance(Result.Ok(1));
-// ==> true
-
-Result.hasInstance(Result.Error(1));
-// ==> true
-

Properties

Source Code

Defined in src/core/adt/data.js at line 161, column 33
hasInstance(value) {
-      return Boolean(value)
-      &&     value[TYPE] === this[TYPE];
-    }
Stability
experimental
Licence
MIT
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.task._task.prototype.html b/docs/api/en/-unknown-module-.folktale.data.task._task.prototype.html deleted file mode 100644 index f49cc6c..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.task._task.prototype.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - -

(Anonymous)

The container for instance methods for the Task structure.

-
This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Documentation

The container for instance methods for the Task structure.

-

Properties

Combining tasks

and: value(that)

Constructs a new task that awaits both tasks to resolve. The result of the new task is a tuple containing the results of the left and right tasks, if they all succeed, or the first failure if they fail.

-
Experimental
or: value(that)

Combines two tasks such that the resulting task assimilates the result of the -first one to resolve.

-
Experimental

Executing tasks

run: value()

Executes a Task and returns a TaskExecution object representing the execution.

-
Experimental

Fantasy Land

ap(that)

Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

-
fantasy-land/ap(that)

Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

-
fantasy-land/bimap(f, g)

Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

-
fantasy-land/chain(transformation)

Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

-
fantasy-land/map(transformation)

Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

-

Pattern matching

willMatchWith: value(pattern)

Chooses and executes a function for each variant in a Task. The function must -return a new task, whose value and state will be assimilated.

-
Experimental

Recovering from errors

orElse: value(handler)

Transforms a failed task's value and state.

-
Experimental
swap: value()

Inverts the state of a Task. That is, turns successful tasks into failed ones, and failed tasks into successful ones.

-
Experimental

Transforming tasks

apply: value(task)

Applies the function in the left task to the value on the right task. The left -task is ran to completion before the right task is started.

-
Experimental
bimap: value(rejectionTransformation, successTransformation)

Transforms the rejected or resolved values of a Task with a function. The state of the task is not changed.

-
Experimental
chain: value(transformation)

Transforms the value and state of a Task.

-
Experimental
map: value(transformation)

Transforms the value of a successful task.

-
Experimental
mapRejected: value(transformation)

Transforms the value of a failed task.

-
Experimental

Types

constructor: Task(computation, onCancel, cleanup)

Tasks model asynchronous processes with automatic resource handling. They are generally constructed with the task function.

-
Experimental
Stability
experimental
Authors
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
- - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.cancel.html b/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.cancel.html deleted file mode 100644 index 7e5c10c..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.cancel.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - -

(Anonymous)

Cancels a task execution. Does nothing if the task has already been resolved.

-

Documentation

Cancels a task execution. Does nothing if the task has already been resolved.

-

Example:

-
const { task } = require('folktale/data/task');
-
-let message = 'world';
-const helloIn50 = task(
-  resolver => setTimeout(() => {
-    message = 'hello';
-    resolver.resolve();
-  }, 50),
-  {
-    cleanup: (timer) => clearTimeout(timer)
-  }
-);
-
-const execution = helloIn50.run();
-execution.cancel();
-try {
-  const result = await execution.promise();
-  throw 'never happens';
-} catch (error) {
-  $ASSERT(message == 'world');
-}
-

Properties

On This Page
Authors
Authors
    Maintainers
      - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.future.html b/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.future.html deleted file mode 100644 index cda990d..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.future.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - -

      (Anonymous)

      Gets the eventual value of a Task as a Folktale Future.

      -

      Documentation

      Gets the eventual value of a Task as a Folktale Future.

      -

      Example:

      -
      const { task, of, rejected } = require('folktale/data/task');
      -const { Cancelled, Resolved, Rejected } = require('folktale/data/future/_execution-state');
      -
      -of(1).run().future()._state;
      -// ==> Resolved(1)
      -
      -rejected(1).run().future()._state;
      -// ==> Rejected(1)
      -
      -task(r => r.cancel()).run().future()._state;
      -// ==> Cancelled()
      -

      Properties

      On This Page
      Authors
      Authors
        Maintainers
          - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.html b/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.html deleted file mode 100644 index fd942df..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - -

          (Anonymous)

          The container for instance methods for the TaskExecution structure.

          -
          This feature is experimental!

          This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

          Documentation

          The container for instance methods for the TaskExecution structure.

          -

          Properties

          Cancelling tasks

          cancel()

          Cancels a task execution. Does nothing if the task has already been resolved.

          -

          Extracting eventual values

          future()

          Gets the eventual value of a Task as a Folktale Future.

          -
          promise()

          Gets the eventual value of the task as a JavaScript's Promise.

          -

          Reacting to Task state transitions

          listen()

          Adds a functions to be called when the task settles for each possible state it can transition to.

          -

          Types

          constructor()

          Represents the execution of a Task, with methods to cancel it, react to its -results, and retrieve its eventual value. TaskExecution objects aren't created -directly by users, but instead returned as a result from Task's run() method. -b

          -
          Experimental
          Stability
          experimental
          Authors
          Authors
          • Quildreen Motta
          Maintainers
          • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
          - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.listen.html b/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.listen.html deleted file mode 100644 index 8f45db4..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.listen.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - -

          (Anonymous)

          Adds a functions to be called when the task settles for each possible state it can transition to.

          -

          Documentation

          Adds a functions to be called when the task settles for each possible state it can transition to.

          -

          Example:

          -
          const { task } = require('folktale/data/task');
          -
          -task(r => r.resolve('hello')).run().listen({
          -  onCancelled: () => { throw 'never happens' },
          -  onRejected: (error) => { throw 'never happens' },
          -  onResolved: (value) => { $ASSERT(value == 'hello') }
          -});
          -
          -task(r => r.reject('hello')).run().listen({
          -  onCancelled: () => { throw 'never happens' },
          -  onRejected: (error) => { $ASSERT(error == 'hello') },
          -  onResolved: (value) => { throw 'never happens' }
          -});
          -
          -task(r => r.cancel()).run().listen({
          -  onCancelled: () => { $ASSERT(true) },
          -  onRejected: (error) => { throw 'never happens' },
          -  onResolved: (value) => { throw 'never happens' }
          -});
          -

          Properties

          On This Page
          Authors
          Authors
            Maintainers
              - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.promise.html b/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.promise.html deleted file mode 100644 index ca1d64b..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.task._taskexecution.prototype.promise.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - -

              (Anonymous)

              Gets the eventual value of the task as a JavaScript's Promise.

              -

              Documentation

              Gets the eventual value of the task as a JavaScript's Promise.

              -

              Since Promises don't have support for representing cancellations, Folktale's -tasks represent cancellation as a rejection with a special object. See the -documentation for Futures and Deferreds for more details.

              -

              Example:

              -
              const { task, of, rejected } = require('folktale/data/task');
              -
              -const result1 = await of(1).run().promise();
              -$ASSERT(result1 == 1);
              -
              -try {
              -  const result2 = await rejected(1).run().promise();
              -  throw 'never happens';
              -} catch (error) {
              -  $ASSERT(error == 1);
              -}
              -
              -try {
              -  const result3 = await task(r => r.cancel()).run().promise();
              -  throw 'never happens';
              -} catch (error) {
              -  const { Cancelled } = require('folktale/data/future/_execution-state');
              -  $ASSERT(Cancelled.hasInstance(error));
              -}
              -

              Properties

              On This Page
              Authors
              Authors
                Maintainers
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.constructor.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.constructor.html deleted file mode 100644 index 0081f91..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

                  constructor

                  The constructor for this variant.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  get constructor()

                  Documentation

                  The constructor for this variant.

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 95, column 25
                  get constructor() {
                  -        return constructor;
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.hasinstance.html deleted file mode 100644 index d025449..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.hasinstance.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - hasInstance - - - - - -

                  hasInstance

                  Tests if an arbitrary value is a Failure case of a Validation instance.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  hasInstance(value)
                  (Variant) => Boolean

                  Documentation

                  Tests if an arbitrary value is a Failure case of a Validation instance.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -
                  -Validation.Failure.hasInstance({ value: 1 });
                  -// ==> false
                  -
                  -Validation.Failure.hasInstance(Validation.Success(1));
                  -// ==> false
                  -
                  -Validation.Failure.hasInstance(Validation.Failure(1));
                  -// ==> true
                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 95, column 25
                  hasInstance(value) {
                  -        return Boolean(value) 
                  -        &&     adt.hasInstance(value) 
                  -        &&     value[TAG] === name;
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.equals.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.equals.html deleted file mode 100644 index f71f67f..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.equals.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - equals - - - - - -

                  equals

                  Performs a deep-comparison of two Validation values for equality.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  equals(value)
                  forall S, a:
                  -  (S a).(S a) => Boolean
                  -where S is Setoid

                  Documentation

                  Performs a deep-comparison of two Validation values for equality.

                  -

                  See core/adt/derivations/equality for details.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success(1).equals(Success(1));
                  -// ==> true
                  -
                  -Failure(1).equals(Failure(1));
                  -// ==> true
                  -
                  -Success(1).equals(Failure(1));
                  -// ==> false
                  -
                  -Success(Success(1)).equals(Success(Success(1)));
                  -// ==> true
                  -

                  Properties

                  Source Code

                  function(value) {
                  -      assertType(adt)(`${this[tagSymbol]}#equals`, value);
                  -      return sameType(this, value) && compositesEqual(this, value, Object.keys(this));
                  -    }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.fantasy-land-concat.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.fantasy-land-concat.html deleted file mode 100644 index caeb461..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.fantasy-land-concat.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - fantasy-land/concat - - - - - -

                  fantasy-land/concat

                  Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

                  -

                  Signature

                  fantasy-land/concat(that)
                  ('S 'a).('S 'a) => 'S 'a
                  -where 'S is Semigroup

                  Documentation

                  Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

                  -

                  Properties

                  Source Code

                  Defined in src/helpers/provide-fantasy-land-aliases.js at line 24, column 10
                  'fantasy-land/concat'(that) {
                  -      return this.concat(that);
                  -    }
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.inspect.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.inspect.html deleted file mode 100644 index a724e8e..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.inspect.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - toString - - - - - -

                  toString

                  A textual representation for Validation instances.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toString()
                  (ADT).() => String

                  Documentation

                  A textual representation for Validation instances.

                  -

                  Properties

                  Source Code

                  function() {
                  -    return `${variantName}(${plainObjectToString.call(this)})`;
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.isfailure.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.isfailure.html deleted file mode 100644 index e763274..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.isfailure.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - -

                  (Anonymous)

                  True if the value is a Failure instance.

                  -
                  Deprecated since 2.0.0

                  The .isFailure field is deprecated in favour of the new Failure.hasInstance(value) method. -The .hasInstance() version allow safely testing any value, even non-objects, and also -do union instance checking, rather than a simple tag check;

                  -

                  Documentation

                  True if the value is a Failure instance.

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 55, column 42
                  get [`is${name}`]() {
                  -        warnDeprecation(`.is${name} is deprecated. Use ${name}.hasInstance(value)
                  -instead to check if a value belongs to the ADT variant.`);
                  -        return true;
                  -      }
                  Stability
                  deprecated
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.matchwith.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.matchwith.html deleted file mode 100644 index f45e8e1..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.matchwith.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - matchWith - - - - - -

                  matchWith

                  Chooses and executes a function for each variant in the Validation structure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  matchWith(pattern)
                  ('a is Variant).({ 'b: (Object Any) => 'c }) => 'c
                  -where 'b = 'a[`@@folktale:adt:tag]

                  Documentation

                  Chooses and executes a function for each variant in the Validation structure.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success('a').matchWith({
                  -  Failure: ({ value }) => `Failure: ${value}`,
                  -  Success: ({ value }) => `Success: ${value}`
                  -});
                  -// ==> 'Success: a'
                  -
                  -Failure('a').matchWith({
                  -  Failure: ({ value }) => `Failure: ${value}`,
                  -  Success: ({ value }) => `Success: ${value}`
                  -});
                  -// ==> 'Failure: a'
                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 55, column 42
                  matchWith(pattern) {
                  -        return pattern[name](this);
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.tojson.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.tojson.html deleted file mode 100644 index 86af2fe..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.tojson.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - toJSON - - - - - -

                  toJSON

                  Converts a Validation value to a JavaScript object that may be stored as a JSON value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toJSON()
                  type JSONSerialisation = {
                  -  "@@type":  String,
                  -  "@@tag":   String,
                  -  "@@value": Object Any
                  -}
                  -
                  -Variant . () => JSONSerialisation

                  Documentation

                  Converts a Validation value to a JavaScript object that may be stored as a JSON value.

                  -

                  See the docs for core/adt/derivations/serialization for more details.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success('a').toJSON();
                  -// ==> { '@@type': 'folktale:Data.Validation', '@@tag': 'Success', '@@value': { value: 'a' }}
                  -
                  -Failure('a').toJSON();
                  -// ==> { '@@type': 'folktale:Data.Validation', '@@tag': 'Failure', '@@value': { value: 'a' }}
                  -

                  Properties

                  Source Code

                  function() {
                  -    return { 
                  -      [typeJsonKey]:  typeName, 
                  -      [tagJsonKey]:   tagName, 
                  -      [valueJsonKey]: mapValues(this, serializeValue) 
                  -    };
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.constructor.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.constructor.html deleted file mode 100644 index 0081f91..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

                  constructor

                  The constructor for this variant.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  get constructor()

                  Documentation

                  The constructor for this variant.

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 95, column 25
                  get constructor() {
                  -        return constructor;
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.hasinstance.html deleted file mode 100644 index f83f7cd..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.hasinstance.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - hasInstance - - - - - -

                  hasInstance

                  Tests if an arbitrary value is a Success case of a Validation instance.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  hasInstance(value)
                  (Variant) => Boolean

                  Documentation

                  Tests if an arbitrary value is a Success case of a Validation instance.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -
                  -Validation.Success.hasInstance({ value: 1 });
                  -// ==> false
                  -
                  -Validation.Success.hasInstance(Validation.Success(1));
                  -// ==> true
                  -
                  -Validation.Success.hasInstance(Validation.Failure(1));
                  -// ==> false
                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 95, column 25
                  hasInstance(value) {
                  -        return Boolean(value) 
                  -        &&     adt.hasInstance(value) 
                  -        &&     value[TAG] === name;
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.equals.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.equals.html deleted file mode 100644 index f71f67f..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.equals.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - equals - - - - - -

                  equals

                  Performs a deep-comparison of two Validation values for equality.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  equals(value)
                  forall S, a:
                  -  (S a).(S a) => Boolean
                  -where S is Setoid

                  Documentation

                  Performs a deep-comparison of two Validation values for equality.

                  -

                  See core/adt/derivations/equality for details.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success(1).equals(Success(1));
                  -// ==> true
                  -
                  -Failure(1).equals(Failure(1));
                  -// ==> true
                  -
                  -Success(1).equals(Failure(1));
                  -// ==> false
                  -
                  -Success(Success(1)).equals(Success(Success(1)));
                  -// ==> true
                  -

                  Properties

                  Source Code

                  function(value) {
                  -      assertType(adt)(`${this[tagSymbol]}#equals`, value);
                  -      return sameType(this, value) && compositesEqual(this, value, Object.keys(this));
                  -    }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.inspect.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.inspect.html deleted file mode 100644 index a724e8e..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.inspect.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - toString - - - - - -

                  toString

                  A textual representation for Validation instances.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toString()
                  (ADT).() => String

                  Documentation

                  A textual representation for Validation instances.

                  -

                  Properties

                  Source Code

                  function() {
                  -    return `${variantName}(${plainObjectToString.call(this)})`;
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.issuccess.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.issuccess.html deleted file mode 100644 index 7718bf4..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.issuccess.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - -

                  (Anonymous)

                  True if the value is a Success instance.

                  -
                  Deprecated since 2.0.0

                  The .isSuccess field is deprecated in favour of the new Success.hasInstance(value) method. -The .hasInstance() version allow safely testing any value, even non-objects, and also -do union instance checking, rather than a simple tag check;

                  -

                  Documentation

                  True if the value is a Success instance.

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 55, column 42
                  get [`is${name}`]() {
                  -        warnDeprecation(`.is${name} is deprecated. Use ${name}.hasInstance(value)
                  -instead to check if a value belongs to the ADT variant.`);
                  -        return true;
                  -      }
                  Stability
                  deprecated
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.matchwith.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.matchwith.html deleted file mode 100644 index f45e8e1..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.matchwith.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - matchWith - - - - - -

                  matchWith

                  Chooses and executes a function for each variant in the Validation structure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  matchWith(pattern)
                  ('a is Variant).({ 'b: (Object Any) => 'c }) => 'c
                  -where 'b = 'a[`@@folktale:adt:tag]

                  Documentation

                  Chooses and executes a function for each variant in the Validation structure.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success('a').matchWith({
                  -  Failure: ({ value }) => `Failure: ${value}`,
                  -  Success: ({ value }) => `Success: ${value}`
                  -});
                  -// ==> 'Success: a'
                  -
                  -Failure('a').matchWith({
                  -  Failure: ({ value }) => `Failure: ${value}`,
                  -  Success: ({ value }) => `Success: ${value}`
                  -});
                  -// ==> 'Failure: a'
                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 55, column 42
                  matchWith(pattern) {
                  -        return pattern[name](this);
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.tojson.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.tojson.html deleted file mode 100644 index 86af2fe..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.prototype.tojson.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - toJSON - - - - - -

                  toJSON

                  Converts a Validation value to a JavaScript object that may be stored as a JSON value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toJSON()
                  type JSONSerialisation = {
                  -  "@@type":  String,
                  -  "@@tag":   String,
                  -  "@@value": Object Any
                  -}
                  -
                  -Variant . () => JSONSerialisation

                  Documentation

                  Converts a Validation value to a JavaScript object that may be stored as a JSON value.

                  -

                  See the docs for core/adt/derivations/serialization for more details.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success('a').toJSON();
                  -// ==> { '@@type': 'folktale:Data.Validation', '@@tag': 'Success', '@@value': { value: 'a' }}
                  -
                  -Failure('a').toJSON();
                  -// ==> { '@@type': 'folktale:Data.Validation', '@@tag': 'Failure', '@@value': { value: 'a' }}
                  -

                  Properties

                  Source Code

                  function() {
                  -    return { 
                  -      [typeJsonKey]:  typeName, 
                  -      [tagJsonKey]:   tagName, 
                  -      [valueJsonKey]: mapValues(this, serializeValue) 
                  -    };
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.tag.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.tag.html deleted file mode 100644 index 2459612..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

                  tag

                  The tag for this variant, unique among the Validation variants.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  get tag()

                  Documentation

                  The tag for this variant, unique among the Validation variants.

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 95, column 25
                  get tag() {
                  -        return name;
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.type.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.type.html deleted file mode 100644 index 8270475..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.1.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

                  type

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  get type()

                  Documentation

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 95, column 25
                  get type() {
                  -        return typeId;
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.html deleted file mode 100644 index 22f09b8..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.prototype.variants.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - variants - - - - - -

                  variants

                  The variants in the Validation structure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Array Variant

                  Documentation

                  The variants in the Validation structure.

                  -

                  Properties

                  Variants

                  0: Failure(value)

                  Constructs a Validation whose value represents a failure.

                  -
                  Experimental
                  1: Success(value)

                  Constructs a Validation whose value represents a success.

                  -
                  Experimental

                  (Uncategorised)

                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited

                  A Number.

                  -
                  Experimental
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited
                  Inherited

                  Source Code

                  Defined in src/core/adt/data.js at line 161, column 33
                  values(variants)
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.tag.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.tag.html deleted file mode 100644 index 2459612..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.tag.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tag - - - - - -

                  tag

                  The tag for this variant, unique among the Validation variants.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  get tag()

                  Documentation

                  The tag for this variant, unique among the Validation variants.

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 95, column 25
                  get tag() {
                  -        return name;
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.failure.type.html b/docs/api/en/-unknown-module-.folktale.data.validation.failure.type.html deleted file mode 100644 index 8270475..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.failure.type.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - type - - - - - -

                  type

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  get type()

                  Documentation

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 95, column 25
                  get type() {
                  -        return typeId;
                  -      }
                  Stability
                  experimental
                  Licence
                  MIT
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.fromjson.html b/docs/api/en/-unknown-module-.folktale.data.validation.fromjson.html deleted file mode 100644 index a8f3e65..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.fromjson.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - fromJSON - - - - - -

                  fromJSON

                  Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)
                  type JSONSerialisation = {
                  -  "@@type":  String,
                  -  "@@tag":   String,
                  -  "@@value": Object Any
                  -}
                  -type JSONParser = {
                  -  fromJSON: (JSONSerialisation, Array JSONParser) => Variant
                  -}
                  -
                  -(JSONSerialisation, Array JSONParser) => Variant

                  Documentation

                  Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

                  -

                  See the docs for core/adt/derivations/serialization for more details.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -
                  -Validation.fromJSON(Validation.Success(1).toJSON());
                  -// ==> Validation.Success(1)
                  -
                  -Validation.fromJSON(Validation.Failure(1).toJSON());
                  -// ==> Validation.Failure(1)
                  -

                  Properties

                  Source Code

                  function(value, parsers = { [typeName]: adt }, keysIndicateType = false) {
                  -    const valueTypeName = value[typeJsonKey];
                  -    const valueTagName = value[tagJsonKey];
                  -    const valueContents = value[valueJsonKey];
                  -    assertType(typeName, valueTypeName);
                  -    const parsersByType = keysIndicateType ? parsers
                  -          : /*otherwise*/                    indexByType(values(parsers));
                  -
                  -    const parsedValue = mapValues(valueContents, parseValue(parsersByType));
                  -    return extend(Object.create(adt[valueTagName].prototype), parsedValue);
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/-unknown-module-.folktale.data.validation.hasinstance.html b/docs/api/en/-unknown-module-.folktale.data.validation.hasinstance.html deleted file mode 100644 index df6f247..0000000 --- a/docs/api/en/-unknown-module-.folktale.data.validation.hasinstance.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - hasInstance - - - - - -

                  hasInstance

                  Tests if an arbitrary value is a Validation instance.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  hasInstance(value)
                  ADT.(Variant) -> Boolean

                  Documentation

                  Tests if an arbitrary value is a Validation instance.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -
                  -Validation.hasInstance({ value: 1 });
                  -// ==> false
                  -
                  -Validation.hasInstance(Validation.Success(1));
                  -// ==> true
                  -
                  -Validation.hasInstance(Validation.Failure(1));
                  -// ==> true
                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 161, column 33
                  hasInstance(value) {
                  -      return Boolean(value)
                  -      &&     value[TYPE] === this[TYPE];
                  -    }
                  Stability
                  experimental
                  Licence
                  MIT
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.data.adt.html b/docs/api/en/folktale.core.adt.data.adt.html deleted file mode 100644 index 19613ca..0000000 --- a/docs/api/en/folktale.core.adt.data.adt.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - ADT - - - - - -

                  ADT

                  The basis of all algebraic data types.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  The basis of all algebraic data types.

                  -

                  ADT is used basically to share some methods for refining data structures -created by this module, derivation being one of them.

                  -

                  Properties

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/adt/data.js at line 189, column 0
                  {
                  -  /*~
                  -   * type: |
                  -   *   ADT . (...(Variant, ADT) => Any) => ADT
                  -   */
                  -  derive(...derivations) {
                  -    derivations.forEach(derivation => {
                  -      this.variants.forEach(variant => derivation(variant, this));
                  -    });
                  -    return this;
                  -  }
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/adt/data
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.data.constructor.html b/docs/api/en/folktale.core.adt.data.constructor.html deleted file mode 100644 index 8741b24..0000000 --- a/docs/api/en/folktale.core.adt.data.constructor.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - constructor - - - - - -

                  constructor

                  The constructor for this variant.

                  -

                  Signature

                  get constructor()

                  Documentation

                  The constructor for this variant.

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/data.js at line 55, column 42
                  get constructor() {
                  -        return constructor;
                  -      }
                  Licence
                  MIT
                  Module
                  folktale/core/adt/data
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.data.data.html b/docs/api/en/folktale.core.adt.data.data.html deleted file mode 100644 index 12baa54..0000000 --- a/docs/api/en/folktale.core.adt.data.data.html +++ /dev/null @@ -1,469 +0,0 @@ - - - - - data - - - - - -

                  data

                  Constructs a tagged union data structure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  data(typeId, patterns)
                  (String, Object (Array String)) => ADT

                  Documentation

                  Constructs a tagged union data structure.

                  -

                  Using the ADT module:

                  -
                  const data = require('folktale/core/adt/data');
                  -
                  -var List = data('List', {
                  -  Nil(){ },
                  -  Cons(value, rest) {
                  -    return { value, rest };
                  -  }
                  -});
                  -
                  -var { Nil, Cons } = List;
                  -
                  -Cons('a', Cons('b', Cons('c', Nil())));
                  -// ==> { value: 'a', rest: { value: 'b', ..._ }}
                  -

                  Why use tagged unions?

                  -

                  Data modelling is a very important part of programming, directly -affecting things like correctness and performance. Folktale is -in general mostly interested in correctness, and providing tools -for achieving that.

                  -

                  When modelling data in a program, there are several different -choices that one must make in an attempt to capture the rules of -how that data is manipulated and what they represent. Data modeling -tends to come in three different concepts:

                  -
                    -
                  • Scalars represent concepts that have only one atomic -value at a time. This value makes sense on its own, and can't -be divided into further concepts. Examples of this are numers, -strings, etc.

                    -
                  • -
                  • Product represent bigger concepts that are made out of -possibly several smaller concepts, each of which is independent -of each other, and always present. An object that contains a -person's name and age is an example of a product, arrays -are another example.

                    -
                  • -
                  • Unions represent one of out of many concepts, at any given -time. JS doesn't have many data structures that capture the idea -of a union, but there are many cases where this happens in a -codebase:

                    -
                      -
                    • Reading a file may either give you the data in that -file or an error object;

                      -
                    • -
                    • Accessing a property in an object may either give you the -value or undefined;

                      -
                    • -
                    • Querying a database may give you a connection error (maybe -we weren't able to contact the database), a query error -(maybe the query wasn't well formed), a "this value isn't -here" response, or the value you want.

                      -
                    • -
                    -
                  • -
                  -

                  Out of these, you're probably already familiar with products and scalars, -because they're used everywhere in JavaScript, but maybe you're not -familiar with unions, since JavaScript doesn't have many of them built-in.

                  -

                  For example, when reading a file in Node, you have this:

                  -
                  fs.readFile(filename, (error, value) => {
                  -  if (error != null) {
                  -    handleError(error);
                  -  } else {
                  -    handleSuccess(value);
                  -  }
                  -});
                  -

                  The callback function receives two arguments, error and value, but -only one of them may ever be present at any given time. If you have a -value, then error must be null, and if you have an error, then value -must be null. Nothing in the representation of this data tells you -that, or forces you to deal with it like that.

                  -

                  If you compare it with an API like fetch, where you get a Promise -instead, many of these problems are solved:

                  -
                  fetch(url).then(
                  -  (response) => handleSuccess(response),
                  -  (error)    => handleError(error)
                  -);
                  -

                  Here the result of fetch can be either a response or an error, like in -the readFile example, but the only way of getting to that value is -through the then function, which requires you to define separate branches -for handling each case. This way it's not possible to forget to deal with -one of the cases, or make mistakes in the branching condition, such as -if (error == null) { handleError(...) } — which the first version of -this documentation had, in fact.

                  -

                  Modelling data with Core.ADT

                  -

                  So, properly modelling your data helps making sure that a series of errors -can't ever occurr in your program, which is great as you have to deal with -less problems, but how does Core.ADT help you in that?

                  -

                  A simple failure case

                  -

                  To answer this question let's consider a very simple, everyday problem: you -have a function that can return any value, but it can also fail. How do you -differentiate failure from regular values?

                  -
                  const find = (predicate, items) => {
                  -  for (let i = 0; i < items.length; ++i) {
                  -    const item = items[i];
                  -    if (predicate(item))  return item;
                  -  }
                  -  return null;
                  -};
                  -

                  The example above returns the item if the predicate matches anything, or null -if it doesn't. But null is also a valid JavaScript value:

                  -
                  find(x => true, [1, 2, 3]);    // ==> 1
                  -find(x => false, [1, 2, 3]);   // ==> null
                  -find(x => true, [null, 1, 2]); // ==> null
                  -

                  Now, there isn't a way of differentiating failure from success if your arrays -have a null value. One could say "this function works for arrays without -nulls", but there isn't a separate type that can enforce those guarantees -either. This confusing behaviour opens the door for bugs that are very -difficult to find, since they're created way before they hit the find -function.

                  -

                  A more practical approach is to return something that can't be in the array. -For example, if we return an object like: { found: Bool, value: Any }, then -we don't run into this issue:

                  -
                  const find2 = (predicate, items) => {
                  -  for (let i = 0; i < items.length; ++i) {
                  -    const item = items[i];
                  -    if (predicate(item))  return { found: true, value: item };
                  -  }
                  -  return { found: false };
                  -};
                  -
                  -find2(x => true, [1, 2, 3]);    // ==> { found: true, value: 1 }
                  -find2(x => false, [1, 2, 3]);   // ==> { found: false }
                  -find2(x => true, [null, 1, 2]); // ==> { found: true, value: null }
                  -

                  We can differentiate between successes and failures now, but in order to -use the value we need to unpack it. Now we have two problems: found and -value aren't entirely related, and we have to create this ad-hoc relationship -through an if statement. That's very easy to get wrong. Another problem is -that nothing forces people to check found before looking at value.

                  -

                  So, a better solution for this is to use tagged unions and pattern matching:

                  -
                  const data = require('folktale/core/adt/data');
                  -
                  -const Maybe = data('Maybe', {
                  -  None() { return {} },
                  -  Some(value) { return { value } }
                  -});
                  -
                  -const find3 = (predicate, items) => {
                  -  for (let i = 0; i < items.length; ++i) {
                  -    const item = items[i];
                  -    if (predicate(item))  return Maybe.Some(item);
                  -  }
                  -  return Maybe.None();
                  -};
                  -
                  -find3(x => true, [1, 2, 3]);    // ==> Maybe.Some(1)
                  -find3(x => false, [1, 2, 3]);   // ==> Maybe.None()
                  -find3(x => true, [null, 1, 2]); // ==> Maybe.Some(null)
                  -
                  -find3(x => true, [1, 2, 3]).matchWith({
                  -  None: ()          => "Not found",
                  -  Some: ({ value }) => "Found " + value
                  -}); // ==> "Found 1"
                  -

                  Modelling complex cases

                  -

                  Let's consider a more complex case. Imagine you're writing a function to -handle communicating with some HTTP API. Like in the case presented in -the previous section, a call to the API may succeed or fail. Unlike the -previous example, here a failure has more information associated with it, -and we can have different kinds of failures:

                  -
                    -
                  • The operation may succeed, and return a value;
                  • -
                  • The operation may fail:
                      -
                    • Because it wasn't possible to reach the API (due to a network error, for example);
                    • -
                    • Because the return value of the API wasn't in the expected format (unable to parse);
                    • -
                    • Because the API itself returned an error (e.g.: if the request had bad data in it).
                    • -
                    -
                  • -
                  -

                  A common way of writing this in Node would be like this:

                  -
                  api.method((error, response) => {
                  -  if (error != null) {
                  -    if (error.code === "http") {
                  -      // handle network failures here
                  -    }
                  -    if (error.code === "service") {
                  -      // handle service failures here
                  -    } 
                  -  } else {
                  -    try {
                  -      var data = normalise(response);
                  -      // handle success here 
                  -    } catch(e) { 
                  -      // handle invalid responses here
                  -    }
                  -  }
                  -});
                  -

                  But again, in this style of programming it's easier to make mistakes that are hard -to catch, since we're assigning meaning through control flow in an ad-hoc manner, -and there's nothing to tell us if we've got it wrong. It's also harder to abstract, -because we can't capture these rules as data, so we have to add even more special -control flow structures to handle the abstractions.

                  -

                  Let's model it as a tagged union instead. We could make a single data structure -that captures all 4 possible results, and that would be a reasonable way of modelling -this. But on the other hand, we wouldn't be able to talk about failures in general, -because this forces us to handle each failure case independently. Instead we'll have -two tagged unions:

                  -
                  const data = require('folktale/core/adt/data');
                  -
                  -const Result = data('Result', {
                  -  Ok(value) {
                  -    return { value }; 
                  -  },
                  -  Error(reason) {
                  -    return { reason };
                  -  }
                  -});
                  -
                  -const APIError = data('APIError', {
                  -  NetworkError(error){
                  -    return { error };
                  -  },
                  -  ServiceError(code, message) {
                  -    return { code, message };
                  -  },
                  -  ParsingError(error, data) {
                  -    return { error, data };
                  -  }
                  -});
                  -

                  Then we can construct these values in the API, and make sure people will handle -all cases when using it:

                  -
                  function handleError(error) {
                  -  error.matchWith({
                  -    NetworkError: ({ error }) => { ... },
                  -    ServiceError: ({ code, message }) => { ... },
                  -    ParsingError: ({ error, data }) => { ... }
                  -  })
                  -}
                  -
                  -api.method(response => {
                  -  response.matchWith({
                  -    Error: ({ reason }) => handleError(reason),
                  -    Ok:    ({ value })  => { ... }
                  -  })
                  -});
                  -

                  Providing common functionality

                  -

                  When you're modelling data with ADTs it's tempting to create a lot of -very specific objects to capture correctly all of the choices that may -exist in a particular domain, but Core.ADT only gives you construction -and pattern matching, so what if you want your types to have a notion -of equality?

                  -

                  That's where the concept of derivation comes in. A derivation is a -function that provides a set of common functionality for an ADT and -its variants. For example, if one wanted to add the notion of equality -to an ADT, they could derive Equality as follows:

                  -
                  const data = require('folktale/core/adt/data');
                  -const Equality = require('folktale/core/adt/derivations/equality');
                  -
                  -const Either = data('Either', {
                  -  Left(value) { return { value } },
                  -  Right(value){ return { value } }
                  -}).derive(Equality);
                  -

                  Note the .derive(Equality) invocation. derive is a method that can -be called at any time on the ADT to provide new common functionality -to it. In this case, the Equality derivation gives all variants an -equals() method:

                  -
                  Either.Left(1).equals(Either.Left(1));   // ==> true
                  -Either.Left(1).equals(Either.Right(1));  // ==> false
                  -Either.Right(1).equals(Either.Right(2)); // ==> false
                  -Either.Right(2).equals(Either.Right(2)); // ==> true
                  -

                  While Core.ADT provides a set of common derivations (categorised -Derivation in the documentation), one may create their own derivation -functions to use with Folktale's ADTs. See the Extending ADTs -section for details.

                  -

                  Architecture

                  -

                  The ADT module approaches this problem in a structural-type-ish way, which -happens to be very similar to how OCaml's polymorphic variants work, and -how different values are handled in untyped languages.

                  -

                  In essence, calling data with a set of patterns results in the creation -of N constructors, each with a distinct tag.

                  -

                  Revisiting the previous List ADT example, when one writes:

                  -
                  const data = require('folktale/core/adt/data');
                  -
                  -var List = data('List', {
                  -  Nil:  () => {},
                  -  Cons: (value, rest) => ({ value, rest })
                  -})
                  -

                  That's roughly equivalent to the idiomatic:

                  -
                  var List = {};
                  -
                  -function Nil() { }
                  -Nil.prototype = Object.create(List);
                  -
                  -function Cons(value, rest) {
                  -  this.value = value;
                  -  this.rest  = rest;
                  -}
                  -Cons.prototype = Object.create(List);
                  -

                  The data function takes as arguments a type identifier (which can be any -object, if you want it to be unique), and an object with the variants. Each -property in this object is expected to be a function that returns the -properties that'll be provided for the instance of that variant.

                  -

                  The given variants are not returned directly. Instead, we return a wrapper -that will construct a proper value of this type, and augment it with the -properties provided by that variant initialiser.

                  -

                  Reflection

                  -

                  The ADT module relies on JavaScript's built-in reflective features first, -and adds a couple of additional fields to this.

                  -

                  Types and Tags

                  -

                  The provided type for the ADT, and the tag provided for the variant -are both reified in the ADT structure and the constructed values. These -allow checking the compatibility of different values structurally, which -sidesteps the problems with realms.

                  -

                  The type of the ADT is provided by the global symbol @@folktale:adt:type:

                  -
                  const data = require('folktale/core/adt/data');
                  -
                  -var Id = data('Identity', { Id: () => {} });
                  -Id[Symbol.for('@@folktale:adt:type')]
                  -// ==> 'Identity'
                  -

                  The tag of the value is provided by the global symbol @@folktale:adt:tag:

                  -
                  var List = data('List', {
                  -  Nil: () => {},
                  -  Cons: (h, t) => ({ h, t })
                  -});
                  -List.Nil()[Symbol.for('@@folktale:adt:tag')]
                  -// ==> 'Nil'
                  -

                  These symbols are also exported as properties of the data function -itself, so you can use data.typeSymbol and data.tagSymbol instead -of retrieving a symbol instance with the Symbol.for function.

                  -

                  is-a tests

                  -

                  Sometimes it's desirable to test if a value belongs to an ADT or -to a variant. Out of the box the structures constructed by ADT -provide a hasInstance check that verify if a value is structurally -part of an ADT structure, by checking the Type and Tag of that value.

                  -
                  checking if a value belongs to an ADT:
                  -
                  const data = require('folktale/core/adt/data');
                  -
                  -var IdA = data('IdA', { Id: (x) => ({ x }) });
                  -var IdB = data('IdB', { Id: (x) => ({ x }) });
                  -
                  -IdA.hasInstance(IdA.Id(1))  // ==> true
                  -IdA.hasInstance(IdB.Id(1))  // ==> false
                  -
                  checking if a value belongs to a variant:
                  -
                  const data = require('folktale/core/adt/data');
                  -
                  -var Either = data('Either', {
                  -  Left:  value => ({ value }),
                  -  Right: value => ({ value })
                  -});
                  -var { Left, Right } = Either;
                  -
                  -Left.hasInstance(Left(1));  // ==> true
                  -Left.hasInstance(Right(1)); // ==> false
                  -

                  Note that if two ADTs have the same type ID, they'll be considered -equivalent by hasInstance. You may pass an object (like -Symbol('type name')) to data to avoid this, however reference -equality does not work across realms in JavaScript.

                  -

                  Since all instances inherit from the ADT and the variant's prototype -it's also possible to use proto.isPrototypeOf(instance) to check -if an instance belongs to an ADT by reference equality, rather than -structural equality.

                  -

                  Extending ADTs

                  -

                  Because all variants inherit from the ADT namespace, it's possible -to provide new functionality to all variants by simply adding new -properties to the ADT:

                  -
                  const data = require('folktale/core/adt/data');
                  -
                  -var List = data('List', {
                  -  Nil:  () => {},
                  -  Cons: (value, rest) => ({ value, rest })
                  -});
                  -
                  -var { Nil, Cons } = List;
                  -
                  -List.sum = function() {
                  -  return this.matchWith({
                  -    Nil:  () => 0,
                  -    Cons: ({ value, rest }) => value + rest.sum()
                  -  });
                  -};
                  -
                  -Cons(1, Cons(2, Nil())).sum();
                  -// ==> 3
                  -

                  A better approach, however, may be to use the derive function from -the ADT to provide new functionality to every variant. derive accepts -many derivation functions, which are just functions taking a variant and -ADT, and providing new functionality for that variant.

                  -

                  If one wanted to define a JSON serialisation for each variant, for example, -they could do so by using the derive functionality:

                  -
                  function ToJSON(variant, adt) {
                  -  var { tag, type } = variant;
                  -  variant.prototype.toJSON = function() {
                  -    var json = { tag: `${type}:${tag}` };
                  -    Object.keys(this).forEach(key => {
                  -      var value = this[key];
                  -      if (value && typeof value.toJSON === "function") {
                  -        json[key] = value.toJSON();
                  -      } else {
                  -        json[key] = value;
                  -      }
                  -    });
                  -    return json;
                  -  }
                  -}
                  -
                  -var List = data('List', {
                  -  Nil:  () => {},
                  -  Cons: (value, rest) => ({ value, rest })
                  -}).derive(ToJSON);
                  -
                  -var { Nil, Cons } = List;
                  -
                  -Nil().toJSON()
                  -// ==> { tag: "List:Nil" }
                  -
                  -Cons(1, Nil()).toJSON()
                  -// ==> { tag: "List:Cons", value: 1, rest: { "tag": "List:Nil" }}
                  -

                  Properties

                  Supporting objects

                  ADT

                  The basis of all algebraic data types.

                  -
                  Experimental

                  (Uncategorised)

                  A Symbol.

                  -
                  Experimental

                  A Symbol.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/adt/data.js at line 157, column 0
                  (typeId, patterns) => {
                  -  const ADTNamespace = Object.create(ADT);
                  -  const variants     = defineVariants(typeId, patterns, ADTNamespace);
                  -
                  -  extend(ADTNamespace, variants, {
                  -    // This is internal, and we don't really document it to the user
                  -    [TYPE]: typeId,
                  -
                  -    /*~
                  -     * type: Array Variant
                  -     * module: null
                  -     * ~belongsTo: ADTNamespace
                  -     */
                  -    variants: values(variants),
                  -
                  -    /*~
                  -     * ~belongsTo: ADTNamespace
                  -     * module: null
                  -     * type: |
                  -     *   ADT.(Variant) -> Boolean
                  -     */
                  -    hasInstance(value) {
                  -      return Boolean(value)
                  -      &&     value[TYPE] === this[TYPE];
                  -    }
                  -  });
                  -
                  -  return ADTNamespace;
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/adt/data
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.data.derive.html b/docs/api/en/folktale.core.adt.data.derive.html deleted file mode 100644 index 96bd2ac..0000000 --- a/docs/api/en/folktale.core.adt.data.derive.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - derive - - - - - -

                  derive

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  derive(...derivations)
                  ADT . (...(Variant, ADT) => Any) => ADT

                  Documentation

                  Allows a function to provide functionality to variants in an ADT.

                  -

                  The derive method exists to support meta-programming on ADT objects, -such that additional functionality (implementation of interfaces or -protocols, for example) may be provided by libraries instead of having -to be hand-coded by the user.

                  -

                  The operation accepts many derivation functions, which will be invoked -for each variant in the ADT, where a Variant is just an object with the -following attributes:

                  -
                  interface Variant(Any...) -> 'a <: self.prototype {
                  -  tag         : String,
                  -  type        : Any,
                  -  constructor : Constructor,
                  -  prototype   : Object
                  -}
                  -

                  Properties

                  Source Code

                  derive(...derivations) {
                  -    derivations.forEach(derivation => {
                  -      this.variants.forEach(variant => derivation(variant, this));
                  -    });
                  -    return this;
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/adt/data
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.data.prototype.html b/docs/api/en/folktale.core.adt.data.prototype.html deleted file mode 100644 index 1be3683..0000000 --- a/docs/api/en/folktale.core.adt.data.prototype.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - prototype - - - - - -

                  prototype

                  The container for instance methods for Success variants of the Validation structure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  The container for instance methods for Success variants of the Validation structure.

                  -

                  Properties

                  Combining validations

                  apply()

                  If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

                  -
                  concat()

                  Combines two validations together such that failures are aggregated.

                  -

                  Comparing and testing

                  equals(value)

                  Performs a deep-comparison of two Validation values for equality.

                  -
                  Experimental
                  hasInstance(value)

                  Tests if an arbitrary value is a Validation instance.

                  -
                  ExperimentalInherited
                  get isSuccess

                  True if the value is a Success instance.

                  -
                  Deprecated

                  Constructing

                  of(value)

                  Constructs a Validation holding a Success value.

                  -
                  Inherited

                  Converting to other types

                  toMaybe()

                  Transforms a Validation into a Maybe. Failure values are lost in the process.

                  -
                  Inherited
                  toResult()

                  Transforms a Validation into a Reseult.

                  -
                  Inherited

                  Data fields

                  get value

                  The value contained in an Success instance of the Validation structure.

                  -
                  Abstract

                  Debugging

                  inspect: toString()

                  A textual representation for Validation instances.

                  -
                  Experimental
                  toString()

                  A textual representation for Validation instances.

                  -
                  Experimental

                  Extracting values

                  get()

                  This method has been renamed to unsafeGet().

                  -
                  DeprecatedInherited
                  getOrElse()

                  Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

                  -
                  merge()

                  Returns the value inside of the Validation structure, regardless of its state.

                  -
                  Inherited
                  unsafeGet()

                  Extracts the value from a Validation structure.

                  -

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/bimap(f, g)

                  Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

                  -
                  fantasy-land/concat(that)

                  Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

                  -
                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -
                  fantasy-land/map(transformation)

                  Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

                  -
                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Pattern matching

                  fold()

                  Applies a function to each case of a Validation.

                  -
                  matchWith(pattern)

                  Chooses and executes a function for each variant in the Validation structure.

                  -
                  Experimental

                  Recovering from errors

                  orElse()

                  Allows recovering from Failure values with a handler function.

                  -
                  swap()

                  Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

                  -

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

                  -
                  ExperimentalInherited
                  toJSON()

                  Converts a Validation value to a JavaScript object that may be stored as a JSON value.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor for this variant.

                  -
                  variants

                  The variants in the Validation structure.

                  -
                  ExperimentalInherited

                  Transforming

                  bimap()

                  Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

                  -
                  map()

                  Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -
                  mapFailure()

                  Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -

                  Variants

                  Failure(value)

                  Constructs a Validation whose value represents a failure.

                  -
                  ExperimentalInherited
                  Success(value)

                  Constructs a Validation whose value represents a success.

                  -
                  ExperimentalInherited

                  Source Code

                  Defined in src/core/adt/data.js at line 95, column 25
                  InternalConstructor.prototype
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/adt/data
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.derivations.debug-representation.debugrepresentation.html b/docs/api/en/folktale.core.adt.derivations.debug-representation.debugrepresentation.html deleted file mode 100644 index 2c09845..0000000 --- a/docs/api/en/folktale.core.adt.derivations.debug-representation.debugrepresentation.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - debugRepresentation - - - - - -

                  debugRepresentation

                  Provides a textual representation for ADTs.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  debugRepresentation(variant, adt)
                  (Variant, ADT) => Void

                  Documentation

                  Provides a textual representation for ADTs.

                  -

                  The debugRepresentation serialisation bestows ES2015's Symbol.toStringTag, used -for the native Object.prototype.toString, along with a .toString() -method and Node's REPL .inspect() method.

                  -

                  Example:

                  -
                  const { data, derivations } = require('folktale/core/adt');
                  -const { Id } = data('Id', {
                  -  Id(value){ return { value } }
                  -}).derive(derivations.debugRepresentation);
                  -
                  -Object.prototype.toString.call(Id(1));
                  -// => '[object Id.Id]'
                  -
                  -Id(1).toString();
                  -// ==> 'Id.Id({ value: 1 })'
                  -
                  -Id(1).inspect();
                  -// ==> 'Id.Id({ value: 1 })'
                  -

                  ES2015's ToStringTag

                  -

                  This derivation defines ES2015's ToStringTag symbol, which is used -by Object.prototype.toString to construct a default textual -representation of the object.

                  -

                  This means that instead of getting '[object Object]', you'll get -a more helpful '[object <Type>.<Tag>]' representation, where this -function is used.

                  -

                  Textual representation

                  -

                  This derivation defines a .toString() method. .toString is called -in many places to define how to represent an object, but also called -when JS operators want to convert an object to a String. This derivation -only cares about representation that's suitable for debugging.

                  -

                  The representation includes the type, tag, and key/value pairs of the -data structure.

                  -

                  Node REPL representation

                  -

                  Node's REPL uses .inspect() instead of the regular .toString(). -This derivation also provides the .inspect() method, but just as -an alias for the .toString() method.

                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/derivations/debug-representation.js at line 82, column 0
                  (variant, adt) => {  // eslint-disable-line max-statements
                  -  const typeName    = adt[typeSymbol];
                  -  const variantName = `${adt[typeSymbol]}.${variant.prototype[tagSymbol]}`;
                  -
                  -  // (for Object.prototype.toString)
                  -  adt[Symbol.toStringTag]               = typeName;
                  -  variant.prototype[Symbol.toStringTag] = variantName;
                  -
                  -  // (regular JavaScript representations)
                  -  /*~
                  -   * stability: experimental
                  -   * module: null
                  -   * authors:
                  -   *   - "@boris-marinov"
                  -   * 
                  -   * type: |
                  -   *   () => String
                  -   */
                  -  adt.toString = () => typeName;
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * mmodule: null
                  -   * authors:
                  -   *   - "@boris-marinov"
                  -   * 
                  -   * type: |
                  -   *   () => String
                  -   */
                  -  variant.toString = () => variantName;
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * module: null
                  -   * authors:
                  -   *   - "@boris-marinov"
                  -   * 
                  -   * type: |
                  -   *   (ADT).() => String
                  -   */
                  -  variant.prototype.toString = function() {
                  -    return `${variantName}(${plainObjectToString.call(this)})`;
                  -  };
                  -
                  -  // (Node REPL representations)
                  -  adt.inspect                = adt.toString;
                  -  variant.inspect            = variant.toString;
                  -  variant.prototype.inspect  = variant.prototype.toString;
                  -
                  -  return variant;
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/adt/derivations/debug-representation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.derivations.equality.equality.html b/docs/api/en/folktale.core.adt.derivations.equality.equality.html deleted file mode 100644 index e78869a..0000000 --- a/docs/api/en/folktale.core.adt.derivations.equality.equality.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - createDerivation - - - - - -

                  createDerivation

                  Provides structural equality for ADTs.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  createDerivation(valuesEqual)
                  (Variant, ADT) => Void

                  Documentation

                  Provides structural equality for ADTs.

                  -

                  The equality derivation bestows Fantasy Land's fantasy-land/equals -method upon ADTs constructed by Core.ADT, as well as an equals -alias. This equals method performs structural equality, and may -be configured on how to compare values that don't implement Equality.

                  -

                  Example:

                  -
                  const { data, derivations } = require('folktale/core/adt');
                  -const Result = data('Result', {
                  -  Ok(value){
                  -    return { value };
                  -  },
                  -  Error(value) {
                  -    return { value };
                  -  }
                  -}).derive(derivations.equality);
                  -const { Ok, Error } = Result;
                  -
                  -Ok(1).equals(Ok(1));
                  -// ==> true
                  -
                  -Ok(1).equals(Error(1));
                  -// ==> false
                  -
                  -Error(Error(1)).equals(Error(Error(1)));
                  -// ==> true
                  -

                  Structural equality

                  -

                  The equals method provided by this derivation checks for structural -equivalence. That is, two values are considered equal if they have the -same content.

                  -

                  For simple ADTs this is pretty easy to see. For example, consider the -following definition:

                  -
                  const { data, derivations } = require('folktale/core/adt');
                  -const Id = data('Id', {
                  -  Id(value){ return { value } }
                  -}).derive(derivations.equality);
                  -
                  -const a = Id.Id(1);
                  -const b = Id.Id(1);
                  -

                  Here we have an ADT with a single case, Id, and we've made two -instances of this data structure, each containing the value 1. -However, if we try to compare them using JavaScript standard -operators, we'll not be comparing their contents, but rather whether -or not they are the same object:

                  -
                  a === a; // ==> true
                  -b === b; // ==> true
                  -a === b; // ==> false
                  -

                  So a === b is false, even though both a and b have the same -contents. This is because === compares values by their identity, -and each object has a different identity.

                  -

                  If we want to compare things by value, we can use the equals method -provided by this equality derivation instead:

                  -
                  a.equals(b);        // ==> true
                  -a.equals(a);        // ==> true
                  -a.equals(Id.Id(2)); // ==> false
                  -

                  When comparing with the equals method, two values are considered -equal if they represent the same value. This is called structural -equality.

                  -

                  Equality in detail

                  -

                  Given two data structures, they are considered equal if:

                  -
                    -
                  • They have the same type;
                  • -
                  • They have the same tag;
                  • -
                  • They have the same keys, and these keys have the same values;
                  • -
                  -

                  The following example shows these in practice:

                  -
                  const { data, derivations } = require('folktale/core/adt');
                  -
                  -//                    ┌◦ TYPE
                  -//                  ┌╌┴╌╌╌╌┐
                  -const Result = data('Result', {
                  -//  ┌◦ TAG             ┌◦ KEYS
                  -// ┌┴┐               ┌╌┴╌╌╌╌╌┐
                  -   Ok(value){ return { value } },
                  -
                  -//   ┌◦ TAG               ┌◦ KEYS
                  -// ┌╌┴╌┐                ┌╌┴╌╌╌╌╌┐
                  -   Error(value){ return { value } }
                  -}).derive(derivations.equality);
                  -
                  -const { Ok, Error } = Result;
                  -

                  So here we have the Result ADT. Values created from this ADT always -have the same type: "Result". A type is expected to be unique within -all ADTs in a program:

                  -
                  Ok(1)[data.typeSymbol];    // ==> 'Result'
                  -Error(1)[data.typeSymbol]; // ==> 'Result'
                  -

                  Each variant has its own tag, which is the name you give to the -constructor. A tag is unique within an ADT, but not necessarily unique -amongst other ADTs:

                  -
                  Ok(1)[data.tagSymbol];     // ==> 'Ok'
                  -Error(1)[data.tagSymbol];  // ==> 'Error'
                  -

                  Finally, the keys in an ADT are the same as the keys which the constructor -returns. So, in this case, both Ok and Error have [value] as the key:

                  -
                  Object.keys(Ok(1));    // ==> ['value']
                  -Object.keys(Error(1)); // ==> ['value']
                  -

                  So if we compare these two for equality:

                  -
                  Ok(1).equals(Ok(1)); // ==> true
                  -// same type, tag, keys and values.
                  -
                  -Ok(1).equals(Ok(2)); // ==> false
                  -// same type, tag, and keys. Different values (1 !== 2).
                  -
                  -Ok(1).equals(Error(1)); // ==> false
                  -// same type, keys, and values. Different tags ('Ok' !== 'Error').
                  -
                  -const { Error: E } = data('Res', {
                  -  Error(value){ return { value } }
                  -}).derive(derivations.equality);
                  -
                  -E(1).equals(Error(1)); // ==> false
                  -// same tag, keys, and values. Different types ('Result' !== 'Res')
                  -

                  How complex equality works?

                  -

                  The values in an ADT aren't always JS primitives, such as numbers and -strings. Equality's equals method handles these in two different ways:

                  -
                    -
                  • If the values implement Equality, then the values are compared using the -left's equals method. This means that if all values implement Equality -or are primitives, deep equality just works.

                    -
                  • -
                  • If the values do not implement Equality, the provided equality comparison is -used to compare both values. By default, this comparison tests plain objects -and arrays structurally, and all other values with ===.

                    -
                  • -
                  -

                  Here's an example:

                  -
                  const { data, derivations } = require('folktale/core/adt');
                  -const { Id } = data('Id', {
                  -  Id(value){ return { value } }
                  -}).derive(derivations.equality);
                  -
                  -// This is fine, because all values implement Equality or are primitives
                  -Id(Id(1)).equals(Id(Id(1))); // ==> true
                  -
                  -// This is not fine, because they're arrays
                  -Id([1]).equals(Id([1])); // ==> true
                  -
                  -// This is fine, because they're plain objects
                  -Id({ a: 1 }).equals(Id({ a: 1 })); // ==> true
                  -
                  -const { Other } = data('Other', { 
                  -  Other(value) { return { value } }
                  -});
                  -
                  -// This isn't fine, because they're not plain objects
                  -Id({ value: 1 }).equals(Id(Other(1))); // ==> false
                  -

                  A plain object is any object that doesn't overwrite the .toString -or Symbol.toStringTag properties.

                  -

                  To handle complex JS values, one must provide their own deep equality -function. Folktale does not have a deep equality function yet, but -most functional libraries have an equals function for that.

                  -

                  Here's an example of an equality function that checks array equality:

                  -
                  const isEqual = (a, b) =>
                  -  Array.isArray(a) && Array.isArray(b) ?  arrayEquals(a, b)
                  -: a == null                            ?  a === b
                  -: a['fantasy-land/equals']             ?  a['fantasy-land/equals'](b)
                  -: a.equals                             ?  a.equals(b)
                  -:                                         a === b;
                  -
                  -const arrayEquals = (a, b) =>
                  -   Array.isArray(a) && Array.isArray(b)
                  -&& a.length === b.length
                  -&& a.every((x, i) => isEqual(x, b[i]));
                  -
                  -const { Id: Id2 } = data('Id', {
                  -  Id(value){ return { value } }
                  -}).derive(derivations.equality.withCustomComparison(isEqual));
                  -
                  -Id2([1]).equals(Id2([1]));       // ==> true
                  -Id2(Id2(1)).equals(Id2(Id2(1))); // ==> true
                  -Id2(2).equals(Id2(1));           // ==> false
                  -

                  Equality and the asymmetry problem:

                  -

                  Because the equals method is defined directly in objects, -and invoked using the method call syntax, it creates an asymmetry -problem. That is, if there are two objects, a and b, then -a equals b is not the same as b equals a, since the equals -method may be different on those objects!

                  -

                  Here's an example of the asymmetry problem:

                  -
                  const { data, derivations } = require('folktale/core/adt');
                  -const { Id } = data('Id', {
                  -  Id(value){ return { value } }
                  -}).derive(derivations.equality);
                  -
                  -const bogus = {
                  -  equals(that){ return that.value === this.value },
                  -  value: 1
                  -};
                  -
                  -// This is what you expect
                  -Id(1).equals(bogus); // ==> false
                  -
                  -// And so is this
                  -Id(Id(1)).equals(Id(bogus)); // ==> false
                  -
                  -// But this is not
                  -Id(bogus).equals(Id(Id(1))); // ==> true
                  -

                  To avoid this problem all Equality implementations should do type -checking and make sure that they have the same equals method. -Equality implementations derived by this derivation do so by -checking the type and tag of the ADTs being compared.

                  -

                  Performance considerations

                  -

                  There are no optimisations for deep equality provided by this method, -thus you should expect it to visit every value starting from the root. -This can be quite expensive for larger data structures.

                  -

                  If you expect to be working with larger data structures, and check -equality between them often, you are, usually, very out of luck. You -may consider providing your own Equality implementation with the following -optimisations:

                  -
                    -
                  • If two objects are the same reference, you don't need to check -them structurally, for they must be equal — Equality's .equals -does this, but if you're providing your own equality function, -you must do it there as well;

                    -
                  • -
                  • If two objects have the same type, but different hashes, then -they must have different values (assuming you haven't messed up -your hash function);

                    -
                  • -
                  • If two objects have the same type, and the same hashes, then they -might be equal, but you can't tell without looking at all of its -values.

                    -
                  • -
                  -

                  Here's an example of this optimisation applied to linked lists that -can only hold numbers (with a very naive hash function):

                  -
                  const hash = Symbol('hash code');
                  -const { data, derivations } = require('folktale/core/adt');
                  -
                  -const { Cons, Nil } = data('List', {
                  -  Nil(){ return { [hash]: 0 } },
                  -  Cons(value, rest) {
                  -    return {
                  -      [hash]: value + rest[hash],
                  -      value, rest
                  -    }
                  -  }
                  -});
                  -
                  -Nil.prototype.equals = function(that) {
                  -  return Nil.hasInstance(that);
                  -}
                  -
                  -Cons.prototype.equals = function(that) {
                  -  if (this === that)              return true
                  -  if (!Cons.hasInstance(that))    return false
                  -  if (this[hash] !== that[hash])  return false
                  -
                  -  return this.value === that.value
                  -  &&     this.rest.equals(that.rest)
                  -}
                  -
                  -const a = Cons(1, Cons(2, Cons(3, Nil())));
                  -const b = Cons(1, Cons(2, Cons(3, Nil())));
                  -const c = Cons(1, b);
                  -
                  -a.equals(b); // ==> true
                  -a.equals(c); // ==> false
                  -
                  -

                  NOTE:
                  You should use a suitable hashing algorithm for your data structures.

                  -
                  -

                  Properties

                  (Uncategorised)

                  Experimental

                  Source Code

                  Defined in src/core/adt/derivations/equality.js at line 83, column 0
                  (valuesEqual) => {
                  -  /*~
                  -   * type: ('a, 'a) => Boolean
                  -   */
                  -  const equals = (a, b) => {
                  -    // identical objects must be equal
                  -    if (a === b)  return true;
                  -
                  -    // we require both values to be setoids if one of them is
                  -    const leftSetoid  = isSetoid(a);
                  -    const rightSetoid = isSetoid(b);
                  -    if (leftSetoid) {
                  -      if (rightSetoid)  return flEquals(a, b);
                  -      else              return false;
                  -    }
                  -
                  -    // fall back to the provided equality
                  -    return valuesEqual(a, b);
                  -  };
                  -
                  -
                  -  /*~
                  -   * type: (Object Any, Object Any, Array String) => Boolean
                  -   */
                  -  const compositesEqual = (a, b, keys) => {
                  -    for (let i = 0; i < keys.length; ++i) {
                  -      const keyA = a[keys[i]];
                  -      const keyB = b[keys[i]];
                  -      if (!(equals(keyA, keyB))) {
                  -        return false;
                  -      }
                  -    }
                  -    return true;
                  -  };
                  -
                  -
                  -  const derivation = (variant, adt) => {
                  -    /*~
                  -     * stability: experimental
                  -     * module: null
                  -     * authors:
                  -     *   - "@boris-marinov"
                  -     *   - Quildreen Motta
                  -     * 
                  -     * type: |
                  -     *   forall S, a:
                  -     *     (S a).(S a) => Boolean
                  -     *   where S is Setoid
                  -     */
                  -    variant.prototype.equals = function(value) {
                  -      assertType(adt)(`${this[tagSymbol]}#equals`, value);
                  -      return sameType(this, value) && compositesEqual(this, value, Object.keys(this));
                  -    };
                  -    provideAliases(variant.prototype);
                  -    return variant;
                  -  };
                  -  copyDocs(createDerivation, derivation, {
                  -    type: '(Variant, ADT) => Void'
                  -  });
                  -
                  -
                  -  return derivation;
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/adt/derivations/equality
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.derivations.html b/docs/api/en/folktale.core.adt.derivations.html deleted file mode 100644 index 09642e9..0000000 --- a/docs/api/en/folktale.core.adt.derivations.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - module folktale/core/adt/derivations - - - - - -

                  module folktale/core/adt/derivations

                  Pre-built derivations for Folktale ADTs.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  Pre-built derivations for Folktale ADTs.

                  -

                  Properties

                  Derivations

                  debugRepresentation(variant, adt)

                  Provides a textual representation for ADTs.

                  -
                  Experimental
                  equality: createDerivation(valuesEqual)

                  Provides structural equality for ADTs.

                  -
                  Experimental
                  serialization(variant, adt)

                  Provides JSON serialisation and parsing for ADTs.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/adt/derivations/index.js at line 14, column 0
                  {
                  -  serialization: require('./serialization'),
                  -  equality: require('./equality'),
                  -  debugRepresentation: require('./debug-representation')
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/adt/derivations
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.derivations.serialization.serialization.html b/docs/api/en/folktale.core.adt.derivations.serialization.serialization.html deleted file mode 100644 index 4f05f68..0000000 --- a/docs/api/en/folktale.core.adt.derivations.serialization.serialization.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - serialization - - - - - -

                  serialization

                  Provides JSON serialisation and parsing for ADTs.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  serialization(variant, adt)
                  (Variant, ADT) => Void

                  Documentation

                  Provides JSON serialisation and parsing for ADTs.

                  -

                  The serialization derivation bestows .toJSON() and .fromJSON(value) -upon ADTs constructed by Core.ADT. Both serialisation and parsing -are recursive, and .fromJSON can automatically reify values of -other types.

                  -

                  Example:

                  -
                  const { data, derivations } = require('folktale/core/adt');
                  -const Id = data('Id', {
                  -  Id(value){ return { value } }
                  -}).derive(
                  -  derivations.serialization,
                  -  derivations.equality
                  -);
                  -
                  -Id.Id(1).toJSON();
                  -// ==> { '@@type': 'Id', '@@tag': 'Id', '@@value': { value: 1 } }
                  -
                  -Id.fromJSON(Id.Id(1).toJSON());
                  -// ==> Id.Id(1)
                  -

                  JSON serialisation

                  -

                  This derivation provides JSON serialisation through the .toJSON method, -which converts rich ADTs into objects that can be safely serialised as -JSON. For example:

                  -
                  const { data, derivations } = require('folktale/core/adt');
                  -
                  -const { Id } = data('Id', {
                  -  Id(value){ return { value } }
                  -}).derive(derivations.serialization);
                  -
                  -Id(1).toJSON();
                  -// ==> { '@@type': 'Id', '@@tag': 'Id', '@@value': { value: 1 } }
                  -

                  During the transformation, if any of the values contains a .toJSON -method, that's called to serialise the structure. Otherwise the value is -just returned as-is:

                  -
                  Id(Id(1)).toJSON();
                  -// ==> { '@@type': 'Id', '@@tag': 'Id', '@@value': { value: { '@@type': 'Id', '@@tag': 'Id', '@@value': { 'value': 1 } } } }
                  -

                  It's not necessary to call the .toJSON() method directly in most cases, since -JSON.stringify will already invoke that for you:

                  -
                  JSON.stringify(Id(1));
                  -// ==> '{"@@type":"Id","@@tag":"Id","@@value":{"value":1}}'
                  -
                  -JSON.stringify(Id([Id(1)]));
                  -// ==> '{"@@type":"Id","@@tag":"Id","@@value":{"value":[{"@@type":"Id","@@tag":"Id","@@value":{"value":1}}]}}'
                  -

                  JSON parsing

                  -

                  The reverse process of serialisation is parsing, and the .fromJSON method -provided by this derivation is able to reconstruct the proper ADT from -serialised data:

                  -
                  const { data, derivations } = require('folktale/core/adt');
                  -
                  -const Id = data('Id', {
                  -  Id(value){ return { value } }
                  -}).derive(
                  -  derivations.serialization,
                  -  derivations.equality
                  -);
                  -
                  -const json = Id.Id(1).toJSON();
                  -Id.fromJSON(json);
                  -// ==> Id.Id(1)
                  -

                  In general, as long as the values in an ADT are either ADT instances or simple -values supported by JSON, the following equivalence holds:

                  -
                  ADT.fromJSON(adt.toJSON()) = adt
                  -

                  Some ADTs instances may contain other ADT instances as values. Serialising them -is simple because JavaScript's dispatch takes care of selecting the correct -serialisation for us. With parsing we don't have that luck, so instead the -ADT takes a list of parsers as argument:

                  -
                  const A = data('A', { 
                  -  A(value) { return { value } }
                  -}).derive(
                  -  derivations.serialization,
                  -  derivations.equality
                  -);
                  -
                  -const B = data('B', {
                  -  B(value) { return { value } }
                  -}).derive(
                  -  derivations.serialization,
                  -  derivations.equality
                  -);
                  -
                  -A.fromJSON(A.A(B.B(1)).toJSON(), [A, B]);
                  -// ==> A.A(B.B(1))
                  -

                  The serialisation format

                  -

                  In order to support the serialisation and parsing of ADTs, this module -uses a specific format that encodes that information in the serialised -data. This way, .toJSON() produces values of this interface, and -.fromJSON(value) expects values of this interface:

                  -
                  type JSONSerialisation = {
                  -  "@@type":  String,
                  -  "@@tag":   String,
                  -  "@@value": Object Any
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/core/adt/derivations/serialization.js at line 106, column 0
                  (variant, adt) => {
                  -  const typeName = adt[typeSymbol];
                  -  const tagName = variant.prototype[tagSymbol];
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * module: null
                  -   * authors:
                  -   *   - "@boris-marinov"
                  -   * 
                  -   * type: |
                  -   *   type JSONSerialisation = {
                  -   *     "@@type":  String,
                  -   *     "@@tag":   String,
                  -   *     "@@value": Object Any
                  -   *   }
                  -   * 
                  -   *   Variant . () => JSONSerialisation
                  -   */
                  -  variant.prototype.toJSON = function() {
                  -    return { 
                  -      [typeJsonKey]:  typeName, 
                  -      [tagJsonKey]:   tagName, 
                  -      [valueJsonKey]: mapValues(this, serializeValue) 
                  -    };
                  -  };
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * module: null
                  -   * authors:
                  -   *   - "@boris-marinov"
                  -   * 
                  -   * type: |
                  -   *   type JSONSerialisation = {
                  -   *     "@@type":  String,
                  -   *     "@@tag":   String,
                  -   *     "@@value": Object Any
                  -   *   }
                  -   *   type JSONParser = {
                  -   *     fromJSON: (JSONSerialisation, Array JSONParser) => Variant
                  -   *   }
                  -   * 
                  -   *   (JSONSerialisation, Array JSONParser) => Variant
                  -   */
                  -  adt.fromJSON = function(value, parsers = { [typeName]: adt }, keysIndicateType = false) {
                  -    const valueTypeName = value[typeJsonKey];
                  -    const valueTagName = value[tagJsonKey];
                  -    const valueContents = value[valueJsonKey];
                  -    assertType(typeName, valueTypeName);
                  -    const parsersByType = keysIndicateType ? parsers
                  -          : /*otherwise*/                    indexByType(values(parsers));
                  -
                  -    const parsedValue = mapValues(valueContents, parseValue(parsersByType));
                  -    return extend(Object.create(adt[valueTagName].prototype), parsedValue);
                  -  };
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/adt/derivations/serialization
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.adt.html b/docs/api/en/folktale.core.adt.html deleted file mode 100644 index 8f3fbce..0000000 --- a/docs/api/en/folktale.core.adt.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - module folktale/core/adt - - - - - -

                  module folktale/core/adt

                  Provides utilities to define tagged unions.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  Provides utilities to define tagged unions.

                  -

                  Programming with Tagged Unions

                  -

                  Modelling data is important for a range of reasons. From performance -to correctness to safety. Tagged unions give you a way of modelling -choices that forces the correct handling of them, unlike predicate-based -branching, such as the one used by if statements and other common -control flow structures.

                  -

                  Most of the structures provided by Folktale are tagged unions. But -Folktale also gives you a primitive for constructing new ones in an -easy way. The data function provided by this module achieves that -goal:

                  -
                  const data = require('folktale/core/adt/data');
                  -
                  -const Maybe = data('Maybe', {
                  -  Some(value){ return { value } },
                  -  None() { return {} }
                  -});
                  -
                  -Maybe.Some(1).matchWith({
                  -  Some: ({ value }) => `Found ${value}`,
                  -  None: ()          => "Not found" 
                  -});
                  -// ==> "Found 1"
                  -

                  Tagged unions constructed by this module allow one to easily bestow -common functionality in them through the derive function. For example, -one could add the concept of equality to the Maybe data structure -constructed previously by using the Equality derivation, which is also -provided by this module:

                  -
                  const Equality = require('folktale/core/adt/derivations/equality');
                  -Maybe.derive(Equality);
                  -
                  -Maybe.Some(1).equals(Maybe.Some(1)); // ==> true
                  -Maybe.Some(2).equals(Maybe.Some(1)); // ==> false
                  -

                  These structures also provide a way of testing if a value belongs to -an ADT in a cross-realm way using the .hasInstance method on the ADT -or variant:

                  -
                  Maybe.hasInstance(Maybe.None());       // ==> true
                  -Maybe.Some.hasInstance(Maybe.None());  // ==> false
                  -Maybe.Some.hasInstance(Maybe.Some(1)); // ==> true
                  -

                  See the documentation on the data function for details.

                  -

                  What's in Core.ADT?

                  -

                  Core.ADT provides features to construct tagged unions, and common -derivations for those structures. These operations are divided as -follows:

                  -
                    -
                  • Constructing Data Structures: functions that construct new -tagged unions.

                    -
                  • -
                  • Extending ADTs: functions that allow one to extend existing -ADTs and variants with new functionality.

                    -
                  • -
                  • Derivation: functions that can be used as derivations to -provide common functionality to ADTs.

                    -
                  • -
                  -

                  Properties

                  Data structures

                  data(typeId, patterns)

                  Constructs a tagged union data structure.

                  -
                  Experimental

                  Derivations

                  derivations

                  Pre-built derivations for Folktale ADTs.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/adt/index.js at line 14, column 0
                  {
                  -  data: require('./data'),
                  -  derivations: require('./derivations')
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/adt
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.apply.apply.html b/docs/api/en/folktale.core.fantasy-land.apply.apply.html deleted file mode 100644 index 5085c7e..0000000 --- a/docs/api/en/folktale.core.fantasy-land.apply.apply.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - apply - - - - - -

                  apply

                  Applies the function inside an applicative to the value of another applicative.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  apply(applicativeFunction, applicativeValue)
                  forall F, a, b:
                  -  (F (a) => b, F a) => F b
                  -where F is Apply

                  Documentation

                  Applies the function inside an applicative to the value of another applicative.

                  -

                  Properties

                  Convenience

                  curried()

                  Applies the function inside an applicative to the value of another applicative.

                  -
                  Experimental
                  infix(applicativeValue)

                  Applies the function inside an applicative to the value of another applicative.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/apply.js at line 29, column 0
                  (applicativeFunction, applicativeValue) =>
                  -  isNew(applicativeValue)    ?  applicativeValue[ap](applicativeFunction)
                  -: isOld(applicativeFunction) ?  warn(applicativeFunction.ap(applicativeValue))
                  -: /*otherwise*/                 unsupported(applicativeFunction)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/apply
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.apply.curried.html b/docs/api/en/folktale.core.fantasy-land.apply.curried.html deleted file mode 100644 index fbc305e..0000000 --- a/docs/api/en/folktale.core.fantasy-land.apply.curried.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - curried - - - - - -

                  curried

                  Applies the function inside an applicative to the value of another applicative.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall F, a, b:
                  -  (F (a) => b) => (F a) => F b
                  -where F is Apply

                  Documentation

                  Applies the function inside an applicative to the value of another applicative.

                  -

                  Properties

                  Source Code

                  curry(2, apply)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/apply
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.apply.infix.html b/docs/api/en/folktale.core.fantasy-land.apply.infix.html deleted file mode 100644 index daa3d7a..0000000 --- a/docs/api/en/folktale.core.fantasy-land.apply.infix.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - infix - - - - - -

                  infix

                  Applies the function inside an applicative to the value of another applicative.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  infix(applicativeValue)
                  forall F, a, b:
                  -  (F (a) => b).(F a) => F b
                  -where F is Apply

                  Documentation

                  Applies the function inside an applicative to the value of another applicative.

                  -

                  Properties

                  Source Code

                  function(applicativeValue) {
                  -  return apply(this, applicativeValue);
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/apply
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.bimap.bimap.html b/docs/api/en/folktale.core.fantasy-land.bimap.bimap.html deleted file mode 100644 index 71c79df..0000000 --- a/docs/api/en/folktale.core.fantasy-land.bimap.bimap.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - bimap - - - - - -

                  bimap

                  Maps one function over each side of a Bifunctor.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  bimap(bifunctor, transformLeft, transformRight)
                  forall F, a, b, c, d:
                  -  (F a b, (a) => c, (b) => d) => F c d
                  -where F is Bifunctor

                  Documentation

                  Maps one function over each side of a Bifunctor.

                  -

                  Properties

                  Convenience

                  curried()

                  Maps one function over each side of a Bifunctor.

                  -
                  Experimental
                  infix(transformLeft, transformRight)

                  Maps one function over each side of a Bifunctor.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/bimap.js at line 31, column 0
                  (bifunctor, transformLeft, transformRight) =>
                  -  isNew(bifunctor) ?  bifunctor[flBimap](transformLeft, transformRight)
                  -: isOld(bifunctor) ?  warn(bifunctor.bimap(transformLeft, transformRight))
                  -: /*otherwise*/       unsupported(bifunctor)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/bimap
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.bimap.curried.html b/docs/api/en/folktale.core.fantasy-land.bimap.curried.html deleted file mode 100644 index 4e4110e..0000000 --- a/docs/api/en/folktale.core.fantasy-land.bimap.curried.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - curried - - - - - -

                  curried

                  Maps one function over each side of a Bifunctor.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall F, a, b, c, d:
                  -  ((a) => c) => ((b) => d) => (F a b) => F c d
                  -where F is Bifunctor

                  Documentation

                  Maps one function over each side of a Bifunctor.

                  -

                  Properties

                  Source Code

                  curry(3, (transformLeft, transformRight, bifunctor) =>    // eslint-disable-line no-magic-numbers
                  -  bimap(bifunctor, transformLeft, transformRight)
                  -)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/bimap
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.bimap.infix.html b/docs/api/en/folktale.core.fantasy-land.bimap.infix.html deleted file mode 100644 index 8d13bc6..0000000 --- a/docs/api/en/folktale.core.fantasy-land.bimap.infix.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - infix - - - - - -

                  infix

                  Maps one function over each side of a Bifunctor.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  infix(transformLeft, transformRight)
                  forall F, a, b, c, d:
                  -  (F a b).((a) => c, (b) => d) => F c d
                  -where F is Bifunctor

                  Documentation

                  Maps one function over each side of a Bifunctor.

                  -

                  Properties

                  Source Code

                  function(transformLeft, transformRight) {
                  -  return bimap(this, transformLeft, transformRight);
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/bimap
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.chain.chain.html b/docs/api/en/folktale.core.fantasy-land.chain.chain.html deleted file mode 100644 index df059c2..0000000 --- a/docs/api/en/folktale.core.fantasy-land.chain.chain.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - chain - - - - - -

                  chain

                  Transforms a monad with an unary function.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  chain(monad, transformation)
                  forall C, a, b:
                  -  (C a, (a) => C b) => C b
                  -where C is Chain

                  Documentation

                  Transforms a monad with an unary function.

                  -

                  Properties

                  Convenience

                  curried()

                  Transforms a monad with an unary function.

                  -
                  Experimental
                  infix(transformation)

                  Transforms a monad with an unary function.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/chain.js at line 30, column 0
                  (monad, transformation) =>
                  -  isNew(monad) ?  monad[flChain](transformation)
                  -: isOld(monad) ?  warn(monad.chain(transformation))
                  -: /*otherwise*/   unsupported(monad)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/chain
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.concat.concat.html b/docs/api/en/folktale.core.fantasy-land.concat.concat.html deleted file mode 100644 index f2cfbe4..0000000 --- a/docs/api/en/folktale.core.fantasy-land.concat.concat.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - concat - - - - - -

                  concat

                  Joins two semigroups.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  concat(semigroupLeft, semigroupRight)
                  forall S, a:
                  -  (S a, S a) => S a
                  -where S is Semigroup

                  Documentation

                  Joins two semigroups.

                  -

                  Properties

                  Convenience

                  curried()

                  Joins two semigroups.

                  -
                  Experimental
                  infix(aSemigroup)

                  Joins two semigroups.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/concat.js at line 30, column 0
                  (semigroupLeft, semigroupRight) =>
                  -  isNewSemigroup(semigroupLeft) ?  semigroupLeft[flConcat](semigroupRight)
                  -: isOldSemigroup(semigroupLeft) ?  warn(semigroupLeft.concat(semigroupRight))
                  -: /*otherwise*/                    unsupported(semigroupLeft)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/concat
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.curried.html b/docs/api/en/folktale.core.fantasy-land.curried.html deleted file mode 100644 index a57e99b..0000000 --- a/docs/api/en/folktale.core.fantasy-land.curried.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - module folktale/core/fantasy-land/curried - - - - - -

                  module folktale/core/fantasy-land/curried

                  Curried versions of the fantasy-land functions.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  Curried versions of the fantasy-land functions.

                  -

                  Properties

                  Convenience

                  apply()

                  Applies the function inside an applicative to the value of another applicative.

                  -
                  Experimental
                  bimap()

                  Maps one function over each side of a Bifunctor.

                  -
                  Experimental
                  chain()

                  Transforms a monad with an unary function.

                  -
                  Experimental
                  concat()

                  Joins two semigroups.

                  -
                  Experimental
                  empty()

                  Returns the identity object for a monoid.

                  -
                  Experimental
                  equals()

                  Compares two setoids for equality.

                  -
                  Experimental
                  map()

                  Transforms the contents of a Functor.

                  -
                  Experimental
                  of()

                  Constructs an applicative containing the given value.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/curried.js at line 15, column 0
                  {
                  -  apply: require('./apply').curried,
                  -  bimap: require('./bimap').curried,
                  -  chain: require('./chain').curried,
                  -  concat: require('./concat').curried,
                  -  empty: require('./empty').curried,
                  -  equals: require('./equals').curried,
                  -  map: require('./map').curried,
                  -  of: require('./of').curried
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/curried
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.empty.empty.html b/docs/api/en/folktale.core.fantasy-land.empty.empty.html deleted file mode 100644 index 136010b..0000000 --- a/docs/api/en/folktale.core.fantasy-land.empty.empty.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - empty - - - - - -

                  empty

                  Returns the identity object for a monoid.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  empty(monoid)
                  forall M, a:
                  -  (M) => M a
                  -where M is Monoid

                  Documentation

                  Returns the identity object for a monoid.

                  -

                  Properties

                  Convenience

                  curried()

                  Returns the identity object for a monoid.

                  -
                  Experimental
                  infix()

                  Returns the identity object for a monoid.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/empty.js at line 33, column 0
                  (monoid) =>
                  -  isNew(monoid)     ?  monoid[flEmpty]()
                  -: isCtorNew(monoid) ?  monoid.constructor[flEmpty]()
                  -: isOld(monoid)     ?  warn(monoid.empty())
                  -: isCtorOld(monoid) ?  warn(monoid.constructor.empty())
                  -: /*otherwise*/        unsupported(monoid)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/empty
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.equals.equals.html b/docs/api/en/folktale.core.fantasy-land.equals.equals.html deleted file mode 100644 index 7038650..0000000 --- a/docs/api/en/folktale.core.fantasy-land.equals.equals.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - equals - - - - - -

                  equals

                  Compares two setoids for equality.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  equals(setoidLeft, setoidRight)
                  forall S, a:
                  -  (S a, S a) => Boolean
                  -where S is Setoid

                  Documentation

                  Compares two setoids for equality.

                  -

                  Properties

                  Convenience

                  curried()

                  Compares two setoids for equality.

                  -
                  Experimental
                  infix(aSetoid)

                  Compares two setoids for equality.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/equals.js at line 31, column 0
                  (setoidLeft, setoidRight) =>
                  -  isNew(setoidLeft) ?  setoidLeft[flEquals](setoidRight)
                  -: isOld(setoidLeft) ?  warn(setoidLeft.equals(setoidRight))
                  -: /*otherwise*/        unsupported(setoidLeft)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/equals
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.html b/docs/api/en/folktale.core.fantasy-land.html deleted file mode 100644 index 972b05e..0000000 --- a/docs/api/en/folktale.core.fantasy-land.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - module folktale/core/fantasy-land - - - - - -

                  module folktale/core/fantasy-land

                  Allows invoking methods of Fantasy Land structures without -worrying about the differences in multiple versions of the spec.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  Allows invoking methods of Fantasy Land structures without -worrying about the differences in multiple versions of the spec.

                  -

                  Properties

                  Applicative

                  apply(applicativeFunction, applicativeValue)

                  Applies the function inside an applicative to the value of another applicative.

                  -
                  Experimental
                  of(applicative, value)

                  Constructs an applicative containing the given value.

                  -
                  Experimental

                  Bifunctor

                  bimap(bifunctor, transformLeft, transformRight)

                  Maps one function over each side of a Bifunctor.

                  -
                  Experimental

                  Convenience

                  curried

                  Curried versions of the fantasy-land functions.

                  -
                  Experimental
                  infix

                  Method versions of the fantasy-land functions, supporting the -structure::fn(...) syntax.

                  -
                  Experimental

                  Functor

                  map(functor, transformation)

                  Transforms the contents of a Functor.

                  -
                  Experimental

                  Monad

                  chain(monad, transformation)

                  Transforms a monad with an unary function.

                  -
                  Experimental

                  Monoid

                  empty(monoid)

                  Returns the identity object for a monoid.

                  -
                  Experimental

                  Semigroup

                  concat(semigroupLeft, semigroupRight)

                  Joins two semigroups.

                  -
                  Experimental

                  Setoid

                  equals(setoidLeft, setoidRight)

                  Compares two setoids for equality.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/index.js at line 14, column 0
                  {
                  -  apply: require('./apply'),
                  -  concat: require('./concat'),
                  -  chain: require('./chain'),
                  -  empty: require('./empty'),
                  -  map: require('./map'),
                  -  of: require('./of'),
                  -  equals: require('./equals'),
                  -  bimap: require('./bimap'),
                  -  curried: require('./curried'),
                  -  infix: require('./infix')
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.infix.html b/docs/api/en/folktale.core.fantasy-land.infix.html deleted file mode 100644 index 04395e6..0000000 --- a/docs/api/en/folktale.core.fantasy-land.infix.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - module folktale/core/fantasy-land/infix - - - - - -

                  module folktale/core/fantasy-land/infix

                  Method versions of the fantasy-land functions, supporting the -structure::fn(...) syntax.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  Method versions of the fantasy-land functions, supporting the -structure::fn(...) syntax.

                  -

                  Properties

                  Convenience

                  apply: infix(applicativeValue)

                  Applies the function inside an applicative to the value of another applicative.

                  -
                  Experimental
                  bimap: infix(transformLeft, transformRight)

                  Maps one function over each side of a Bifunctor.

                  -
                  Experimental
                  chain: infix(transformation)

                  Transforms a monad with an unary function.

                  -
                  Experimental
                  concat: infix(aSemigroup)

                  Joins two semigroups.

                  -
                  Experimental
                  empty: infix()

                  Returns the identity object for a monoid.

                  -
                  Experimental
                  equals: infix(aSetoid)

                  Compares two setoids for equality.

                  -
                  Experimental
                  map: infix(transformation)

                  Transforms the contents of a Functor.

                  -
                  Experimental
                  of: infix(value)

                  Constructs an applicative containing the given value.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/infix.js at line 15, column 0
                  {
                  -  apply: require('./apply').infix,
                  -  bimap: require('./bimap').infix,
                  -  chain: require('./chain').infix,
                  -  concat: require('./concat').infix,
                  -  empty: require('./empty').infix,
                  -  equals: require('./equals').infix,
                  -  map: require('./map').infix,
                  -  of: require('./of').infix
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/infix
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.map.map.html b/docs/api/en/folktale.core.fantasy-land.map.map.html deleted file mode 100644 index 0f5327e..0000000 --- a/docs/api/en/folktale.core.fantasy-land.map.map.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - map - - - - - -

                  map

                  Transforms the contents of a Functor.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  map(functor, transformation)
                  forall F, a, b:
                  -  (F a, (a) => b) => F b
                  -where F is Functor

                  Documentation

                  Transforms the contents of a Functor.

                  -

                  Properties

                  Convenience

                  curried()

                  Transforms the contents of a Functor.

                  -
                  Experimental
                  infix(transformation)

                  Transforms the contents of a Functor.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/map.js at line 30, column 0
                  (functor, transformation) =>
                  -  isNew(functor) ?  functor[flMap](transformation)
                  -: isOld(functor) ?  warn(functor.map(transformation))
                  -: /*otherwise*/     unsupported(functor)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/map
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.of.curried.html b/docs/api/en/folktale.core.fantasy-land.of.curried.html deleted file mode 100644 index e6c892e..0000000 --- a/docs/api/en/folktale.core.fantasy-land.of.curried.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - curried - - - - - -

                  curried

                  Constructs an applicative containing the given value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall F, a:
                  -  (F) => (a) => F a
                  -where F is Applicative

                  Documentation

                  Constructs an applicative containing the given value.

                  -

                  Properties

                  Source Code

                  curry(2, of)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/of
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.of.infix.html b/docs/api/en/folktale.core.fantasy-land.of.infix.html deleted file mode 100644 index e6b089d..0000000 --- a/docs/api/en/folktale.core.fantasy-land.of.infix.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - infix - - - - - -

                  infix

                  Constructs an applicative containing the given value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  infix(value)
                  forall F, a:
                  -  (F).(a) => F a
                  -where F is Applicative

                  Documentation

                  Constructs an applicative containing the given value.

                  -

                  Properties

                  Source Code

                  function(value) {
                  -  return of(this, value);
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/of
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.fantasy-land.of.of.html b/docs/api/en/folktale.core.fantasy-land.of.of.html deleted file mode 100644 index 2537d95..0000000 --- a/docs/api/en/folktale.core.fantasy-land.of.of.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - of - - - - - -

                  of

                  Constructs an applicative containing the given value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  of(applicative, value)
                  forall F, a:
                  -  (F, a) => F a
                  -where F is Applicative

                  Documentation

                  Constructs an applicative containing the given value.

                  -

                  Properties

                  Convenience

                  curried()

                  Constructs an applicative containing the given value.

                  -
                  Experimental
                  infix(value)

                  Constructs an applicative containing the given value.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/fantasy-land/of.js at line 33, column 0
                  (applicative, value) =>
                  -  isNew(applicative)     ?  applicative[flOf](value)
                  -: isCtorNew(applicative) ?  applicative.constructor[flOf](value)
                  -: isOld(applicative)     ?  warn(applicative.of(value))
                  -: isCtorOld(applicative) ?  warn(applicative.constructor.of(value))
                  -: /*otherwise*/             unsupported(applicative)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/fantasy-land/of
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.html b/docs/api/en/folktale.core.html deleted file mode 100644 index 002daa7..0000000 --- a/docs/api/en/folktale.core.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - module folktale/core - - - - - -

                  module folktale/core

                  Provides essential functionality for functional programs.

                  -

                  Documentation

                  Provides essential functionality for functional programs.

                  -

                  What's in Core?

                  -

                  This module provides a range of features that are often used as -foundational building blocks in functional programming. It also -provides features for handling some common built-in JavaScript -structures in a functional way.

                  -

                  The operations are divided as follows:

                  -
                    -
                  • Modelling Data: The Core.ADT module provides an -implementation of Tagged Unions with limited pattern matching. -This can be used to model your application's data more accurately, -and thus make it harder to misuse that data;

                    -
                  • -
                  • Combining Functions: The Core.Lambda module provides -operations on functions that allow combining functions together -(like compose) or changing how you apply functions (like curry -or partialise);

                    -
                  • -
                  • Working with Objects as Dictionaries: The Core.Object module -provides operations that let you treat regular JavaScript objects -as dictionaries. Several JavaScript APIs expect that usage of -objects, but the built-in operations don't support this well, -so the Core.Object module addresses that.

                    -
                  • -
                  • Writing generic code with Fantasy-Land: The Core.FantasyLand -module takes care of the differences in the various versions of -the Fantasy Land spec, so you can write generic code that supports -many libraries implementing any version of the spec.

                    -
                  • -
                  -

                  Properties

                  Data structures

                  adt

                  Provides utilities to define tagged unions.

                  -
                  Experimental

                  Extensions for built-ins

                  lambda

                  Core.Lambda provides you tools for transforming and combining -functions.

                  -
                  object

                  Core.Object provides utilities for working with objects as -dictionaries and records.

                  -

                  Fantasy Land

                  fantasyLand

                  Allows invoking methods of Fantasy Land structures without -worrying about the differences in multiple versions of the spec.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/index.js at line 14, column 0
                  {
                  -  lambda: require('./lambda'),
                  -  adt: require('./adt'),
                  -  object: require('./object'),
                  -  fantasyLand: require('./fantasy-land')
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.lambda.compose.all.html b/docs/api/en/folktale.core.lambda.compose.all.html deleted file mode 100644 index 0d4db90..0000000 --- a/docs/api/en/folktale.core.lambda.compose.all.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - all - - - - - -

                  all

                  Conveniently composes multiple functions.

                  -

                  Signature

                  all(...fns)
                  (Function...) -> Function

                  Documentation

                  Conveniently composes multiple functions.

                  -

                  Because compose is limited to two functions, composing more than that -is awkward:

                  -
                  const compose = require('folktale/core/lambda/compose')
                  -
                  -const inc    = (x) => x + 1;
                  -const double = (x) => x * 2;
                  -const square = (x) => x * x;
                  -
                  -const incDoubleSquare = compose(inc, compose(double, square));
                  -incDoubleSquare(3);
                  -// ==> 19
                  -

                  In these cases one may use compose.all, which is a variadic convenience -for composing multiple functions:

                  -
                  const incDoubleSquare2 = compose.all(inc, double, square);
                  -incDoubleSquare2(3);
                  -// ==> 19
                  -

                  Properties

                  Source Code

                  function(...fns) {
                  -  /* eslint-disable no-magic-numbers */
                  -  if (fns.length < 1) { // eslint-disable-next-line prefer-rest-params
                  -    throw new TypeError(`compose.all requires at least one argument, ${arguments.length} given.`);
                  -  }
                  -  return fns.reduce(compose);
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/lambda/compose
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.lambda.compose.compose.html b/docs/api/en/folktale.core.lambda.compose.compose.html deleted file mode 100644 index 544882f..0000000 --- a/docs/api/en/folktale.core.lambda.compose.compose.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - compose - - - - - -

                  compose

                  Combines two unary functions, from right to left.

                  -

                  Signature

                  compose(f, g)(value)
                  (('b) => 'c, ('a) => 'b) => (('a) => 'c)

                  Documentation

                  Combines two unary functions, from right to left.

                  -

                  Example:

                  -
                  const compose = require('folktale/core/lambda/compose');
                  -
                  -const inc = (x) => x + 1;
                  -const double = (x) => x * 2;
                  -
                  -compose(inc, double)(2);
                  -// ==> inc(double(2))
                  -

                  ```

                  -

                  You can put several @annotate lines together to associate the same documentation with multiple objects:

                  -

                  ```md

                  -

                  Properties

                  Convenience

                  all(...fns)

                  Conveniently composes multiple functions.

                  -
                  infix(that)

                  Conveniently composes function with the This-Binding syntax.

                  -

                  Source Code

                  Defined in src/core/lambda/compose.js at line 19, column 0
                  (f, g) => (value) => f(g(value))
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/lambda/compose
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.lambda.compose.infix.html b/docs/api/en/folktale.core.lambda.compose.infix.html deleted file mode 100644 index b4cf4b5..0000000 --- a/docs/api/en/folktale.core.lambda.compose.infix.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - infix - - - - - -

                  infix

                  Conveniently composes function with the This-Binding syntax.

                  -

                  Signature

                  infix(that)
                  (('b) => 'c) . (('a) => 'b) => (('a) => 'c)

                  Documentation

                  Conveniently composes function with the This-Binding syntax.

                  -

                  This is a free-method version of compose that applies the this -argument first, then the function it takes as argument. It's meant -to be used with the This-Binding Syntax proposal.

                  -
                  const then   = compose.infix;
                  -const inc    = (x) => x + 1;
                  -const double = (x) => x * 2;
                  -
                  -inc::then(double)(2);  // ==> 6
                  -

                  Properties

                  Source Code

                  function(that) {
                  -  return compose(that, this);
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/lambda/compose
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.lambda.constant.constant.html b/docs/api/en/folktale.core.lambda.constant.constant.html deleted file mode 100644 index f7a965d..0000000 --- a/docs/api/en/folktale.core.lambda.constant.constant.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - constant - - - - - -

                  constant

                  The constant combinator; always returns the first argument given.

                  -

                  Signature

                  constant(value)
                  ('a) => ('b) => 'a

                  Documentation

                  The constant combinator; always returns the first argument given.

                  -

                  Example:

                  -
                  const constant = require('folktale/core/lambda/constant');
                  -
                  -[1, 2, 3].map(constant(0));
                  -// ==> [0, 0, 0]
                  -

                  Why?

                  -

                  Constant combinators can be passed to higher-order operations if you -want to provide a plain value, but the operation expects a function -providing a value:

                  -
                  const constant = require('folktale/core/lambda/constant');
                  -
                  -[1, 2, 3].map(constant(0));
                  -// ==> [0, 0, 0]
                  -

                  For a primitive, there's usually not much of a difference between -using the constant combinator or an arrow function. In fact, for -most cases, using the arrow function is preferred:

                  -
                  [1, 2, 3].map(() => 0);
                  -// ==> [0, 0, 0]
                  -

                  The problem with using arrows is that the value is computed lazily. -That is, it's computed only when the arrow is evaluated, and recomputed -many times if the arrow is evaluated many times. The constant combinator -lets you evaluate something eagerly instead.

                  -

                  You can see the importance of this when effects are involved:

                  -
                  let counter = 0;
                  -const next = () => ++counter;
                  -
                  -['a', 'b', 'c'].map(constant(next()));
                  -// ==> [1, 1, 1]
                  -
                  -counter = 0;
                  -['a', 'b', 'c'].map(_ => next());
                  -// ==> [1, 2, 3]
                  -

                  Expensive pure computations are another place where constant is desirable -over plain arrows, given that one'd rather avoid re-evaluating the -computation unnecessarily.

                  -

                  Properties

                  Source Code

                  Defined in src/core/lambda/constant.js at line 18, column 0
                  (value) => (_) => value
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/lambda/constant
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.lambda.curry.curry.html b/docs/api/en/folktale.core.lambda.curry.curry.html deleted file mode 100644 index ae11ab4..0000000 --- a/docs/api/en/folktale.core.lambda.curry.curry.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - curry - - - - - -

                  curry

                  Transforms functions of arity N into a chain of N unary functions

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  curry(arity, fn)
                  (Number, (Any...) => 'a) => Any... => 'a or ((Any...) => 'a)

                  Documentation

                  Transforms functions of arity N into a chain of N unary functions

                  -

                  Example:

                  -
                  const curry = require('folktale/core/lambda/curry');
                  -
                  -const property = curry(2, (key, object) => object[key]);
                  -const people = [
                  -  { name: 'Alissa', age: 26 },
                  -  { name: 'Max',    age: 19 },
                  -  { name: 'Talib',  age: 28 }
                  -];
                  -
                  -people.map(property('name'));
                  -// ==> ['Alissa', 'Max', 'Talib']
                  -

                  What is "Currying"?

                  -

                  Currying is the process of transforming a function that takes N arguments -all at once, into a series of functions that take one argument at a time. -This makes it possible to construct new funcionality by specialising part -of the arguments.

                  -

                  For example, the property function takes two arguments: the object that -contains the property, and the name of the property to retrieve:

                  -
                  const property = (object, key) => object[key];
                  -

                  Because of this, every time someone call property they must provide both -arguments:

                  -
                  property({ greeting: 'Hi' }, 'greeting');
                  -// ==> 'Hi'
                  -

                  Some of the time, you only have some of the arguments, however. For example, -if you wanted to create a function that always gets the greeting of a -particular object, you would have to do so manually:

                  -
                  const greeting = (object) => property(object, 'greeting');
                  -
                  -greeting({ greeting: 'Hi' });
                  -// ==> 'Hi'
                  -

                  Currying alleviates the need for constructing these functions manually. If -property was curried, you'd be able to create a new greeting function -by just specifying some of the arguments, like you would do when invoking -the function:

                  -
                  const property2 = (key) => (object) => object[key];
                  -const greeting2 = property2('greeting');
                  -
                  -greeting({ greeting: 'Hi' });
                  -

                  Note that the way we use arguments in a curried function is slightly -different. When designing a function to be curried, you should consider -which parameters are most likely to be fixed, and which parameters will -be provided afterwards. In this case, it's much more likely for someone -to have the name of a property than it is for them to have the object -in which that property lives:

                  -
                  const score = [{ type: 'win' }, { type: 'draw' }];
                  -score.map(property2('type'));
                  -// ==> ['win', 'draw']
                  -

                  Why Use Currying?

                  -

                  Functional programming places a heavy emphasis on function composition, -but sometimes we have functions that don't exactly fit the places we -want to use them. For example, Array.prototype.map expects a function -that takes three arguments:

                  -
                  type Array.prototype.map =
                  -  Array<'element> . (
                  -    ('element, index is Number, Array<'element>) => 'newElement
                  -  ) => Array<'newElement>
                  -

                  That is, given an array of of some element type, our callback, which -receives not only this element, but also the index of that element in -the array, and even the original array, is supposed to return a newElement -to put in the old element's place.

                  -

                  We can use Array.prototype.map to easily transform the data in the -array by some function. To expand a bit on the initial example, suppose -we have an array of people:

                  -
                  const people = [
                  -  { name: 'Alissa', age: 26, pronoun: 'she'  },
                  -  { name: 'Max',    age: 19, pronoun: 'they' },
                  -  { name: 'Talib',  age: 28, pronoun: 'he'   }
                  -];
                  -

                  And then you want to get the name of one of those people. We can use -Array.prototype.map for this:

                  -
                  people.map((element, index, array) => element.name);
                  -// ==> ['Alissa', 'Max', 'Talib']
                  -
                  -

                  NOTE
                  Because functions in JavaScript are variadic, you don't need to -create a function with three parameters here. The following code -is strictly equivalent:

                  -
                  people.map(person => person.name);
                  -// ==> ['Alissa', 'Max', 'Talib']
                  -
                  -

                  This is all well and good, because this is the only place where we use -this kind of functionality. But what if we have very similar functionality -in more places. For example, just like we got the names of these people, -we could get their ages:

                  -
                  people.map(person => person.age);
                  -// ==> [26, 19, 28]
                  -

                  Or the pronoun they use:

                  -
                  people.map(person => person.pronoun);
                  -// ==> ['she', 'they', 'he']
                  -

                  At this point, we're duplicating this functionality in many places. It -would be more productive to move it to a function we can reuse. And this -is easy enough:

                  -
                  const property = (object, key) => object[key];
                  -

                  But this attempt is not really a good one in this case. Now composing -things is even more trouble:

                  -
                  people.map(person => property(person, 'name'));
                  -

                  Ideally, we'd want:

                  -
                  people.map(property);
                  -

                  But property takes two arguments, and Array.prototype.map can only -provide one of them: the object we should retrieve the property from. -Where do we get the other one from? Well, the name of the property is -static. We know exactly what we need from the callsite.

                  -

                  As said in the previous section, thinking about which arguments are likely -to be specified, and what aren't is important when designing curried -functions. For this case, we want to specialise the key, and leave -object to be provided by some other piece of code:

                  -
                   const property = (key) => (object) => object[key];
                  -
                  - people.map(property('name'));
                  - // ==> ['Alissa', 'Max', 'Talib']
                  -
                  - people.map(property('age'));
                  - // ==> [26, 19, 28]
                  -
                  - people.map(property('pronoun'));
                  - // ==> ['she', 'they', 'he'] 
                  -

                  So, with currying, it becomes much simpler to shape a function so it -fits the expectations of the place where you want to use it. It alleviates -the need of making this translation manually, but it also requires some -prior thought on how these functions are likely to be used.

                  -

                  How Folktale's curry Works?

                  -

                  The curry operation makes it simpler to construct curried functions -that work well with JavaScript, where functions may, and often do, take -more than one argument.

                  -

                  Consider the following example:

                  -
                  const joinedBy = (separator) => (list) => (item) =>
                  -  list.concat([separator, item]);
                  -

                  It's a curried function that takes 3 arguments, one at a time. To invoke -it one must do so like this:

                  -
                  joinedBy(',')(['a'])('b');
                  -// ==> ['a', ',', 'b']
                  -

                  This makes it harder to use it for functions that pass two arguments to -their callbacks, like Array.prototype.reduce, because JavaScript passes -them all at once:

                  -
                  ['b'].reduce(joinedBy(','), ['a']);
                  -// ==> [<function>, <function>]
                  -

                  This is where curry helps. It allows you to curry functions, while -unrolling application of more than one argument:

                  -
                  const curry = require('folktale/core/lambda/curry');
                  -
                  -const joinedBy2 = curry(3, (separator, list, item) =>
                  -  list.concat([separator, item]) 
                  -);
                  -
                  -joinedBy2(',', ['a'], 'b');
                  -// ==> ['a', ',', 'b']
                  -
                  -['b'].reduce(joinedBy2(','), ['a']);
                  -// ==> ['a', ',', 'b']
                  -

                  curry, Under The Hood

                  -

                  How can curry construct functions that support such different styles -of passing arguments? The secret is in how curry does unrolling. A -function constructed by curry takes two arguments:

                  -
                    -
                  1. The number of arguments that are expected for that function (arity);
                  2. -
                  3. The function that should be called when those arguments are collected.
                  4. -
                  -

                  In return, curry gives you back a function that, at first, only collects -arguments. That is, until we reach the amount of arguments expected (arity), -applying the curryed function gives you back a new function that you -continue to apply:

                  -
                  const curry = require('folktale/core/lambda/curry');
                  -
                  -const f = curry(4, (a, b, c, d) => [a, b, c, d]);
                  -
                  -// Previous arguments: []
                  -const f1 = f();
                  -// New arguments:      []
                  -
                  -// Previous arguments: []
                  -const f2 = f1(1);
                  -// New arguments:      [1]
                  -
                  -// Previous arguments: [1]
                  -const f3 = f2(2, 3);
                  -// New arguments:      [1, 2, 3]
                  -
                  -// Previous arguments: [1, 2, 3]
                  -f3(4);
                  -// ==> [1, 2, 3, 4]
                  -

                  The curried function keeps track of these arguments in an internal array. -This array is not modified when you apply a curried function. Instead, you -get a new function with a separate "internal arguments array":

                  -
                  // Previous arguments: [1]
                  -const f2_a = f2(4);  // => [1, 4]
                  -const f2_b = f2(5);  // => [1, 5]
                  -
                  -f2_a(5, 6); // ==> [1, 4, 5, 6]
                  -f2_b(5, 6); // ==> [1, 5, 5, 6]
                  -

                  Once the curried function has collected all of the arguments it needs to, -it "unrolls" the application. That is, it provides the arguments collected -to the original function:

                  -
                  const plus  = (a, b, c) => a + b + c;
                  -const plus2 = curry(3, plus);
                  -
                  -    plus2(1)(2)(3)
                  -=== plus2(1, 2)(3)
                  -=== plus2(1, 2, 3)
                  -=== plus(1, 2, 3)
                  -=== 1 + 2 + 3;
                  -

                  What happens if a curried function receives more arguments than it expects, -though? If the wrapped function is a regular JavaScript function, it's the -same. curry passes all of the arguments to it, and because JavaScript -functions are variadic, those additional arguments get (usually) ignored:

                  -
                      plus2(1)(2)(3, 4, 5)
                  -=== plus2(1, 2)(3, 4, 5)
                  -=== plus2(1, 2, 3, 4, 5)
                  -=== plus(1, 2, 3, 4, 5)
                  -=== 1 + 2 + 3;
                  -

                  If the wrapped function is itself a curried function, things get more -interesting though, because the curried functio will, itself, unroll -the rest of the application!

                  -
                  const subtract = curry(2, (x, y) => x - y);
                  -const flip     = curry(3, (f, x, y) => f(y, x));
                  -
                  -    subtract(1)(2)
                  -=== subtract(1, 2)
                  -=== 1 - 2;
                  -
                  -    flip(subtract)(1)(2)
                  -=== flip(subtract, 1)(2)
                  -=== flip(subtract, 1, 2)
                  -=== subtract(2, 1)
                  -=== 2 - 1;
                  -

                  Unrolling makes it possible to compose curried functions naturally, without -getting in the way of regular JavaScript functions.

                  -
                  -

                  NOTE
                  Using curry for real variadic functions is strongly discouraged, given -that it's hard to predict which arguments will end up being provided to -the variadic function.

                  -
                  -

                  Drawbacks of Using curry

                  -

                  While curry certainly helps composing functions, it's important to note -that, because a lot of functions in JavaScript are variadic, and because -people take advantage of this (by relying on the number of arguments -provided for optional parameters or overloading the signature), -composition of such functions is not well-defined, and curry makes -things even less predictable for these cases.

                  -

                  Because of this, the use of curry for variadic functions is strongly -discouraged.

                  -

                  One also must consider the overhead of introducing curry in a codebase. -For most code, this overhead is negligible, but curry should be avoided -in code paths that require more performance.

                  -

                  Properties

                  Source Code

                  Defined in src/core/lambda/curry.js at line 18, column 0
                  (arity, fn) => {
                  -  const curried = (oldArgs) => (...newArgs) => {
                  -    const allArgs  = oldArgs.concat(newArgs);
                  -    const argCount = allArgs.length;
                  -
                  -    return argCount < arity   ?  curried(allArgs)
                  -    :      /* otherwise */       fn(...allArgs);
                  -  };
                  -
                  -  return curried([]);
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/lambda/curry
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.lambda.html b/docs/api/en/folktale.core.lambda.html deleted file mode 100644 index 9d57276..0000000 --- a/docs/api/en/folktale.core.lambda.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - module folktale/core/lambda - - - - - -

                  module folktale/core/lambda

                  Core.Lambda provides you tools for transforming and combining -functions.

                  -

                  Documentation

                  Core.Lambda provides you tools for transforming and combining -functions.

                  -

                  Programming by Combining Functions

                  -

                  Functional programming places a heavy emphasis on writing programs -by combining lots of small, focused functions. JavaScript doesn't -really have a good support for this out of the box, so you're left -with composing these functions manually, by defining a new function.

                  -

                  This is not so bad in ECMAScript 2015, thanks to the new arrow -function syntax:

                  -
                  const people = [
                  -  { name: 'Alissa' },
                  -  { name: 'Max' },
                  -  { name: 'Talib' }
                  -];
                  -people.map(person => person.name);
                  -// ==> ['Alissa', 'Max', 'Talib']
                  -

                  But there are times in which arrow functions don't quite cut it. -For example, if one wants to evaluate something eagerly, a constant -combinator makes more sense:

                  -
                  const counter = {
                  -  value: 0,
                  -  next()  { return ++this.value },
                  -  reset() { this.value = 0 }
                  -};
                  -const constant = require('folktale/core/lambda/constant');
                  -
                  -counter.reset();
                  -[0, 0, 0].map(constant(counter.next()));
                  -// ==> [1, 1, 1]
                  -
                  -// Arrows are evaluated lazily, so they don't work for this
                  -counter.reset();
                  -[0, 0, 0].map(_ => counter.next());
                  -// ==> [1, 2, 3]
                  -
                  -// One must store the value somewhere instead
                  -counter.reset();
                  -[0, 0, 0].map((x => _ => x)(counter.next()))
                  -

                  What's in Core.Lambda?

                  -

                  Core.Lambda provides combinators and operations that transform the -signature of a function. The operations in the module are divided -as thus:

                  -
                    -
                  • Combining: contains functions that combines functionality -present in different functions into a single function. Composing -functions is an example.

                    -
                  • -
                  • Combinators: functions that just re-arrange the arguments -they're given. They're convenient ways of writing a particular -operation, but don't have any special behaviour of their own, -nor use anything besides the arguments they're given. Constant -and Identity are common combinators.

                    -
                  • -
                  • Currying and Partialisation: functions that transform -how parameters are provided to a function. Currying allows a -function to take parameters one at a time, whereas partialisation -allows one to provide some of the positional parameters without -executing the function before the rest is provided.

                    -
                  • -
                  -

                  Properties

                  Combining functions

                  compose(f, g)(value)

                  Combines two unary functions, from right to left.

                  -

                  Functional combinators

                  constant(value)

                  The constant combinator; always returns the first argument given.

                  -
                  identity(value)

                  The identity combinator; always returns the argument given.

                  -

                  Partialization / Currying

                  curry(arity, fn)

                  Transforms functions of arity N into a chain of N unary functions

                  -
                  Experimental
                  partialize(arity, fn)

                  Creates a new function where some of the arguments are specified.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/lambda/index.js at line 14, column 0
                  {
                  -  identity: require('./identity'),
                  -  constant: require('./constant'),
                  -  curry: require('./curry'),
                  -  compose: require('./compose'),
                  -  partialize: require('./partialize')
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/lambda
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.lambda.identity.identity.html b/docs/api/en/folktale.core.lambda.identity.identity.html deleted file mode 100644 index ad5dd9c..0000000 --- a/docs/api/en/folktale.core.lambda.identity.identity.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - identity - - - - - -

                  identity

                  The identity combinator; always returns the argument given.

                  -

                  Signature

                  identity(value)
                  ('a) => 'a

                  Documentation

                  The identity combinator; always returns the argument given.

                  -

                  Example:

                  -
                  const identity = require('folktale/core/lambda/identity');
                  -
                  -identity(1);
                  -// ==> 1
                  -
                  -[1, 2, 3].map(identity);
                  -// ==> [1, 2, 3]
                  -

                  Why?

                  -

                  There aren't many reasons to use the identity combinator in real -JavaScript code. Readability is the only compelling one. Figuring -out the concept of identity from reading the word identity is -easier than working your way through its implementation.

                  -

                  Compare:

                  -
                  const identity = require('folktale/core/lambda/identity');
                  -
                  -either.bimap(identity, (counter) => counter + 1);
                  -

                  With:

                  -
                  either.bimap(
                  -  (failure) => failure,
                  -  (counter) => counter + 1
                  -)
                  -

                  Properties

                  Source Code

                  Defined in src/core/lambda/identity.js at line 18, column 0
                  (value) => value
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/lambda/identity
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.lambda.partialize.hole.html b/docs/api/en/folktale.core.lambda.partialize.hole.html deleted file mode 100644 index 7e6be0b..0000000 --- a/docs/api/en/folktale.core.lambda.partialize.hole.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - hole - - - - - -

                  hole

                  Represents a place in an argument list that needs to be filled.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  Represents a place in an argument list that needs to be filled.

                  -

                  Properties

                  Source Code

                  hole
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/lambda/partialize
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.lambda.partialize.partialize.html b/docs/api/en/folktale.core.lambda.partialize.partialize.html deleted file mode 100644 index 122c57e..0000000 --- a/docs/api/en/folktale.core.lambda.partialize.partialize.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - partialize - - - - - -

                  partialize

                  Creates a new function where some of the arguments are specified.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  partialize(arity, fn)
                  (Number, (Any... => Any)) => ((hole | Any)...) => Any :: (throw TypeError)

                  Documentation

                  Creates a new function where some of the arguments are specified.

                  -

                  Example:

                  -
                  const partialize = require('folktale/core/lambda/partialize');
                  -
                  -const clamp = (min, max, number) =>
                  -  number < min ?  min
                  -: number > max ?  max
                  -:                 number;
                  -
                  -const _      = partialize.hole;
                  -const clamp_ = partialize(3, clamp);
                  -
                  -const atLeast = clamp_(_, Infinity, _);
                  -const atMost  = clamp_(-Infinity, _, _);
                  -
                  -atLeast(3, 2); // ==> 3
                  -atLeast(3, 5); // ==> 5
                  -
                  -atMost(5, 3);  // ==> 3
                  -atMost(5, 10); // ==> 5
                  -

                  Why Partialisation

                  -

                  With higher-order programming, one often wants to specialise some of -the arguments of a function before passing it to another function. -This kind of configuration is often done by creating a new function -manually:

                  -
                  const plus = (a, b) => a + b;
                  -const add5 = (x) => plus(5, x);
                  -
                  -[1, 2, 3].map(add5);
                  -// ==> [6, 7, 8]
                  -

                  And for most cases this is reasonable. For functions that take more -parameters, this can be cumbersome, however. The partialize function -allows creating a new function by specialising some of the arguments, -and filling the remaining ones when the function is called.

                  -

                  Places where the caller of the function should fill are specified as -hole, which is a special constant used by partialize:

                  -
                  const partialize = require('folktale/core/lambda/partialize');
                  -
                  -const _ = partialize.hole;
                  -const partialAdd5 = partialize(2, plus)(5, _);
                  -[1, 2, 3].map(partialAdd5);
                  -// ==> [6, 7, 8]
                  -

                  Relation to Currying

                  -

                  Partial application and currying are related concepts. Currying -refers to transforming a function of arity N, into N functions of -arity 1. Partial application, on the other hand, refers to -fixing some (but not all) arguments of a function.

                  -

                  Both concepts are used to improve function composition, where the -shape of the function you have does not reflect the shape of the -function expected by function you're calling. So, in essence, these -techniques transform the shape of your function to make them "fit" -some API.

                  -

                  partialize and curry differ on how they achieve this, however. -While curry creates N functions, and lets you specify arguments -one by one, partialize requires you to specify all arguments at -once, distinguishing which ones are fixed, and which ones have to -be provided (using "holes").

                  -

                  Because of this, curry can be more natural, but it requires that -the APIs be designed thinking about currying before hand, and it -often interacts poorly with JavaScript, due to the use of variadic -functions. partialize does not have such problems.

                  -

                  How partialize Works?

                  -

                  The partialize function transforms regular functions into -functions that can accept holes for arguments that are not -defined yet. Whenever a partial function receives a hole as -an argument, it constructs a new function so the holes can -be filled later:

                  -
                  const partialize = require('folktale/core/lambda/partialize');
                  -
                  -const clamp = (min, max, number) =>
                  -  number < min ?  min
                  -: number > max ?  max
                  -:                 number
                  -
                  -const partialClamp = partialize(3, clamp);
                  -

                  In the example above, partialClamp is a function that takes -arguments that may or may not be holes. A hole is a special -constant defined by partialize itself. It's convenient to -bind such constant to the _ binding:

                  -
                  const _ = partialize.hole;
                  -

                  A partial function is considered saturated when, among the -arguments provided to it, no hole exists. When a partial function -is saturated, its original behaviour is executed:

                  -
                  partialClamp(3, 5, 6);  // ==> 5
                  -

                  If a partial function is not saturated, then it its execution -results in a new partial function:

                  -
                  const atLeast = partialClamp(_, Infinity, _);
                  -atLeast(5, 3); // ==> 5
                  -
                  -const atLeast5 = atLeast(5, _);
                  -atLeast5(3); // ==> 5
                  -

                  Note that to prevent confusing behaviour, Folktale's partialize -forces you to always pass the exact number of arguments that the -partial function expects. Passing more or less arguments to a -partial function is a TypeError. This ensures that all new partial -functions can properly invoke the original behaviour when saturated, -rather than returning previous unsaturated functions.

                  -

                  Drawbacks of Using partialize

                  -

                  partialize is a convenience function for transforming the shape -of functions, and it relies on variadic application, as well as -doing a fair bit of processing before each call to determine -saturation. Combined, these make partialize a poor choice for -any code that needs to be performant.

                  -

                  Properties

                  Special values

                  hole

                  Represents a place in an argument list that needs to be filled.

                  -
                  Experimental

                  Source Code

                  Defined in src/core/lambda/partialize.js at line 21, column 0
                  (arity, fn) => (...args) => {    //  eslint-disable-line max-statements
                  -  /* eslint-disable no-magic-numbers */
                  -  if (args.length < arity) {
                  -    throw new TypeError(`The partial function takes at least ${arity} arguments, but was given ${args.length}.`);
                  -  }
                  -
                  -  // Figure out if we have holes
                  -  let holes = 0;
                  -  for (let i = 0; i < args.length; ++i) {
                  -    if (args[i] === hole) {
                  -      holes += 1;
                  -    }
                  -  }
                  -
                  -
                  -  if (holes > 0) {
                  -    return partialize(holes, (...newArgs) => {    // eslint-disable-line max-statements
                  -      let realArgs = [];    // eslint-disable-line prefer-const
                  -      let argIndex = 0;
                  -
                  -      for (let i = 0; i < args.length; ++i) {
                  -        const arg = args[i];
                  -        if (arg === hole) {
                  -          realArgs.push(newArgs[argIndex]);
                  -          argIndex += 1;
                  -        } else {
                  -          realArgs.push(arg);
                  -        }
                  -      }
                  -
                  -      return fn(...realArgs);
                  -    });
                  -  } else {
                  -    return fn(...args);
                  -  }
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/core/lambda/partialize
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.object.from-pairs.frompairs.html b/docs/api/en/folktale.core.object.from-pairs.frompairs.html deleted file mode 100644 index f0ef8be..0000000 --- a/docs/api/en/folktale.core.object.from-pairs.frompairs.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - fromPairs - - - - - -

                  fromPairs

                  Constructs an object from an array of (key, value) pairs.

                  -

                  Signature

                  fromPairs(pairs)
                  (Array (String or Symbol, 'a)) => Object 'a

                  Documentation

                  Constructs an object from an array of (key, value) pairs.

                  -

                  The resulting object is a plain JavaScript object, inheriting from -Object.prototype.

                  -

                  The pairs are added to the object with Object.defineProperty, so no setters -defined in Object.prototype will be triggered during the process. All -properties are enumerable, writable, and configurable.

                  -

                  Example:

                  -
                  const fromPairs = require('folktale/core/object/from-pairs');
                  -
                  -fromPairs([['x', 10], ['y', 20]]);
                  -// ==> { x: 10, y: 20 }
                  -

                  Caveats

                  -

                  Properties are inserted in the object in the same order of the array. In an -ECMAScript 2015-compliant engine this means that the following equivalence -holds:

                  -
                  const fromPairs = require('folktale/core/object/from-pairs');
                  -
                  -Object.keys(fromPairs(xs)) === xs.map(([k, v]) => k)
                  -

                  However, in engines that don't conform to ECMAScript 2015, this equivalence -is not guaranteed.

                  -

                  Properties

                  Source Code

                  Defined in src/core/object/from-pairs.js at line 22, column 0
                  (pairs) =>
                  -        pairs.reduce((r, [k, v]) => define(r, k, { value: v,
                  -                                                   writable: true,
                  -                                                   enumerable: true,
                  -                                                   configurable: true
                  -                                                  }),
                  -                     {})
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/object/from-pairs
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.object.html b/docs/api/en/folktale.core.object.html deleted file mode 100644 index ffb8b87..0000000 --- a/docs/api/en/folktale.core.object.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - module folktale/core/object - - - - - -

                  module folktale/core/object

                  Core.Object provides utilities for working with objects as -dictionaries and records.

                  -

                  Documentation

                  Core.Object provides utilities for working with objects as -dictionaries and records.

                  -

                  Why?

                  -

                  JS historically lacked data structures designed specifically for -representing records and dictionaries, and objects just doubled -as those for the common use cases. While JS has added Map and -Set structures natively, using objects as records and dictionaries -is still common place, and there aren't many tools to use them -for those use cases natively.

                  -

                  For example, these objects are used as options for configuring -operations, like babylon's parse operation, or Node's readFile. -They're used to represent headers in most HTTP libraries, or to -represent environment variables in Node, etc.

                  -

                  Folktale's Core.Object primarily aims to provide common tools for -using objects as dictionaries. In doing so, most of the operations -in this module are only concerned about own, enumerable properties, -and don't respect the original object's shape. That is, a -transformation such as:

                  -
                  toPairs(fromPairs(object))
                  -

                  Doesn't return a value necessarily equivalent to object. Because -all transformations are pure, objects get a new identity, they also -lose all symbols and non-enumerable properties, as well as the -[[Prototype]] field.

                  -

                  What's in Core.Object?

                  -

                  Currently Core.Object provides operations for converting from and to -objects, and transforming objects. These operations are categorised -as follows:

                  -
                    -
                  • Converting: Operations that convert the data in the object -to other types.

                    -
                  • -
                  • Transforming: Operations that transform the data in the -object, giving you a new object.

                    -
                  • -
                  -

                  Properties

                  Converting from other types

                  fromPairs(pairs)

                  Constructs an object from an array of (key, value) pairs.

                  -

                  Converting to other types

                  toPairs(object)

                  Returns pairs of (key, value) for all own enumerable properties in an object.

                  -

                  Extracting data

                  values(object)

                  Returns the values for all own enumerable properties in an object.

                  -

                  Transforming

                  mapEntries(object, transform, define)

                  Transforms own properties of an object using a mapping function.

                  -
                  mapValues(object, transformation)

                  Transforms values of an object with an unary function.

                  -

                  Source Code

                  Defined in src/core/object/index.js at line 14, column 0
                  {
                  -  mapEntries: require('./map-entries'),
                  -  mapValues: require('./map-values'),
                  -  values: require('./values'),
                  -  toPairs: require('./to-pairs'),
                  -  fromPairs: require('./from-pairs')
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/object
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.object.map-entries.mapentries.html b/docs/api/en/folktale.core.object.map-entries.mapentries.html deleted file mode 100644 index cee8645..0000000 --- a/docs/api/en/folktale.core.object.map-entries.mapentries.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - mapEntries - - - - - -

                  mapEntries

                  Transforms own properties of an object using a mapping function.

                  -

                  Signature

                  mapEntries(object, transform, define)
                  (
                  -  object    : Object 'a,
                  -  transform : ((String, 'a)) => (String, 'b),
                  -  define    : (('x : Object 'b), String, 'b) => Object 'b :: mutates 'x
                  -) => Object 'b

                  Documentation

                  Transforms own properties of an object using a mapping function.

                  -

                  The transformation takes a [key, value] pair, and is expected to return -a new [key, value] pair. The resulting object has not only its values -transformed, but also its keys.

                  -

                  Example:

                  -
                  const mapEntries = require('folktale/core/object/map-entries');
                  -
                  -const pair = { x: 10, y: 20 };
                  -mapEntries(
                  -  pair,
                  -  ([key, value]) => [key.toUpperCase(), value * 2],
                  -  (result, key, value) => {
                  -    result[key] = value;
                  -    return result;
                  -  }
                  -);
                  -// ==> { X: 20, Y: 40 }
                  -

                  Handling collisions

                  -

                  Since the mapping function returns a [key, value] pair, it's possible -that some of the returned keys collide with another. Since there's no -single answer that is correct for all cases when handling these collisions, -mapEntries expects an additional function that's used to define the -properties in the resulting object, and this function is expected to -deal with the collisions.

                  -

                  A definition function takes the result object, a property name, and -a value, and is expected to return a new object containing the provided -key/value pair, if it can be attached to the result object. This function -may mutate the object, but pure functions are also supported.

                  -

                  Specialised forms of this function exist to cover common cases. -mapEntries.overwrite will have later key/value pairs overwrite earlier -ones with the same key, while mapEntries.unique will throw whenever -a collision happens.

                  -

                  Caveats

                  -

                  mapEntries will not preserve the shape of the original object. -It treats objects as plain maps from String to some value. It ignores -things like prototypical delegation, symbols, and non-enumerable -properties.

                  -

                  Properties

                  Convenience

                  overwrite(object, transform)

                  Transforms own properties of an object using a mapping function.

                  -
                  unique(object, transform)

                  Transforms own properties of an object using a mapping function.

                  -

                  Source Code

                  Defined in src/core/object/map-entries.js at line 25, column 0
                  (object, transform, define) =>
                  -        Object.keys(object).reduce((result, key) => {
                  -          const [newKey, newValue] = transform([key, object[key]]);
                  -          return define(result, newKey, newValue);
                  -        }, {})
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/object/map-entries
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.object.map-entries.overwrite.html b/docs/api/en/folktale.core.object.map-entries.overwrite.html deleted file mode 100644 index a627bf3..0000000 --- a/docs/api/en/folktale.core.object.map-entries.overwrite.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - overwrite - - - - - -

                  overwrite

                  Transforms own properties of an object using a mapping function.

                  -

                  Signature

                  overwrite(object, transform)
                  (Object 'a, ((String, 'a)) => (String, 'b)) => Object 'b

                  Documentation

                  Transforms own properties of an object using a mapping function.

                  -

                  This function is a specialised form of mapEntries that overwrites -duplicated keys when a collision happens.

                  -

                  Caveats

                  -

                  Because this function takes an object and maps over it, the result of a -transformation where keys collide is not defined in ECMAScript 5 and older, -as those engines don't define an ordering for key/value pairs in objects. -In ECMAScript 2015 properties that were inserted later will win over -properties that were inserted earlier.

                  -

                  Properties

                  Source Code

                  (object, transform) =>
                  -  mapEntries(object, transform, (result, key, value) => {
                  -    result[key] = value;
                  -    return result;
                  -  })
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/object/map-entries
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.object.map-entries.unique.html b/docs/api/en/folktale.core.object.map-entries.unique.html deleted file mode 100644 index 266199e..0000000 --- a/docs/api/en/folktale.core.object.map-entries.unique.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - unique - - - - - -

                  unique

                  Transforms own properties of an object using a mapping function.

                  -

                  Signature

                  unique(object, transform)
                  (Object 'a, ((String, 'a)) => (String, 'b)) => Object 'b :: throws Error

                  Documentation

                  Transforms own properties of an object using a mapping function.

                  -

                  This function is a specialised form of mapEntries that throws -when a key collision happens. Throwing makes this function potentially -unsafe to use, however it guarantees a consistent behaviour across -different ECMAScript versions and VMs.

                  -

                  Properties

                  Source Code

                  (object, transform) =>
                  -  mapEntries(object, transform, (result, key, value) => {
                  -    if (result::hasOwnProperty(key)) {
                  -      throw new Error(`The property ${key} already exists in the resulting object.`);
                  -    }
                  -    result[key] = value;
                  -    return result;
                  -  })
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/object/map-entries
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.object.map-values.infix.html b/docs/api/en/folktale.core.object.map-values.infix.html deleted file mode 100644 index 68f06c9..0000000 --- a/docs/api/en/folktale.core.object.map-values.infix.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - infix - - - - - -

                  infix

                  Conveniently transforms values in an object using the This-Binding syntax.

                  -

                  Signature

                  infix(transformation)
                  (Object 'a) . (('a) => 'b) => Object 'b

                  Documentation

                  Conveniently transforms values in an object using the This-Binding syntax.

                  -

                  This is a free-method version of mapValues that applies the this -argument first, then the function it takes as argument. It's meant to -be used with the This-Binding Syntax proposal:

                  -
                  const map = require('folktale/core/object/map-values').infix;
                  -
                  -const pair = { x: 10, y: 20 };
                  -pair::map(x => x * 2);
                  -// ==> { x: 20, y: 40 }
                  -

                  Properties

                  Source Code

                  function(transformation) {
                  -  return mapValues(this, transformation);
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/object/map-values
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.object.map-values.mapvalues.html b/docs/api/en/folktale.core.object.map-values.mapvalues.html deleted file mode 100644 index 33ec685..0000000 --- a/docs/api/en/folktale.core.object.map-values.mapvalues.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - mapValues - - - - - -

                  mapValues

                  Transforms values of an object with an unary function.

                  -

                  Signature

                  mapValues(object, transformation)
                  (Object 'a, ('a) => 'b) => Object 'b

                  Documentation

                  Transforms values of an object with an unary function.

                  -

                  The transformation works on the values of each own, enumerable -property of the given object. Inherited and non-enumerable -properties are ignored by this function.

                  -

                  Example:

                  -
                  const mapValues = require('folktale/core/object/map-values');
                  -
                  -const pair = { x: 10, y: 20 };
                  -mapValues(pair, x => x * 2);
                  -// ==> { x: 20, y: 40 }
                  -

                  Caveats

                  -

                  mapValues will not preserve the shape of the original object. -It treats objects as plain maps from String to some value, and -ignores things like prototypical delegation, symbols, and non-enumerable -properties.

                  -

                  Properties

                  Convenience

                  infix(transformation)

                  Conveniently transforms values in an object using the This-Binding syntax.

                  -

                  Source Code

                  Defined in src/core/object/map-values.js at line 19, column 0
                  (object, transformation) => {
                  -  const keys = Object.keys(object);
                  -  const result = {};
                  -
                  -  for (let i = 0; i < keys.length; ++i) {
                  -    const key = keys[i];
                  -    result[key] = transformation(object[key]);
                  -  }
                  -
                  -  return result;
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/object/map-values
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.object.to-pairs.topairs.html b/docs/api/en/folktale.core.object.to-pairs.topairs.html deleted file mode 100644 index 2e5526e..0000000 --- a/docs/api/en/folktale.core.object.to-pairs.topairs.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - toPairs - - - - - -

                  toPairs

                  Returns pairs of (key, value) for all own enumerable properties in an object.

                  -

                  Signature

                  toPairs(object)
                  (Object 'a) => Array (String or Symbol, 'a)

                  Documentation

                  Returns pairs of (key, value) for all own enumerable properties in an object.

                  -

                  Example:

                  -
                  const toPairs = require('folktale/core/object/to-pairs');
                  -
                  -const pair = { x: 10, y: 20 };
                  -toPairs(pair);
                  -// ==> [['x', 10], ['y', 20]]
                  -// (in ES5- VMs this may be [['y', 20], ['x', 10]])
                  -

                  Why?

                  -

                  Objects in JavaScript are commonly used as dictionaries, but natively -there are no operations to work with them in that way. This function -allows one to extract the (key, value) pairs from an object:

                  -
                  const toPairs = require('folktale/core/object/to-pairs');
                  -
                  -const pair = { x: 10, y: 20 };
                  -toPairs(pair);
                  -// ==> [['x', 10], ['y', 20]]
                  -// or  [['y', 20], ['x', 10]]
                  -

                  Inherited properties, and those that are not marked as enumerable, are -not returned in the resulting array:

                  -
                  const p1 = { z: 2 };
                  -const pair2 = Object.create(p1);
                  -pair2.x = 10; pair2.y = 20;
                  -
                  -toPairs(pair2);
                  -// ==> [['x', 10], ['y', 20]]
                  -// or  [['y', 20], ['x', 10]]
                  -
                  -// non-enumerable property x
                  -Object.defineProperty(p1, 'x', { value: 1 });
                  -
                  -toPairs(p1);
                  -// ==> [['z', 2]]
                  -

                  Caveats

                  -

                  While ECMAScript 2015 specifies that objects are ordered using -insertion order, you're not guaranteed to get that behaviour in -any non-ES2015 engine, so for all effects it's better to treat -the result of this operation as an unordered collection.

                  -

                  Properties

                  Source Code

                  Defined in src/core/object/to-pairs.js at line 20, column 0
                  (object) => Object.keys(object).map(k => [k, object[k]])
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/object/to-pairs
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.core.object.values.values.html b/docs/api/en/folktale.core.object.values.values.html deleted file mode 100644 index 75a0248..0000000 --- a/docs/api/en/folktale.core.object.values.values.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - values - - - - - -

                  values

                  Returns the values for all own enumerable properties in an object.

                  -

                  Signature

                  values(object)
                  (Object 'a) => Array 'a

                  Documentation

                  Returns the values for all own enumerable properties in an object.

                  -

                  Example:

                  -
                  const values = require('folktale/core/object/values');
                  -
                  -const pair = { x: 10, y: 20 };
                  -values(pair);
                  -// ==> [10, 20] 
                  -// (In ES5- VMs this may be [20, 10])
                  -

                  Why?

                  -

                  Objects in JavaScript are commonly used as dictionaries, but natively -there are no operations to work with them in that way. This function -allows one to extract the values from an object:

                  -
                  const values = require('folktale/core/object/values');
                  -
                  -const pair = { x: 10, y: 20 };
                  -values(pair);
                  -// ==> [10, 20]  
                  -// or  [20, 10]
                  -

                  Inherited properties, and those that are not marked as enumerable, are -not returned in the resulting array:

                  -
                  const p1 = { z: 2 };
                  -const pair2 = Object.create(p1);
                  -pair2.x = 10; pair2.y = 20;
                  -
                  -values(pair2);
                  -// ==> [10, 20] 
                  -// or  [20, 10]
                  -
                  -// non-enumerable property x
                  -Object.defineProperty(p1, 'x', { value: 1 });
                  -
                  -values(p1);
                  -// ==> [2]
                  -

                  Caveats

                  -

                  While ECMAScript 2015 specifies that objects are ordered using -insertion order, you're not guaranteed to get that behaviour in -any non-ES2015 engine, so for all effects it's better to treat -the result of this operation as an unordered collection.

                  -

                  Properties

                  Source Code

                  Defined in src/core/object/values.js at line 19, column 0
                  (object) => Object.keys(object).map(k => object[k])
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/core/object/values
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.html b/docs/api/en/folktale.data.conversions.html deleted file mode 100644 index ca4a6a0..0000000 --- a/docs/api/en/folktale.data.conversions.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - module folktale/data/conversions - - - - - -

                  module folktale/data/conversions

                  Provides functions to convert from and to different data -structures.

                  -

                  Documentation

                  Provides functions to convert from and to different data -structures.

                  -

                  Properties

                  Converting from Maybe

                  maybeToResult(aMaybe, failureValue)

                  Converts a Maybe to an Result. Nothings map to Errors, Justs map to -Oks.

                  -
                  maybeToValidation(aMaybe, failureValue)

                  Converts a Maybe to a Validation. Nothings map to Failures, Justs map -to Successes.

                  -

                  Converting from Result

                  resultToMaybe(aResult)

                  Converts an Result structure to a Maybe structure. Errors map to Nothings, -Oks map to Justs.

                  -
                  resultToValidation(aResult)

                  Converts an Result to a Validation. Errors map to Failures, Oks map -to Successes.

                  -

                  Converting from Validation

                  validationToMaybe(aValidation)

                  Converts a Validation to a Maybe. Failures map to Nothings, -Successes map to Justs.

                  -
                  validationToResult(aValidation)

                  Converts a Validation to an Result. Failures map to Errors, -Successes map to Oks.

                  -

                  Converting from function with Node-style callback

                  nodebackToTask(fn)

                  Converts a function with a Node-style callback to a Task.

                  -
                  Experimental

                  Converting from nullables

                  nullableToMaybe(a)

                  Converts a nullable value to a maybe. null and undefined map to -Nothing, any other value maps to Justs.

                  -
                  nullableToResult(a)

                  Converts a nullable value to a Result. null and undefined map to -Errors, any other value maps to Oks.

                  -
                  nullableToValidation(a, fallbackValue)

                  Converts a nullable value to a Validation. null and undefined -map to Failures, any other type maps to Successes.

                  -

                  Source Code

                  Defined in src/data/conversions/index.js at line 14, column 0
                  {
                  -  resultToValidation: require('./result-to-validation'),
                  -  resultToMaybe: require('./result-to-maybe'),
                  -  validationToResult: require('./validation-to-result'),
                  -  validationToMaybe: require('./validation-to-maybe'),
                  -  maybeToValidation: require('./maybe-to-validation'),
                  -  maybeToResult: require('./maybe-to-result'),
                  -  nullableToValidation: require('./nullable-to-validation'),
                  -  nullableToResult: require('./nullable-to-result'),
                  -  nullableToMaybe: require('./nullable-to-maybe'),
                  -  nodebackToTask: require('./nodeback-to-task')
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.maybe-to-result.maybetoresult.html b/docs/api/en/folktale.data.conversions.maybe-to-result.maybetoresult.html deleted file mode 100644 index e78204d..0000000 --- a/docs/api/en/folktale.data.conversions.maybe-to-result.maybetoresult.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - maybeToResult - - - - - -

                  maybeToResult

                  Converts a Maybe to an Result. Nothings map to Errors, Justs map to -Oks.

                  -

                  Signature

                  maybeToResult(aMaybe, failureValue)
                  forall a, b:
                  -  (Maybe a, b) => Result b a

                  Documentation

                  Converts a Maybe to an Result. Nothings map to Errors, Justs map to -Oks.

                  -

                  Note that since Maybes don't hold a value for failures in the Nothing tag, -you must provide one to this function.

                  -

                  Example:

                  -
                  const maybeToResult = require('folktale/data/conversions/maybe-to-result');
                  -const { Error, Ok } = require('folktale/data/result');
                  -const { Nothing, Just } = require('folktale/data/maybe');
                  -
                  -maybeToResult(Nothing(), 2); // ==> Error(2)
                  -maybeToResult(Just(1), 2);   // ==> Ok(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/maybe-to-result.js at line 22, column 0
                  (aMaybe, failureValue) =>
                  -  aMaybe.matchWith({
                  -    Nothing: () => Error(failureValue),
                  -    Just: ({ value }) => Ok(value)
                  -  })
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/maybe-to-result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.maybe-to-validation.maybetovalidation.html b/docs/api/en/folktale.data.conversions.maybe-to-validation.maybetovalidation.html deleted file mode 100644 index a9787ef..0000000 --- a/docs/api/en/folktale.data.conversions.maybe-to-validation.maybetovalidation.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - maybeToValidation - - - - - -

                  maybeToValidation

                  Converts a Maybe to a Validation. Nothings map to Failures, Justs map -to Successes.

                  -

                  Signature

                  maybeToValidation(aMaybe, failureValue)
                  forall a, b:
                  -  (Maybe a, b) => Validation b a

                  Documentation

                  Converts a Maybe to a Validation. Nothings map to Failures, Justs map -to Successes.

                  -

                  Note that since Maybe failures can't hold a value in the Nothing tag, you -must provide one for the validation.

                  -

                  Example:

                  -
                  const maybeToValidation = require('folktale/data/conversions/maybe-to-validation');
                  -const { Failure, Success } = require('folktale/data/validation');
                  -const { Nothing, Just } = require('folktale/data/maybe');
                  -
                  -maybeToValidation(Nothing(), 2);  // ==> Failure(2)
                  -maybeToValidation(Just(1), 2);    // ==> Success(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/maybe-to-validation.js at line 22, column 0
                  (aMaybe, failureValue) =>
                  -  aMaybe.matchWith({
                  -    Nothing: () => Failure(failureValue),
                  -    Just:    ({ value }) => Success(value)
                  -  })
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/maybe-to-validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.nodeback-to-task.nodebacktotask.html b/docs/api/en/folktale.data.conversions.nodeback-to-task.nodebacktotask.html deleted file mode 100644 index a769b25..0000000 --- a/docs/api/en/folktale.data.conversions.nodeback-to-task.nodebacktotask.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - nodebackToTask - - - - - -

                  nodebackToTask

                  Converts a function with a Node-style callback to a Task.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  nodebackToTask(fn)
                  forall s, e, r:
                  -((Any..., (e, s) => Void) => Void)
                  -=> (Any...)
                  -=> Task e s r

                  Documentation

                  Converts a function with a Node-style callback to a Task.

                  -

                  Example:

                  -
                  const nodebackFromTask = require('folktale/data/conversions/nodeback-to-task');
                  -
                  -const fn = (str, str2, cb) => cb(null, str + str2 + 'processed');
                  -const convertedFn = nodebackFromTask(fn);
                  -const task = convertedFn('test', '-was-');
                  -const value = await task.run().promise();
                  -
                  -$ASSERT(value === 'test-was-processed');
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/nodeback-to-task.js at line 23, column 0
                  fn => (...args) => (
                  -  task(r =>
                  -    fn(...args, (err, data) => err ? r.reject(err) : r.resolve(data))
                  -  )
                  -)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/nodeback-to-task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @rpearce
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.nullable-to-maybe.nullabletomaybe.html b/docs/api/en/folktale.data.conversions.nullable-to-maybe.nullabletomaybe.html deleted file mode 100644 index d32112c..0000000 --- a/docs/api/en/folktale.data.conversions.nullable-to-maybe.nullabletomaybe.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - nullableToMaybe - - - - - -

                  nullableToMaybe

                  Converts a nullable value to a maybe. null and undefined map to -Nothing, any other value maps to Justs.

                  -

                  Signature

                  nullableToMaybe(a)
                  forall a:
                  -  (a or None) => Maybe a

                  Documentation

                  Converts a nullable value to a maybe. null and undefined map to -Nothing, any other value maps to Justs.

                  -

                  A nullable is a value that may be any type, or null/undefined. Since -Nothing can't hold values, it's not possible to differentiate whether -the original value was null or undefined after the conversion.

                  -

                  Example:

                  -
                  const nullableToMaybe = require('folktale/data/conversions/nullable-to-maybe');
                  -const { Nothing, Just } = require('folktale/data/maybe');
                  -
                  -nullableToMaybe(undefined);  // ==> Nothing()
                  -nullableToMaybe(null);       // ==> Nothing()
                  -nullableToMaybe(1);          // ==> Just(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/nullable-to-maybe.js at line 22, column 0
                  (a) =>
                  -  a != null ? Just(a)
                  -  :/*else*/   Nothing()
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/nullable-to-maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.nullable-to-result.nullabletoresult.html b/docs/api/en/folktale.data.conversions.nullable-to-result.nullabletoresult.html deleted file mode 100644 index 68e1035..0000000 --- a/docs/api/en/folktale.data.conversions.nullable-to-result.nullabletoresult.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - nullableToResult - - - - - -

                  nullableToResult

                  Converts a nullable value to a Result. null and undefined map to -Errors, any other value maps to Oks.

                  -

                  Signature

                  nullableToResult(a)
                  forall a:
                  -  (a or None) => Result None a

                  Documentation

                  Converts a nullable value to a Result. null and undefined map to -Errors, any other value maps to Oks.

                  -

                  A nullable is a value that may be any type, or null/undefined.

                  -

                  Example:

                  -
                  const nullableToResult = require('folktale/data/conversions/nullable-to-result');
                  -const { Error, Ok } = require('folktale/data/result');
                  -
                  -nullableToResult(undefined);  // ==> Error(undefined)
                  -nullableToResult(null);       // ==> Error(null)
                  -nullableToResult(1);          // ==> Ok(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/nullable-to-result.js at line 22, column 0
                  (a) =>
                  -  a != null ? Ok(a)
                  -  :/*else*/   Error(a)
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/nullable-to-result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.nullable-to-validation.nullabletovalidation.html b/docs/api/en/folktale.data.conversions.nullable-to-validation.nullabletovalidation.html deleted file mode 100644 index a46bef5..0000000 --- a/docs/api/en/folktale.data.conversions.nullable-to-validation.nullabletovalidation.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - nullableToValidation - - - - - -

                  nullableToValidation

                  Converts a nullable value to a Validation. null and undefined -map to Failures, any other type maps to Successes.

                  -

                  Signature

                  nullableToValidation(a, fallbackValue)
                  forall a, b:
                  -  (a or None, b) => Validation b a

                  Documentation

                  Converts a nullable value to a Validation. null and undefined -map to Failures, any other type maps to Successes.

                  -

                  A nullable is a value that may be any type, or null/undefined.

                  -

                  Example:

                  -
                  const nullableToValidation = require('folktale/data/conversions/nullable-to-validation');
                  -const { Failure, Success } = require('folktale/data/validation');
                  -
                  -nullableToValidation(undefined, 'error');
                  -// ==> Failure('error')
                  -
                  -nullableToValidation(null, 'error');
                  -// ==> Failure('error')
                  -
                  -nullableToValidation(1, 'error');
                  -// ==> Success(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/nullable-to-validation.js at line 22, column 0
                  (a, fallbackValue) =>
                  -  a != null ?  Success(a)
                  -  :/*else*/    Failure(fallbackValue)
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/nullable-to-validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.result-to-maybe.resulttomaybe.html b/docs/api/en/folktale.data.conversions.result-to-maybe.resulttomaybe.html deleted file mode 100644 index 61eba8c..0000000 --- a/docs/api/en/folktale.data.conversions.result-to-maybe.resulttomaybe.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - resultToMaybe - - - - - -

                  resultToMaybe

                  Converts an Result structure to a Maybe structure. Errors map to Nothings, -Oks map to Justs.

                  -

                  Signature

                  resultToMaybe(aResult)
                  forall a, b:
                  -  (Result a b) => Maybe b

                  Documentation

                  Converts an Result structure to a Maybe structure. Errors map to Nothings, -Oks map to Justs.

                  -

                  Not that Error values are lost in the conversion process, since failures -in Maybe (the Nothing tag) don't have a value.

                  -

                  Example:

                  -
                  const resultToMaybe = require('folktale/data/conversions/result-to-maybe');
                  -const { Error, Ok } = require('folktale/data/result');
                  -const { Just, Nothing } = require('folktale/data/maybe');
                  -
                  -resultToMaybe(Error(1));  // ==> Nothing()
                  -resultToMaybe(Ok(1)); // ==> Just(1) 
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/result-to-maybe.js at line 22, column 0
                  (aResult) =>
                  -  aResult.matchWith({
                  -    Error: ({ value: _ }) => Nothing(),
                  -    Ok: ({ value }) => Just(value)
                  -  })
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/result-to-maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.result-to-validation.resulttovalidation.html b/docs/api/en/folktale.data.conversions.result-to-validation.resulttovalidation.html deleted file mode 100644 index 611025f..0000000 --- a/docs/api/en/folktale.data.conversions.result-to-validation.resulttovalidation.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - resultToValidation - - - - - -

                  resultToValidation

                  Converts an Result to a Validation. Errors map to Failures, Oks map -to Successes.

                  -

                  Signature

                  resultToValidation(aResult)
                  forall a, b:
                  -  (Result a b) => Validation a b

                  Documentation

                  Converts an Result to a Validation. Errors map to Failures, Oks map -to Successes.

                  -

                  Example:

                  -
                  const resultToValidation = require('folktale/data/conversions/result-to-validation');
                  -const { Error, Ok } = require('folktale/data/result');
                  -const { Failure, Success } = require('folktale/data/validation');
                  -
                  -resultToValidation(Error(1));  // ==> Failure(1)
                  -resultToValidation(Ok(1)); // ==> Success(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/result-to-validation.js at line 22, column 0
                  (aResult) =>
                  -  aResult.matchWith({
                  -    Error: ({ value }) => Failure(value),
                  -    Ok: ({ value }) => Success(value)
                  -  })
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/result-to-validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.validation-to-maybe.validationtomaybe.html b/docs/api/en/folktale.data.conversions.validation-to-maybe.validationtomaybe.html deleted file mode 100644 index 624ca2d..0000000 --- a/docs/api/en/folktale.data.conversions.validation-to-maybe.validationtomaybe.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - validationToMaybe - - - - - -

                  validationToMaybe

                  Converts a Validation to a Maybe. Failures map to Nothings, -Successes map to Justs.

                  -

                  Signature

                  validationToMaybe(aValidation)
                  forall a, b:
                  -  (Validation a b) => Maybe b

                  Documentation

                  Converts a Validation to a Maybe. Failures map to Nothings, -Successes map to Justs.

                  -

                  Failure values are lost in the process, since the Nothing tag can't -hold any values.

                  -

                  Example:

                  -
                  const validationToMaybe = require('folktale/data/conversions/validation-to-maybe');
                  -const { Failure, Success } = require('folktale/data/validation');
                  -const { Nothing, Just } = require('folktale/data/maybe');
                  -
                  -validationToMaybe(Failure(1));  // ==> Nothing()
                  -validationToMaybe(Success(1));  // ==> Just(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/validation-to-maybe.js at line 22, column 0
                  (aValidation) =>
                  -  aValidation.matchWith({
                  -    Failure:  () => Nothing(),
                  -    Success:  ({ value }) => Just(value)
                  -  })
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/validation-to-maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.conversions.validation-to-result.validationtoresult.html b/docs/api/en/folktale.data.conversions.validation-to-result.validationtoresult.html deleted file mode 100644 index a20b842..0000000 --- a/docs/api/en/folktale.data.conversions.validation-to-result.validationtoresult.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - validationToResult - - - - - -

                  validationToResult

                  Converts a Validation to an Result. Failures map to Errors, -Successes map to Oks.

                  -

                  Signature

                  validationToResult(aValidation)
                  forall a, b:
                  -   (Validation a b) => Result a b

                  Documentation

                  Converts a Validation to an Result. Failures map to Errors, -Successes map to Oks.

                  -

                  Example:

                  -
                  const validationToResult = require('folktale/data/conversions/validation-to-result');
                  -const { Error, Ok } = require('folktale/data/result');
                  -const { Failure, Success } = require('folktale/data/validation');
                  -
                  -validationToResult(Failure(1));  // ==> Error(1)
                  -validationToResult(Success(1));  // ==> Ok(1) 
                  -

                  Properties

                  Source Code

                  Defined in src/data/conversions/validation-to-result.js at line 22, column 0
                  (aValidation) =>
                  -  aValidation.matchWith({
                  -    Failure: ({ value }) => Error(value),
                  -    Success: ({ value }) => Ok(value)
                  -  })
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/conversions/validation-to-result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred._deferred.html b/docs/api/en/folktale.data.future._deferred._deferred.html deleted file mode 100644 index e442d2d..0000000 --- a/docs/api/en/folktale.data.future._deferred._deferred.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Deferred - - - - - -

                  Deferred

                  A deferred is an internal structure for creating Futures. Because deferred is an imperative structure, users should instead construct futures through the Task structure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Deferred()

                  Documentation

                  A deferred is an internal structure for creating Futures. Because deferred is an imperative structure, users should instead construct futures through the Task structure.

                  -

                  Static properties

                  Special Values

                  prototype

                  A container for methods of Deferreds.

                  -

                  Instance (prototype) properties

                  Data Fields

                  get _listeners

                  An array of visitors providing functions to be ran when the deferred's state changes.

                  -
                  Abstract
                  get _state

                  The current state of the deferred, as an ExecutionState.

                  -
                  Abstract

                  Debugging

                  inspect()

                  Returns a textual description of the object.

                  -
                  toString()

                  Returns a textual description of the object.

                  -

                  Extracting Values

                  future()

                  Retrieves the value of a deferred as a Future.

                  -
                  promise()

                  Retrieves the value of a deferred as a Promise. Cancellations are mapped to a rejected promise with a special object.

                  -

                  Reacting to Deferreds

                  listen(pattern)

                  Adds a visitor to be invoked when the deferred's state changes.

                  -

                  Resolving

                  cancel()

                  Resolves a deferred with a cancellation value.

                  -
                  maybeCancel()

                  Resolves a deferred with a cancellation value, but doesn't throw if the deferred has already been resolved.

                  -
                  reject(reason)

                  Resolves a deferred with a failure value.

                  -
                  resolve(value)

                  Resolves a deferred successfully with a value.

                  -

                  Source Code

                  Defined in src/data/future/_deferred.js at line 52, column 0
                  function Deferred() {
                  -  define(this, '_state', Pending());
                  -  define(this, '_listeners', []);
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred._listeners.html b/docs/api/en/folktale.data.future._deferred._listeners.html deleted file mode 100644 index e79fe76..0000000 --- a/docs/api/en/folktale.data.future._deferred._listeners.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - _listeners - - - - - -

                  _listeners

                  An array of visitors providing functions to be ran when the deferred's state changes.

                  -

                  Signature

                  get _listeners()
                  get (Deferred 'f 's) => Array (DeferredListener 'f 's)

                  Documentation

                  An array of visitors providing functions to be ran when the deferred's state changes.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  get _listeners() {
                  -    throw new TypeError('Deferred.prototype is abstract and does not implement ._listeners');
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred._state.html b/docs/api/en/folktale.data.future._deferred._state.html deleted file mode 100644 index f77e647..0000000 --- a/docs/api/en/folktale.data.future._deferred._state.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - _state - - - - - -

                  _state

                  The current state of the deferred, as an ExecutionState.

                  -

                  Signature

                  get _state()
                  get (Deferred 'f 's) => ExecutionState 'f 's

                  Documentation

                  The current state of the deferred, as an ExecutionState.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  get _state() {
                  -    throw new TypeError('Deferred.prototype is abstract and does not implement ._state.');
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred.cancel.html b/docs/api/en/folktale.data.future._deferred.cancel.html deleted file mode 100644 index 798922c..0000000 --- a/docs/api/en/folktale.data.future._deferred.cancel.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - cancel - - - - - -

                  cancel

                  Resolves a deferred with a cancellation value.

                  -

                  Signature

                  cancel()
                  ('a: Deferred 'f 's).() => 'a :: mutates 'a

                  Documentation

                  Resolves a deferred with a cancellation value.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  cancel() {
                  -    moveToState(this, Cancelled());
                  -    return this;
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred.future.html b/docs/api/en/folktale.data.future._deferred.future.html deleted file mode 100644 index 5e3984f..0000000 --- a/docs/api/en/folktale.data.future._deferred.future.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - future - - - - - -

                  future

                  Retrieves the value of a deferred as a Future.

                  -

                  Signature

                  future()
                  (Deferred 'f 's).() => Future 'f 's

                  Documentation

                  Retrieves the value of a deferred as a Future.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  future() {
                  -    let future = new (Future());    // eslint-disable-line prefer-const
                  -    this.listen({
                  -      onCancelled: _      => moveToState(future, Cancelled()),
                  -      onRejected:  reason => moveToState(future, Rejected(reason)),
                  -      onResolved:  value  => moveToState(future, Resolved(value)) 
                  -    });
                  -
                  -    return future;
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred.inspect.html b/docs/api/en/folktale.data.future._deferred.inspect.html deleted file mode 100644 index 6e6deda..0000000 --- a/docs/api/en/folktale.data.future._deferred.inspect.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - inspect - - - - - -

                  inspect

                  Returns a textual description of the object.

                  -

                  Signature

                  inspect()
                  (Deferred 'f 's).() => String

                  Documentation

                  Returns a textual description of the object.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  inspect() {
                  -    return this.toString();
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred.listen.html b/docs/api/en/folktale.data.future._deferred.listen.html deleted file mode 100644 index a706622..0000000 --- a/docs/api/en/folktale.data.future._deferred.listen.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - listen - - - - - -

                  listen

                  Adds a visitor to be invoked when the deferred's state changes.

                  -

                  Signature

                  listen(pattern)
                  ('a: Deferred 'f 's).(DeferredListener 'f 's) => Void

                  Documentation

                  Adds a visitor to be invoked when the deferred's state changes.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  listen(pattern) {
                  -    this._state.matchWith({
                  -      Pending:   _            => this._listeners.push(pattern),
                  -      Cancelled: _            => pattern.onCancelled(), 
                  -      Resolved:  ({ value })  => pattern.onResolved(value),
                  -      Rejected:  ({ reason }) => pattern.onRejected(reason)
                  -    });
                  -    return this;
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred.maybecancel.html b/docs/api/en/folktale.data.future._deferred.maybecancel.html deleted file mode 100644 index 7e925fe..0000000 --- a/docs/api/en/folktale.data.future._deferred.maybecancel.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - maybeCancel - - - - - -

                  maybeCancel

                  Resolves a deferred with a cancellation value, but doesn't throw if the deferred has already been resolved.

                  -

                  Signature

                  maybeCancel()
                  ('a: Deferred 'f 's).() => 'a :: mutates 'a

                  Documentation

                  Resolves a deferred with a cancellation value, but doesn't throw if the deferred has already been resolved.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  maybeCancel() {
                  -    if (Pending.hasInstance(this._state)) {
                  -      this.cancel();
                  -    }
                  -    return this;
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred.promise.html b/docs/api/en/folktale.data.future._deferred.promise.html deleted file mode 100644 index 7b7aea6..0000000 --- a/docs/api/en/folktale.data.future._deferred.promise.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - promise - - - - - -

                  promise

                  Retrieves the value of a deferred as a Promise. Cancellations are mapped to a rejected promise with a special object.

                  -

                  Signature

                  promise()
                  (Deferred 'f 's).() => Promise 'f 's

                  Documentation

                  Retrieves the value of a deferred as a Promise. Cancellations are mapped to a rejected promise with a special object.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  promise() {
                  -    return new Promise((resolve, reject) => {
                  -      this.listen({
                  -        onCancelled: _ => reject(Cancelled()),
                  -        onResolved: resolve,
                  -        onRejected: reject 
                  -      });
                  -    });
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred.reject.html b/docs/api/en/folktale.data.future._deferred.reject.html deleted file mode 100644 index 4d0f350..0000000 --- a/docs/api/en/folktale.data.future._deferred.reject.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - reject - - - - - -

                  reject

                  Resolves a deferred with a failure value.

                  -

                  Signature

                  reject(reason)
                  ('a: Deferred 'f 's).('f) => 'a :: mutates 'a

                  Documentation

                  Resolves a deferred with a failure value.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  reject(reason) {
                  -    moveToState(this, Rejected(reason));
                  -    return this;
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred.resolve.html b/docs/api/en/folktale.data.future._deferred.resolve.html deleted file mode 100644 index aad5af6..0000000 --- a/docs/api/en/folktale.data.future._deferred.resolve.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - resolve - - - - - -

                  resolve

                  Resolves a deferred successfully with a value.

                  -

                  Signature

                  resolve(value)
                  ('a: Deferred 'f 's).('s) => 'a :: mutates 'a

                  Documentation

                  Resolves a deferred successfully with a value.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  resolve(value) {
                  -    moveToState(this, Resolved(value));
                  -    return this;
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._deferred.tostring.html b/docs/api/en/folktale.data.future._deferred.tostring.html deleted file mode 100644 index 963eab6..0000000 --- a/docs/api/en/folktale.data.future._deferred.tostring.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - toString - - - - - -

                  toString

                  Returns a textual description of the object.

                  -

                  Signature

                  toString()
                  (Deferred 'f 's).() => String

                  Documentation

                  Returns a textual description of the object.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_deferred.js at line 58, column 21
                  toString() {
                  -    const listeners = this._listeners.length;
                  -    const state     = this._state;
                  -
                  -    return `folktale:Deferred(${state}, ${listeners} listeners)`;
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_deferred
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._execution-state.0.html b/docs/api/en/folktale.data.future._execution-state.0.html deleted file mode 100644 index 12c729d..0000000 --- a/docs/api/en/folktale.data.future._execution-state.0.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Pending - - - - - -

                  Pending

                  The state of a future that's still not resolved.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Pending()

                  Documentation

                  The state of a future that's still not resolved.

                  -

                  Static properties

                  Debugging

                  inspect: toString()

                  A textual representation of the state

                  -
                  Experimental
                  prototype

                  A container of methods for the variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the state

                  -
                  Experimental

                  Special Values

                  get constructor

                  The constructor for the variant

                  -
                  Experimental
                  get tag

                  The internal tag of the variant.

                  -
                  Experimental
                  get type

                  The internal type of the variant.

                  -
                  Experimental

                  Testing and Comparing

                  hasInstance(value)

                  True if the value is an instance of the state.

                  -
                  Experimental

                  Instance (prototype) properties

                  Fantasy Land

                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Special Values

                  get constructor

                  The constructor for the variant

                  -
                  variants

                  The variants in the ExecutionState

                  -
                  ExperimentalInherited

                  Testing and Comparing

                  hasInstance(value)

                  True if the value is any execution state instance.

                  -
                  ExperimentalInherited

                  Variant

                  Cancelled()

                  The state of a future that has been cancelled.

                  -
                  ExperimentalInherited
                  Pending()

                  The state of a future that's still not resolved.

                  -
                  ExperimentalInherited
                  Rejected(reason)

                  The state of a future that has been resolved with a failure.

                  -
                  ExperimentalInherited
                  Resolved(value)

                  The state of a future that has been successfully resolved with a value.

                  -
                  ExperimentalInherited

                  (Uncategorised)

                  Experimental
                  Experimental
                  Deprecated
                  Experimental
                  Experimental

                  Source Code

                  Pending() {
                  -    return {};
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_execution-state
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._execution-state._executionstate.html b/docs/api/en/folktale.data.future._execution-state._executionstate.html deleted file mode 100644 index abd0616..0000000 --- a/docs/api/en/folktale.data.future._execution-state._executionstate.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - ExecutionState - - - - - -

                  ExecutionState

                  An union defining the possible states of a Future.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  An union defining the possible states of a Future.

                  -

                  Properties

                  Debugging

                  inspect: toString()

                  A textual representation of the state.

                  -
                  Experimental
                  toString()

                  A textual representation of the state.

                  -
                  Experimental

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Special Values

                  variants

                  The variants in the ExecutionState

                  -
                  Experimental

                  Testing and Comparing

                  hasInstance(value)

                  True if the value is any execution state instance.

                  -
                  Experimental

                  Variant

                  Cancelled()

                  The state of a future that has been cancelled.

                  -
                  Experimental
                  Pending()

                  The state of a future that's still not resolved.

                  -
                  Experimental
                  Rejected(reason)

                  The state of a future that has been resolved with a failure.

                  -
                  Experimental
                  Resolved(value)

                  The state of a future that has been successfully resolved with a value.

                  -
                  Experimental

                  Source Code

                  Defined in src/data/future/_execution-state.js at line 19, column 0
                  data('folktale:ExecutionState', {
                  -  /*~
                  -   */
                  -  Pending() {
                  -    return {};
                  -  },
                  -
                  -  /*~
                  -   */
                  -  Cancelled() {
                  -    return {};
                  -  },
                  -
                  -  /*~
                  -   */
                  -  Resolved(value) {
                  -    return { value };
                  -  },
                  -
                  -  /*~
                  -   */
                  -  Rejected(reason) {
                  -    return { reason };
                  -  }
                  -}).derive(equality, debugRepresentation)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_execution-state
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._execution-state.cancelled.html b/docs/api/en/folktale.data.future._execution-state.cancelled.html deleted file mode 100644 index 9bff68d..0000000 --- a/docs/api/en/folktale.data.future._execution-state.cancelled.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Cancelled - - - - - -

                  Cancelled

                  The state of a future that has been cancelled.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Cancelled()

                  Documentation

                  The state of a future that has been cancelled.

                  -

                  Static properties

                  Debugging

                  inspect: toString()

                  A textual representation of the state

                  -
                  Experimental
                  prototype

                  A container of methods for the variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the state

                  -
                  Experimental

                  Special Values

                  get constructor

                  The constructor for the variant

                  -
                  Experimental
                  get tag

                  The internal tag of the variant.

                  -
                  Experimental
                  get type

                  The internal type of the variant.

                  -
                  Experimental

                  Testing and Comparing

                  hasInstance(value)

                  True if the value is an instance of the state.

                  -
                  Experimental

                  Instance (prototype) properties

                  Fantasy Land

                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Special Values

                  get constructor

                  The constructor for the variant

                  -
                  variants

                  The variants in the ExecutionState

                  -
                  ExperimentalInherited

                  Testing and Comparing

                  hasInstance(value)

                  True if the value is any execution state instance.

                  -
                  ExperimentalInherited

                  Variant

                  Cancelled()

                  The state of a future that has been cancelled.

                  -
                  ExperimentalInherited
                  Pending()

                  The state of a future that's still not resolved.

                  -
                  ExperimentalInherited
                  Rejected(reason)

                  The state of a future that has been resolved with a failure.

                  -
                  ExperimentalInherited
                  Resolved(value)

                  The state of a future that has been successfully resolved with a value.

                  -
                  ExperimentalInherited

                  (Uncategorised)

                  Experimental
                  Experimental
                  Deprecated
                  Experimental
                  Experimental

                  Source Code

                  Cancelled() {
                  -    return {};
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_execution-state
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._execution-state.inspect.html b/docs/api/en/folktale.data.future._execution-state.inspect.html deleted file mode 100644 index d3bf9a6..0000000 --- a/docs/api/en/folktale.data.future._execution-state.inspect.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - toString - - - - - -

                  toString

                  A textual representation of the state

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toString()
                  () => String

                  Documentation

                  A textual representation of the state

                  -

                  Properties

                  Source Code

                  () => variantName
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_execution-state
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._execution-state.rejected.html b/docs/api/en/folktale.data.future._execution-state.rejected.html deleted file mode 100644 index 2887bed..0000000 --- a/docs/api/en/folktale.data.future._execution-state.rejected.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Rejected - - - - - -

                  Rejected

                  The state of a future that has been resolved with a failure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Rejected(reason)

                  Documentation

                  The state of a future that has been resolved with a failure.

                  -

                  Static properties

                  Debugging

                  inspect: toString()

                  A textual representation of the state

                  -
                  Experimental
                  prototype

                  A container of methods for the variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the state

                  -
                  Experimental

                  Special Values

                  get constructor

                  The constructor for the variant

                  -
                  Experimental
                  get tag

                  The internal tag of the variant.

                  -
                  Experimental
                  get type

                  The internal type of the variant.

                  -
                  Experimental

                  Testing and Comparing

                  hasInstance(value)

                  True if the value is an instance of the state.

                  -
                  Experimental

                  Instance (prototype) properties

                  Fantasy Land

                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Special Values

                  get constructor

                  The constructor for the variant

                  -
                  variants

                  The variants in the ExecutionState

                  -
                  ExperimentalInherited

                  Testing and Comparing

                  hasInstance(value)

                  True if the value is any execution state instance.

                  -
                  ExperimentalInherited

                  Variant

                  Cancelled()

                  The state of a future that has been cancelled.

                  -
                  ExperimentalInherited
                  Pending()

                  The state of a future that's still not resolved.

                  -
                  ExperimentalInherited
                  Rejected(reason)

                  The state of a future that has been resolved with a failure.

                  -
                  ExperimentalInherited
                  Resolved(value)

                  The state of a future that has been successfully resolved with a value.

                  -
                  ExperimentalInherited

                  (Uncategorised)

                  Experimental
                  Experimental
                  Deprecated
                  Experimental
                  Experimental

                  Source Code

                  Rejected(reason) {
                  -    return { reason };
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_execution-state
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._execution-state.resolved.html b/docs/api/en/folktale.data.future._execution-state.resolved.html deleted file mode 100644 index be10140..0000000 --- a/docs/api/en/folktale.data.future._execution-state.resolved.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Resolved - - - - - -

                  Resolved

                  The state of a future that has been successfully resolved with a value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Resolved(value)

                  Documentation

                  The state of a future that has been successfully resolved with a value.

                  -

                  Static properties

                  Debugging

                  inspect: toString()

                  A textual representation of the state

                  -
                  Experimental
                  prototype

                  A container of methods for the variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the state

                  -
                  Experimental

                  Special Values

                  get constructor

                  The constructor for the variant

                  -
                  Experimental
                  get tag

                  The internal tag of the variant.

                  -
                  Experimental
                  get type

                  The internal type of the variant.

                  -
                  Experimental

                  Testing and Comparing

                  hasInstance(value)

                  True if the value is an instance of the state.

                  -
                  Experimental

                  Instance (prototype) properties

                  Fantasy Land

                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Special Values

                  get constructor

                  The constructor for the variant

                  -
                  variants

                  The variants in the ExecutionState

                  -
                  ExperimentalInherited

                  Testing and Comparing

                  hasInstance(value)

                  True if the value is any execution state instance.

                  -
                  ExperimentalInherited

                  Variant

                  Cancelled()

                  The state of a future that has been cancelled.

                  -
                  ExperimentalInherited
                  Pending()

                  The state of a future that's still not resolved.

                  -
                  ExperimentalInherited
                  Rejected(reason)

                  The state of a future that has been resolved with a failure.

                  -
                  ExperimentalInherited
                  Resolved(value)

                  The state of a future that has been successfully resolved with a value.

                  -
                  ExperimentalInherited

                  (Uncategorised)

                  Experimental
                  Experimental
                  Deprecated
                  Experimental
                  Experimental

                  Source Code

                  Resolved(value) {
                  -    return { value };
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_execution-state
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future._future.html b/docs/api/en/folktale.data.future._future._future.html deleted file mode 100644 index 29eb684..0000000 --- a/docs/api/en/folktale.data.future._future._future.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - Future - - - - - -

                  Future

                  Models the eventual result of asynchronous computations.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  Models the eventual result of asynchronous computations.

                  -

                  Static properties

                  Constructing

                  of(value)

                  Constructs a Future holding a successful value.

                  -
                  Experimental
                  rejected(reason)

                  Constructs a future holding a failure value.

                  -
                  Experimental

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Special Values

                  prototype

                  A container for methods of Futures.

                  -
                  Experimental

                  Instance (prototype) properties

                  Debugging

                  inspect: value()

                  Returns a textual representation of the Future.

                  -
                  Experimental
                  toString: value()

                  Returns a textual representation of the Future.

                  -
                  Experimental

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/bimap(f, g)

                  Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

                  -
                  fantasy-land/chain(transformation)

                  Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

                  -
                  fantasy-land/map(transformation)

                  Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

                  -

                  Internal Fields

                  get _listeners

                  A list of visitors to be invoked when the state of the future changes.

                  -
                  Abstract
                  get _state

                  The current state of the Future.

                  -
                  Abstract

                  Pattern Matching

                  willMatchWith: value(pattern)

                  Limited pattern matching for futures.

                  -
                  Experimental

                  Reacting to Futures

                  listen: value(pattern)

                  Adds a visitor to the Future, which will be invoked when the Future's state changes.

                  -
                  Experimental

                  Recovering From Errors

                  recover: value(handler)

                  Transforms a failed future into a new future.

                  -
                  Experimental
                  swap: value()

                  Inverts the state of a Future: successes become failures, failures become successes.

                  -
                  Experimental

                  Transforming

                  apply: value(future)

                  Transforms the succesful value of a future by using a function stored in another future.

                  -
                  Experimental
                  bimap: value(rejectionTransformation, successTransformation)

                  Transforms both successful and failure values in a Future, without touching its state.

                  -
                  Experimental
                  chain: value(transformation)

                  Transforms a Future's successful value along with its state.

                  -
                  Experimental
                  map: value(transformation)

                  Transforms the successful value of a Future, without touching its state.

                  -
                  Experimental
                  mapRejected: value(transformation)

                  Transforms failure values in a Future without touching its state.

                  -
                  Experimental

                  Types

                  constructor()

                  Models the eventual result of asynchronous computations.

                  -
                  Experimental

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  class Future {
                  -  constructor() {
                  -    define(this, '_state', Pending());
                  -    define(this, '_listeners', []);
                  -  }
                  -
                  -
                  -  // ---[ State and configuration ]------------------------------------
                  -  /*~
                  -   * isRequired: true
                  -   * type: |
                  -   *   get (Future 'f 's) => ExecutionState 'f 's
                  -   */
                  -  get _state() {
                  -    throw new TypeError('Future.prototype._state should be implemented in an inherited object.');
                  -  }
                  -
                  -  /*~
                  -   * isRequired: true
                  -   * type: |
                  -   *   get (Future 'f 's) => Array (DeferredListener 'f 's)
                  -   */
                  -  get _listeners() {
                  -    throw new TypeError('Future.prototype._listeners should be implemented in an inherited object.');
                  -  }
                  -
                  -
                  -  // ---[ Reacting to Future events ]----------------------------------
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).(DeferredListener 'f 's) => Future 'f 's
                  -   */
                  -  listen(pattern) {
                  -    this._state.matchWith({
                  -      Pending:   ()           => this._listeners.push(pattern),
                  -      Cancelled: ()           => pattern.onCancelled(), 
                  -      Resolved:  ({ value })  => pattern.onResolved(value),
                  -      Rejected:  ({ reason }) => pattern.onRejected(reason)
                  -    });
                  -    return this;
                  -  }
                  -
                  -
                  -  // --[ Transforming Futures ]----------------------------------------
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).(('s) => Future 's2) => Future 'f 's2
                  -   */
                  -  chain(transformation) {
                  -    let deferred = new Deferred();    // eslint-disable-line prefer-const
                  -    this.listen({
                  -      onCancelled: ()     => deferred.cancel(),
                  -      onRejected:  reason => deferred.reject(reason),
                  -      onResolved:  value  => {
                  -        transformation(value).listen({
                  -          onCancelled: ()     => deferred.cancel(),
                  -          onRejected:  reason => deferred.reject(reason),
                  -          onResolved:  value2 => deferred.resolve(value2)
                  -        });
                  -      }
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).(('s) => 's2) => Future 'f 's2
                  -   */
                  -  map(transformation) {
                  -    return this.chain(value => Future.of(transformation(value)));
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).(Future 'f (('s) => 's2)) => Future 'f 's2
                  -   */
                  -  apply(future) {
                  -    return this.chain(fn => future.map(fn));
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).(('f) => 'f2, ('s) => 's2) => Future 'f2 's2
                  -   */
                  -  bimap(rejectionTransformation, successTransformation) {
                  -    let deferred = new Deferred();      // eslint-disable-line prefer-const
                  -    this.listen({
                  -      onCancelled: ()     => deferred.cancel(),
                  -      onRejected:  reason => deferred.reject(rejectionTransformation(reason)),
                  -      onResolved:  value  => deferred.resolve(successTransformation(value))
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).(('f) => 'f2) => Future 'f2 's
                  -   */
                  -  mapRejected(transformation) {
                  -    return this.bimap(transformation, x => x);
                  -  }
                  -
                  -
                  -  // ---[ Recovering from errors ]-------------------------------------
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).(('f) => Future 'f2 's2) => Future 'f2 's
                  -   */
                  -  recover(handler) {
                  -    let deferred = new Deferred();      // eslint-disable-line prefer-const
                  -    this.listen({
                  -      onCancelled: ()     => deferred.cancel(),
                  -      onResolved:  value  => deferred.resolve(value),
                  -      onRejected:  reason => {
                  -        handler(reason).listen({
                  -          onCancelled: ()        => deferred.cancel(),
                  -          onResolved:  value     => deferred.resolve(value),
                  -          onRejected:  newReason => deferred.reject(newReason)
                  -        });
                  -      }
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  -
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall a, b, c, d:
                  -   *     type Pattern = { r |
                  -   *       Cancelled: ()  => Future c d,
                  -   *       Resolved:  (b) => Future c d,
                  -   *       Rejected:  (a) => Future c d
                  -   *     }
                  -   *     
                  -   *     (Future a b).(Pattern) => Future c d 
                  -   */
                  -  willMatchWith(pattern) {
                  -    let deferred = new Deferred();      // eslint-disable-line prefer-const
                  -    const resolve = (handler) => (value) => handler(value).listen({
                  -      onCancelled: ()         => deferred.cancel(),
                  -      onResolved:  (newValue) => deferred.resolve(newValue),
                  -      onRejected:  (reason)   => deferred.reject(reason) 
                  -    });
                  -    this.listen({
                  -      onCancelled: resolve(pattern.Cancelled),
                  -      onResolved:  resolve(pattern.Resolved),
                  -      onRejected:  resolve(pattern.Rejected)
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).() => Future 's 'f
                  -   */
                  -  swap() {
                  -    let deferred = new Deferred();    // eslint-disable-line prefer-const
                  -    this.listen({
                  -      onCancelled: ()     => deferred.cancel(),
                  -      onRejected:  reason => deferred.resolve(reason),
                  -      onResolved:  value  => deferred.reject(value) 
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  -
                  -
                  -  // ---[ Debugging ]--------------------------------------------------
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).() => String
                  -   */
                  -  toString() {
                  -    const listeners = this._listeners.length;
                  -    const state     = this._state;
                  -
                  -    return `folktale:Future(${state}, ${listeners} listeners)`;
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   (Future 'f 's).() => String
                  -   */
                  -  inspect() {
                  -    return this.toString();
                  -  }
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future._listeners.html b/docs/api/en/folktale.data.future._future._listeners.html deleted file mode 100644 index e69aae4..0000000 --- a/docs/api/en/folktale.data.future._future._listeners.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - _listeners - - - - - -

                  _listeners

                  A list of visitors to be invoked when the state of the future changes.

                  -

                  Signature

                  get()
                  get (Future 'f 's) => Array (DeferredListener 'f 's)

                  Documentation

                  A list of visitors to be invoked when the state of the future changes.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  get _listeners() {
                  -    throw new TypeError('Future.prototype._listeners should be implemented in an inherited object.');
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future._state.html b/docs/api/en/folktale.data.future._future._state.html deleted file mode 100644 index 803027a..0000000 --- a/docs/api/en/folktale.data.future._future._state.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - _state - - - - - -

                  _state

                  The current state of the Future.

                  -

                  Signature

                  get()
                  get (Future 'f 's) => ExecutionState 'f 's

                  Documentation

                  The current state of the Future.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  get _state() {
                  -    throw new TypeError('Future.prototype._state should be implemented in an inherited object.');
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.apply.html b/docs/api/en/folktale.data.future._future.apply.html deleted file mode 100644 index 5bc5570..0000000 --- a/docs/api/en/folktale.data.future._future.apply.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - apply - - - - - -

                  apply

                  Transforms the succesful value of a future by using a function stored in another future.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(future)
                  (Future 'f 's).(Future 'f (('s) => 's2)) => Future 'f 's2

                  Documentation

                  Transforms the succesful value of a future by using a function stored in another future.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/future');
                  -
                  -const inc = (x) => x + 1;
                  -
                  -of(inc).apply(of(1)).listen({
                  -  onResolved: (value) => $ASSERT(value == 2)
                  -});
                  -
                  -rejected(inc).apply(of(1)).listen({
                  -  onRejected: (reason) => $ASSERT(reason === inc)
                  -});
                  -
                  -of(inc).apply(rejected(1)).listen({
                  -  onRejected: (reason) => $ASSERT(reason == 1)
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  apply(future) {
                  -    return this.chain(fn => future.map(fn));
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.bimap.html b/docs/api/en/folktale.data.future._future.bimap.html deleted file mode 100644 index c4df66c..0000000 --- a/docs/api/en/folktale.data.future._future.bimap.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - bimap - - - - - -

                  bimap

                  Transforms both successful and failure values in a Future, without touching its state.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(rejectionTransformation, successTransformation)
                  (Future 'f 's).(('f) => 'f2, ('s) => 's2) => Future 'f2 's2

                  Documentation

                  Transforms both successful and failure values in a Future, without touching its state.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/future');
                  -
                  -const inc = (x) => x + 1;
                  -const dec = (x) => x - 1;
                  -
                  -of(1).bimap(inc, dec).listen({
                  -  onResolved: (x) => $ASSERT(x == 0)
                  -});
                  -
                  -rejected(1).bimap(inc, dec).listen({
                  -  onRejected: (x) => $ASSERT(x == 2)
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  bimap(rejectionTransformation, successTransformation) {
                  -    let deferred = new Deferred();      // eslint-disable-line prefer-const
                  -    this.listen({
                  -      onCancelled: ()     => deferred.cancel(),
                  -      onRejected:  reason => deferred.reject(rejectionTransformation(reason)),
                  -      onResolved:  value  => deferred.resolve(successTransformation(value))
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.chain.html b/docs/api/en/folktale.data.future._future.chain.html deleted file mode 100644 index e356f78..0000000 --- a/docs/api/en/folktale.data.future._future.chain.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - chain - - - - - -

                  chain

                  Transforms a Future's successful value along with its state.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(transformation)
                  (Future 'f 's).(('s) => Future 's2) => Future 'f 's2

                  Documentation

                  Transforms a Future's successful value along with its state.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/future');
                  -
                  -of(1).chain(x => of(x + 1)).listen({
                  -  onResolved: (value) => $ASSERT(value == 2)
                  -});
                  -
                  -of(1).chain(x => rejected(x)).listen({
                  -  onRejected: (reason) => $ASSERT(reason == 1)
                  -});
                  -
                  -rejected(1).chain(x => of(x + 1)).listen({
                  -  onRejected: (reason) => $ASSERT(reason == 1)
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  chain(transformation) {
                  -    let deferred = new Deferred();    // eslint-disable-line prefer-const
                  -    this.listen({
                  -      onCancelled: ()     => deferred.cancel(),
                  -      onRejected:  reason => deferred.reject(reason),
                  -      onResolved:  value  => {
                  -        transformation(value).listen({
                  -          onCancelled: ()     => deferred.cancel(),
                  -          onRejected:  reason => deferred.reject(reason),
                  -          onResolved:  value2 => deferred.resolve(value2)
                  -        });
                  -      }
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.inspect.html b/docs/api/en/folktale.data.future._future.inspect.html deleted file mode 100644 index 1063f60..0000000 --- a/docs/api/en/folktale.data.future._future.inspect.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - inspect - - - - - -

                  inspect

                  Returns a textual representation of the Future.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value()
                  (Future 'f 's).() => String

                  Documentation

                  Returns a textual representation of the Future.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  inspect() {
                  -    return this.toString();
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.listen.html b/docs/api/en/folktale.data.future._future.listen.html deleted file mode 100644 index 88fcc9c..0000000 --- a/docs/api/en/folktale.data.future._future.listen.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - listen - - - - - -

                  listen

                  Adds a visitor to the Future, which will be invoked when the Future's state changes.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(pattern)
                  (Future 'f 's).(DeferredListener 'f 's) => Future 'f 's

                  Documentation

                  Adds a visitor to the Future, which will be invoked when the Future's state changes.

                  -

                  Listen allows reacting to changes in a Future, but is very imperative. In general, it's better to use willMatchWith or a more specialised method (like .chain or .orElse) instead.

                  -

                  Example:

                  -
                  const { of } = require('folktale/data/future');
                  -
                  -of('hello').listen({
                  -  onCancelled: ()       => { throw 'never happens' },
                  -  onRejected:  (reason) => { throw 'never happens' },
                  -  onResolved:  (value)  => { $ASSERT(value == 'hello') }
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  listen(pattern) {
                  -    this._state.matchWith({
                  -      Pending:   ()           => this._listeners.push(pattern),
                  -      Cancelled: ()           => pattern.onCancelled(), 
                  -      Resolved:  ({ value })  => pattern.onResolved(value),
                  -      Rejected:  ({ reason }) => pattern.onRejected(reason)
                  -    });
                  -    return this;
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.map.html b/docs/api/en/folktale.data.future._future.map.html deleted file mode 100644 index b8aafd1..0000000 --- a/docs/api/en/folktale.data.future._future.map.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - map - - - - - -

                  map

                  Transforms the successful value of a Future, without touching its state.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(transformation)
                  (Future 'f 's).(('s) => 's2) => Future 'f 's2

                  Documentation

                  Transforms the successful value of a Future, without touching its state.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/future');
                  -
                  -of(1).map(x => x + 1).listen({
                  -  onResolved: (value) => $ASSERT(value == 2)
                  -});
                  -
                  -rejected(1).map(x => x + 1).listen({
                  -  onRejected: (value) => $ASSERT(value == 1)
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  map(transformation) {
                  -    return this.chain(value => Future.of(transformation(value)));
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.maprejected.html b/docs/api/en/folktale.data.future._future.maprejected.html deleted file mode 100644 index 15a3912..0000000 --- a/docs/api/en/folktale.data.future._future.maprejected.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - mapRejected - - - - - -

                  mapRejected

                  Transforms failure values in a Future without touching its state.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(transformation)
                  (Future 'f 's).(('f) => 'f2) => Future 'f2 's

                  Documentation

                  Transforms failure values in a Future without touching its state.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/future');
                  -
                  -
                  -of(1).mapRejected(x => x + 1).listen({
                  -  onResolved: (x) => $ASSERT(x == 1)
                  -});
                  -
                  -rejected(1).mapRejected(x => x + 1).listen({
                  -  onRejected: (x) => $ASSERT(x == 2)
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  mapRejected(transformation) {
                  -    return this.bimap(transformation, x => x);
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.of.html b/docs/api/en/folktale.data.future._future.of.html deleted file mode 100644 index 91b7559..0000000 --- a/docs/api/en/folktale.data.future._future.of.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - of - - - - - -

                  of

                  Constructs a Future holding a successful value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  of(value)
                  forall a, b:
                  -  (Future).(b) => Future a b

                  Documentation

                  Constructs a Future holding a successful value.

                  -

                  Example:

                  -
                  const { of } = require('folktale/data/future');
                  -
                  -of(1).map(x => {
                  -  $ASSERT(x == 1);
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 228, column 22
                  of(value) {
                  -    let result = new Future();    // eslint-disable-line prefer-const
                  -    result._state = Resolved(value);
                  -    return result;
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.recover.html b/docs/api/en/folktale.data.future._future.recover.html deleted file mode 100644 index 732852f..0000000 --- a/docs/api/en/folktale.data.future._future.recover.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - recover - - - - - -

                  recover

                  Transforms a failed future into a new future.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(handler)
                  (Future 'f 's).(('f) => Future 'f2 's2) => Future 'f2 's

                  Documentation

                  Transforms a failed future into a new future.

                  -

                  Example:

                  -
                  const { rejected, of } = require('folktale/data/future');
                  -
                  -of(1).recover(x => of(x + 1)).listen({
                  -  onResolved: (value) => $ASSERT(value == 1)
                  -});
                  -
                  -rejected(1).recover(x => of(x + 1)).listen({
                  -  onResolved: (value) => $ASSERT(value == 2)
                  -});
                  -
                  -rejected(1).recover(x => rejected(x + 1)).listen({
                  -  onRejected: (value) => $ASSERT(value == 2)
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  recover(handler) {
                  -    let deferred = new Deferred();      // eslint-disable-line prefer-const
                  -    this.listen({
                  -      onCancelled: ()     => deferred.cancel(),
                  -      onResolved:  value  => deferred.resolve(value),
                  -      onRejected:  reason => {
                  -        handler(reason).listen({
                  -          onCancelled: ()        => deferred.cancel(),
                  -          onResolved:  value     => deferred.resolve(value),
                  -          onRejected:  newReason => deferred.reject(newReason)
                  -        });
                  -      }
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.rejected.html b/docs/api/en/folktale.data.future._future.rejected.html deleted file mode 100644 index bde247a..0000000 --- a/docs/api/en/folktale.data.future._future.rejected.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - rejected - - - - - -

                  rejected

                  Constructs a future holding a failure value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  rejected(reason)
                  forall a, b: (Future).(a) => Future a b

                  Documentation

                  Constructs a future holding a failure value.

                  -

                  Example:

                  -
                  const { rejected } = require('folktale/data/future');
                  -
                  -rejected(1).mapRejected(x => {
                  -  $ASSERT(x == 1);
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 228, column 22
                  rejected(reason) {
                  -    let result = new Future();      // eslint-disable-line prefer-const
                  -    result._state = Rejected(reason);
                  -    return result;
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.swap.html b/docs/api/en/folktale.data.future._future.swap.html deleted file mode 100644 index e4bc0ce..0000000 --- a/docs/api/en/folktale.data.future._future.swap.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - swap - - - - - -

                  swap

                  Inverts the state of a Future: successes become failures, failures become successes.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value()
                  (Future 'f 's).() => Future 's 'f

                  Documentation

                  Inverts the state of a Future: successes become failures, failures become successes.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/future');
                  -
                  -of(1).swap().listen({
                  -  onRejected: (x) => $ASSERT(x == 1)
                  -});
                  -
                  -rejected(1).swap().listen({
                  -  onResolved: (x) => $ASSERT(x == 1)
                  -});
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  swap() {
                  -    let deferred = new Deferred();    // eslint-disable-line prefer-const
                  -    this.listen({
                  -      onCancelled: ()     => deferred.cancel(),
                  -      onRejected:  reason => deferred.resolve(reason),
                  -      onResolved:  value  => deferred.reject(value) 
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.tostring.html b/docs/api/en/folktale.data.future._future.tostring.html deleted file mode 100644 index 67b92b7..0000000 --- a/docs/api/en/folktale.data.future._future.tostring.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - toString - - - - - -

                  toString

                  Returns a textual representation of the Future.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value()
                  (Future 'f 's).() => String

                  Documentation

                  Returns a textual representation of the Future.

                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  toString() {
                  -    const listeners = this._listeners.length;
                  -    const state     = this._state;
                  -
                  -    return `folktale:Future(${state}, ${listeners} listeners)`;
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future._future.willmatchwith.html b/docs/api/en/folktale.data.future._future.willmatchwith.html deleted file mode 100644 index 4111440..0000000 --- a/docs/api/en/folktale.data.future._future.willmatchwith.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - willMatchWith - - - - - -

                  willMatchWith

                  Limited pattern matching for futures.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(pattern)
                  forall a, b, c, d:
                  -  type Pattern = { r |
                  -    Cancelled: ()  => Future c d,
                  -    Resolved:  (b) => Future c d,
                  -    Rejected:  (a) => Future c d
                  -  }
                  -  
                  -  (Future a b).(Pattern) => Future c d

                  Documentation

                  Limited pattern matching for futures.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/future');
                  -
                  -of(1).willMatchWith({
                  -  Cancelled: () => of('no'),
                  -  Rejected:  (x) => of(x + 1),
                  -  Resolved:  (x) => of(x - 1)
                  -}).listen({
                  -  onResolved: (x) => $ASSERT(x == 0)
                  -});
                  -
                  -
                  -rejected(1).willMatchWith({
                  -  Cancelled: () => of('no'),
                  -  Rejected:  (x) => of(x + 1),
                  -  Resolved:  (x) => of(x - 1)
                  -}).listen({
                  -  onResolved: (x) => $ASSERT(x == 2)
                  -})
                  -

                  Properties

                  Source Code

                  Defined in src/data/future/_future.js at line 23, column 0
                  willMatchWith(pattern) {
                  -    let deferred = new Deferred();      // eslint-disable-line prefer-const
                  -    const resolve = (handler) => (value) => handler(value).listen({
                  -      onCancelled: ()         => deferred.cancel(),
                  -      onResolved:  (newValue) => deferred.resolve(newValue),
                  -      onRejected:  (reason)   => deferred.reject(reason) 
                  -    });
                  -    this.listen({
                  -      onCancelled: resolve(pattern.Cancelled),
                  -      onResolved:  resolve(pattern.Resolved),
                  -      onRejected:  resolve(pattern.Rejected)
                  -    });
                  -
                  -    return deferred.future();
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future/_future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.future.html b/docs/api/en/folktale.data.future.html deleted file mode 100644 index 1d11392..0000000 --- a/docs/api/en/folktale.data.future.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - module folktale/data/future - - - - - -

                  module folktale/data/future

                  A data structure to represent the result of an asynchronous computation.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  A data structure to represent the result of an asynchronous computation.

                  -

                  Results are not constructed directly (generally), but rather returned when asking for the eventual value of a task execution.

                  -

                  Example:

                  -
                  const { task } = require('folktale/data/task');
                  -
                  -const one = task(resolver => resolver.resolve(1));
                  -
                  -one.run().future().map(value => {
                  -  $ASSERT(value == 1);
                  -});
                  -

                  Properties

                  Constructing

                  of(value)

                  Constructs a Future holding a successful value.

                  -
                  Experimental
                  rejected(reason)

                  Constructs a future holding a failure value.

                  -
                  Experimental

                  Types

                  _Deferred: Deferred()

                  A deferred is an internal structure for creating Futures. Because deferred is an imperative structure, users should instead construct futures through the Task structure.

                  -
                  Experimental
                  _ExecutionState

                  An union defining the possible states of a Future.

                  -
                  Experimental
                  _Future()

                  Models the eventual result of asynchronous computations.

                  -
                  Experimental

                  Source Code

                  Defined in src/data/future/index.js at line 16, column 0
                  {
                  -  of: Future.of,
                  -  rejected: Future.rejected,
                  -  _Deferred: require('./_deferred'),
                  -  _ExecutionState: require('./_execution-state'),
                  -  _Future: Future
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/future
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.html b/docs/api/en/folktale.data.html deleted file mode 100644 index 23d30a7..0000000 --- a/docs/api/en/folktale.data.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - module folktale/data - - - - - -

                  module folktale/data

                  Implements common functional data structures in JavaScript.

                  -

                  Documentation

                  Implements common functional data structures in JavaScript.

                  -

                  Properties

                  Concurrency

                  future

                  A data structure to represent the result of an asynchronous computation.

                  -
                  Experimental
                  task

                  A data structure that models asynchronous actions, supporting safe cancellation and automatic resource handling.

                  -
                  Experimental

                  Converting data

                  conversions

                  Provides functions to convert from and to different data -structures.

                  -

                  Handling failures

                  maybe

                  A data structure that models the presence or absence of a value.

                  -
                  result

                  A data structure that models the result of operations that may fail. A Result -helps with representing errors and propagating them, giving users a more -controllable form of sequencing operations than that offered by constructs like -try/catch.

                  -
                  validation

                  A data structure that typically models form validations, and other scenarios where -you want to aggregate all failures, rather than short-circuit if an error -happens (for which Result is better suited).

                  -

                  Source Code

                  Defined in src/data/index.js at line 15, column 0
                  {
                  -  conversions: require('./conversions'),
                  -  maybe: require('./maybe'),
                  -  result: require('./result'),
                  -  validation: require('./validation'),
                  -  future: require('./future'),
                  -  task: require('./task')
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.fromnullable.html b/docs/api/en/folktale.data.maybe.fromnullable.html deleted file mode 100644 index 90c9ee5..0000000 --- a/docs/api/en/folktale.data.maybe.fromnullable.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - fromNullable - - - - - -

                  fromNullable

                  A convenience method for the folktale/data/conversions/nullable-to-maybe module.

                  -

                  Signature

                  fromNullable(aNullable)
                  forall a: (a or void) => Maybe a

                  Documentation

                  A convenience method for the folktale/data/conversions/nullable-to-maybe module.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -Maybe.fromNullable(1);
                  -// ==> Maybe.Just(1)
                  -
                  -Maybe.fromNullable(null);
                  -// ==> Maybe.Nothing()
                  -
                  -Maybe.fromNullable(undefined);
                  -// ==> Maybe.Nothing()
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/index.js at line 23, column 17
                  fromNullable(aNullable) {
                  -    return require('folktale/data/conversions/nullable-to-maybe')(aNullable);
                  -  }
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.fromresult.html b/docs/api/en/folktale.data.maybe.fromresult.html deleted file mode 100644 index 1be151e..0000000 --- a/docs/api/en/folktale.data.maybe.fromresult.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - fromResult - - - - - -

                  fromResult

                  A convenience method for the folktale/data/conversions/result-to-maybe module.

                  -

                  Signature

                  fromResult(aResult)
                  forall a, b: (Result a b) => Maybe b

                  Documentation

                  A convenience method for the folktale/data/conversions/result-to-maybe module.

                  -

                  Note that Error values are discarded, since Nothing can't hold a value.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -const Result = require('folktale/data/result');
                  -
                  -Maybe.fromResult(Result.Ok(1));
                  -// ==> Maybe.Just(1)
                  -
                  -Maybe.fromResult(Result.Error(1));
                  -// ==> Maybe.Nothing()
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/index.js at line 23, column 17
                  fromResult(aResult) {
                  -    return require('folktale/data/conversions/result-to-maybe')(aResult);
                  -  }
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.fromvalidation.html b/docs/api/en/folktale.data.maybe.fromvalidation.html deleted file mode 100644 index 27c05d7..0000000 --- a/docs/api/en/folktale.data.maybe.fromvalidation.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - fromValidation - - - - - -

                  fromValidation

                  A convenience method for the folktale/data/conversions/validation-to-maybe module.

                  -

                  Signature

                  fromValidation(aValidation)
                  forall a, b: (Validation a b) => Maybe b

                  Documentation

                  A convenience method for the folktale/data/conversions/validation-to-maybe module.

                  -

                  Note that Failure values are discarded, since Nothing can't hold a value.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -const Validation = require('folktale/data/validation');
                  -
                  -Maybe.fromValidation(Validation.Success(1));
                  -// ==> Maybe.Just(1)
                  -
                  -Maybe.fromValidation(Validation.Failure(1));
                  -// ==> Maybe.Nothing()
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/index.js at line 23, column 17
                  fromValidation(aValidation) {
                  -    return require('folktale/data/conversions/validation-to-maybe')(aValidation);
                  -  }
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.html b/docs/api/en/folktale.data.maybe.html deleted file mode 100644 index 135d93f..0000000 --- a/docs/api/en/folktale.data.maybe.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - module folktale/data/maybe - - - - - -

                  module folktale/data/maybe

                  A data structure that models the presence or absence of a value.

                  -

                  Documentation

                  A data structure that models the presence or absence of a value.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -const find = (list, predicate) => {
                  -  for (var i = 0; i < list.length; ++i) {
                  -    const item = list[i];
                  -    if (predicate(item)) {
                  -      return Maybe.Just(item);
                  -    }
                  -  }
                  -  return Maybe.Nothing();
                  -};
                  -
                  -find([1, 2, 3], (x) => x > 2); // ==> Maybe.Just(3)
                  -find([1, 2, 3], (x) => x > 3); // ==> Maybe.Nothing()
                  -

                  Why use Maybe?

                  -

                  Some functions can always return a sensible result for all arguments that -they're given. For example, the successor function on natural numbers can -always give back a valid result, regardless of which natural number we give it. -These functions are easier to understand because their results are more -predictable, and we don't have to worry about errors.

                  -

                  Not all functions have this property (of being total), though. Functions like -“find an item in this list” or “look up this key in that hashtable” don't always -have an answer, and so one has to think about how they deal with the cases where -the answer is not there. We have to be able to provide some kind of answer -to the programmer, otherwise the program can't continue — that is, not -providing an answer is the equivalent of throwing an exception.

                  -

                  In most languages, things like “find an item in this list” will return null -(or the equivalent “not an object”) when the item can't be found, but what if -you had a null in th list? In others, you can only ask the question “find me -the index of this item in that list”, and when one index can't be found it -answers -1, assuming a 0-based indexed structure. But, again, what if I have -an indexed structure where -1 is a valid index?

                  -

                  Really these questions require two answers: “is the item there?”, and if so, -“what is the item?”, and we often need to test for those answers separately. -Maybe is a data structure that helps answering these questions. A Maybe -structure has two cases:

                  -
                    -
                  • Just(value) — represents the presence of an answer, and what the answer -is.
                  • -
                  • Nothing() — represents the absence of an answer.
                  • -
                  -

                  If we have maybe, we can change our code from:

                  -
                  const find1 = (list, predicate) => {
                  -  for (var i = 0; i < list.length; ++i) {
                  -    const item = list[i];
                  -    if (predicate(item)) {
                  -      return item;
                  -    }
                  -  }
                  -  return null;
                  -};
                  -
                  -find1([1, 2, 3], (x) => x > 2); // ==> 3
                  -find1([1, 2, 3], (x) => x > 3); // ==> null
                  -

                  To:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -const find2 = (list, predicate) => {
                  -  for (var i = 0; i < list.length; ++i) {
                  -    const item = list[i];
                  -    if (predicate(item)) {
                  -      return Maybe.Just(item);
                  -    }
                  -  }
                  -  return Maybe.Nothing();
                  -};
                  -
                  -find2([1, 2, 3], (x) => x > 2); // ==> Maybe.Just(3)
                  -find2([1, 2, 3], (x) => x > 3); // ==> Maybe.Nothing()
                  -

                  This has the advantage that it's always possible to determine whether a function -failed or not. For example, if we run find1([null], x => true), then it'll -return null, but if we run find1([null], x => false) it'll also return -null! On the other hand, running find2([null], x => true) returns -Maybe.Just(null), and find2([null], x => false) returns Maybe.Nothing(). -They're different values that can be tested.

                  -

                  Another advantage of using a maybe value for these situations is that, since the -return value is wrapped, the user of that function is forced to acknowledge the -possibility of an error, as the value can't be used directly.

                  -

                  Working with Maybe values

                  -

                  Last section shows how to create Maybe values, but how do we use them? A value -wrapped in a Maybe can't be used directly, so using these values is a bit more -of work. Folktale's Maybe structure provides methods to help with this, and they -can be divided roughly into 3 categories:

                  -
                    -
                  • Extracting values: Sometimes we need to pass the value into things that -don't really know what a Maybe is, so we have to somehow extract the value -out of the structure. These methods help with that.

                    -
                  • -
                  • Transforming values: Sometimes we get a Maybe value that doesn't quite -have the value we're looking for. We don't really want to change the status -of the computation (failures should continue to be failures, successes -should continue to be successes), but we'd like to tweak the resulting -value a bit. This is the equivalent of applying functions in an expression.

                    -
                  • -
                  • Sequencing computations: A Maybe is the result of a computation that can -fail. Sometimes we want to run several computations that may fail in -sequence, and these methods help with that. This is roughly the equivalent -of ; in imperative programming, where the next instruction is only -executed if the previous instruction succeeds.

                    -
                  • -
                  -

                  We'll see each of these categories in more details below.

                  -

                  Extracting values

                  -

                  If we're wrapping a value in a Maybe, then we can use the value by extracting it -from that container. Folktale lets you do this through the getOrElse(default) -method:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -function get(object, key) {
                  -  return key in object ?  Maybe.Just(object[key])
                  -  :      /* otherwise */  Maybe.Nothing();
                  -}
                  -
                  -const config = {
                  -  host: '0.0.0.0'
                  -};
                  -
                  -const host = get(config, 'host').getOrElse('localhost');
                  -const port = get(config, 'port').getOrElse(8080);
                  -
                  -`${host}:${port}`; // ==> '0.0.0.0:8080'
                  -

                  This works well if the only error handling we need to do is providing a default -value, which is a fairly common scenario when working with Maybe values. For -more advanced error handling Folktale provides more powerful methods that are -described later in this document.

                  -

                  Transforming values

                  -

                  Sometimes we want to keep the context of the computation (whether it has failed -or succeeded), but we want to tweak the value a little bit. For example, suppose -you're trying to render the first item of a list, which involves generating some -UI elements with the data from that object, but the list can be empty so you -have to handle that error first. We can't use getOrElse() here because if we -have an error, we don't want to render that error in the same way. Instead, we -can use map(transformation) to apply our rendering logic only to successful -values:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -function first(list) {
                  -  return list.length > 0 ?  Maybe.Just(list[0])
                  -  :      /* otherwise */    Maybe.Nothing();
                  -}
                  -
                  -function render(item) {
                  -  return ['item', ['title', item.title]];
                  -}
                  -
                  -first([{ title: 'Hello' }]).map(render);
                  -// ==> Maybe.Just(['item', ['title', 'Hello']])
                  -
                  -first([]).map(render);
                  -// ==> Maybe.Nothing()
                  -

                  Sequencing computations

                  -

                  Sometimes the functions we want to use to transform the value can also fail. We -can't just use .map() here since that'd put the resulting Maybe inside of -another Maybe value:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -function first(list) {
                  -  return list.length > 0 ?  Maybe.Just(list[0])
                  -  :      /* otherwise */    Maybe.Nothing();
                  -}
                  -
                  -function second(list) {
                  -  return list.length > 1 ?  Maybe.Just(list[1])
                  -  :      /* otherwise */    Maybe.Nothing();
                  -}
                  -
                  -function render(item) {
                  -  return ['item', ['title', item.title]];
                  -}
                  -
                  -first([{ title: 'Hello' }]).map(render);
                  -// ==> Maybe.Just(['item', ['title', 'Hello']])
                  -
                  -first([{ title: 'Hello' }]).map(render)
                  -                           .map(second);
                  -// ==> Maybe.Just(Maybe.Just(['title', 'Hello']))
                  -

                  Ideally we'd like to get back Maybe.Just(['title', 'Hello']), but .map() -isn't the method for that. Instead, we can use the .chain() method. .chain() -is a method that operates on Maybe values, and expects a function that also -returns a Maybe value. This return value is then considered the whole result of -the operation. Like .map(), .chain() only applies its function argument to -Just cases:

                  -
                  first([{ title: 'Hello' }]).map(render)
                  -                           .chain(second);
                  -// ==> Maybe.Just(['title', 'Hello'])
                  -
                  -first([]).map(render).chain(second);
                  -// ==> Maybe.Nothing()
                  -

                  Error handling

                  -

                  So far we've seen how to use values that are wrapped in a Maybe, but if the -purpose of this structure is to represent something that might have failed, how -do we handle those failures?

                  -

                  Well, a simple form of error handling is the .getOrElse(default) method, -covered in the previous sections, which allows us to extract a value from the -Maybe structure, if it exists, or get a default value otherwise.

                  -

                  This doesn't help much if we need to do something in response to a failure, -though. So, instead, we have the .orElse(handler) method, which behaves quite -similarly to the .chain() method covered previously, except it executes its -handler on Nothings, rather than on Justs. We can use this to recover from -errors:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -function first(list) {
                  -  return list.length > 0 ?  Maybe.Just(list[0])
                  -  :      /* otherwise */    Maybe.Nothing();
                  -}
                  -
                  -let nextId = 1;
                  -
                  -function issueError() {
                  -  return Maybe.Just(`Error #${nextId++}`);
                  -}
                  -
                  -first([1]).orElse(issueError);
                  -// ==> Maybe.Just(1)
                  -
                  -first([]).orElse(issueError);
                  -// ==> Maybe.Just('Error #1') 
                  -

                  Note that the major difference between this and .getOrElse() is that the -handler function only gets ran on failure, whereas the expression in -.getOrElse() is always executed:

                  -
                  nextId; // ==> 2
                  -
                  -first([1]).getOrElse(issueError());
                  -// ==> 1
                  -
                  -nextId; // ==> 3
                  -

                  Pattern matching

                  -

                  As with other union structures in Folktale, Maybe provides a .matchWith() -method to perform a limited form of pattern matching. Pattern matching allows -one to specify a piece of code for each case in a structure, like an if/else -or switch, but specific to that structure.

                  -

                  We could use .matchWith() to run different computations depending on whether a -Maybe value represents a success or a failure, for example, without the -requirement of having to return a Maybe:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -function first(list) {
                  -  return list.length > 0 ?  Maybe.Just(list[0])
                  -  :      /* otherwise */    Maybe.Nothing();
                  -}
                  -
                  -first([1]).matchWith({
                  -  Just: ({ value }) => `Found: ${value}`,
                  -  Nothing: () => 'Nothing was found'
                  -});
                  -// ==> 'Found: 1'
                  -
                  -first([]).matchWith({
                  -  Just: ({ value }) => `Found: ${value}`,
                  -  Nothing: () => 'Nothing was found'
                  -});
                  -// ==> 'Nothing was found'
                  -

                  Properties

                  Comparing and testing

                  hasInstance(value)

                  Tests if an arbitrary value is a Maybe instance.

                  -

                  Constructing

                  of(value)

                  Constructs a Maybe value that represents a successful value (a Just).

                  -

                  Converting from other types

                  fromNullable(aNullable)

                  A convenience method for the folktale/data/conversions/nullable-to-maybe module.

                  -
                  fromResult(aResult)

                  A convenience method for the folktale/data/conversions/result-to-maybe module.

                  -
                  fromValidation(aValidation)

                  A convenience method for the folktale/data/conversions/validation-to-maybe module.

                  -

                  Fantasy Land

                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aMaybe.toJSON() into a proper Maybe structure.

                  -
                  Experimental

                  Variants

                  Just(value)

                  Constructs a Maybe value that represents a successful value (a Just).

                  -
                  Nothing()

                  Constructs a Maybe value that represents a failure (a Nothing).

                  -

                  Source Code

                  Defined in src/data/maybe/index.js at line 23, column 0
                  {
                  -  Just: Maybe.Just,
                  -  Nothing: Maybe.Nothing,
                  -  hasInstance: Maybe.hasInstance,
                  -  of: Maybe.of,
                  -  fromJSON: Maybe.fromJSON,
                  -  [typeSymbol]: Maybe[typeSymbol],
                  -  ['fantasy-land/of']: Maybe['fantasy-land/of'],
                  -
                  -  /*~
                  -   * stability: stable
                  -   * type: |
                  -   *   forall a: (a or void) => Maybe a
                  -   */
                  -  fromNullable(aNullable) {
                  -    return require('folktale/data/conversions/nullable-to-maybe')(aNullable);
                  -  },
                  -
                  -  /*~
                  -   * stability: stable
                  -   * type: |
                  -   *   forall a, b: (Result a b) => Maybe b
                  -   */
                  -  fromResult(aResult) {
                  -    return require('folktale/data/conversions/result-to-maybe')(aResult);
                  -  },
                  -
                  -  /*~
                  -   * stability: stable
                  -   * type: |
                  -   *   forall a, b: (Validation a b) => Maybe b
                  -   */
                  -  fromValidation(aValidation) {
                  -    return require('folktale/data/conversions/validation-to-maybe')(aValidation);
                  -  }
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.0.html b/docs/api/en/folktale.data.maybe.maybe.0.html deleted file mode 100644 index 06ee5af..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.0.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - Nothing - - - - - -

                  Nothing

                  Constructs a Maybe value that represents a failure (a Nothing).

                  -

                  Signature

                  Nothing()
                  forall a: () => Maybe a

                  Documentation

                  Constructs a Maybe value that represents a failure (a Nothing).

                  -

                  See the documentation for the Maybe structure to understand how to use this.

                  -

                  Static properties

                  Comparing and testing

                  hasInstance(value)

                  Tests if an arbitrary value is a Nothing case of a Maybe instance.

                  -

                  Debugging

                  inspect: toString()

                  A textual representation of the Nothing variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the Nothing variant.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor function for this variant.

                  -
                  prototype

                  The container for instance methods for Nothing variants of the Maybe structure.

                  -
                  get tag

                  The tag for this variant, unique among the Maybe variants.

                  -
                  get type

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -

                  Instance (prototype) properties

                  Comparing and testing

                  equals(value)

                  Performs a deep-comparison of two Maybe values for equality. See core/adt/derivations/equality for details.

                  -
                  Experimental
                  hasInstance(value)

                  Tests if an arbitrary value is a Maybe instance.

                  -
                  Inherited
                  get isNothing

                  True if the value is a Nothing instance.

                  -
                  Deprecated

                  Constructing

                  of(value)

                  Constructs a Maybe value that represents a successful value (a Just).

                  -
                  Inherited

                  Converting to other types

                  toResult(fallbackValue)

                  A convenience method for the folktale/data/conversions/maybe-to-result module.

                  -
                  ExperimentalInherited
                  toValidation(fallbackValue)

                  A convenience method for the folktale/data/conversions/maybe-to-validation module.

                  -
                  ExperimentalInherited

                  Debugging

                  inspect: toString()

                  A textual representation for Maybe instances.

                  -
                  Experimental
                  toString()

                  A textual representation for Maybe instances.

                  -
                  Experimental

                  Extracting values

                  get()

                  This method has been renamed to unsafeGet().

                  -
                  DeprecatedInherited
                  getOrElse()

                  Extracts the value of a Maybe structure, if it exists (i.e.: is a Just), -otherwise returns the provided default value.

                  -
                  unsafeGet()

                  Extracts the value from a Just structure.

                  -

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/chain(transformation)

                  Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

                  -
                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -
                  fantasy-land/map(transformation)

                  Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

                  -
                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Pattern matching

                  cata()

                  This method has been replaced by matchWith(pattern). cata(morphism) selects -and executes a function for each variant of the Maybe structure.

                  -
                  Deprecated
                  fold()

                  Applies a function to each variant of the Maybe structure.

                  -
                  matchWith(pattern)

                  Chooses and executes a function for each variant in the Maybe structure.

                  -

                  Recovering from errors

                  orElse()

                  Allows recovering from from failed Maybe values.

                  -

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aMaybe.toJSON() into a proper Maybe structure.

                  -
                  ExperimentalInherited
                  toJSON()

                  Converts a Maybe value to a JavaScript object that may be stored as a JSON value.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor function for this variant.

                  -
                  variants

                  The variants in the Maybe structure.

                  -
                  Inherited

                  Transforming

                  apply()

                  Transforms a Maybe value using a function contained in another Maybe. As with -.map(), the Maybe values are expected to be Just, and no operation is -performed if any of them is a Nothing.

                  -
                  chain()

                  Transforms an entire Maybe structure with the provided function. As with -.map(), the transformation is only applied if the value is a Just, but -unlike .map() the transformation is expected to return a new Maybe value.

                  -
                  map()

                  Documentation for both entities goes here~

                  -

                  Variants

                  Just(value)

                  Constructs a Maybe value that represents a successful value (a Just).

                  -
                  Inherited
                  Nothing()

                  Constructs a Maybe value that represents a failure (a Nothing).

                  -
                  Inherited

                  Source Code

                  Nothing() {
                  -  }
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.apply.html b/docs/api/en/folktale.data.maybe.maybe.apply.html deleted file mode 100644 index de40fb0..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.apply.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - apply - - - - - -

                  apply

                  Transforms a Maybe value using a function contained in another Maybe. As with -.map(), the Maybe values are expected to be Just, and no operation is -performed if any of them is a Nothing.

                  -

                  Signature

                  forall a, b: (Maybe (a) => b).(Maybe a) => Maybe b

                  Documentation

                  Transforms a Maybe value using a function contained in another Maybe. As with -.map(), the Maybe values are expected to be Just, and no operation is -performed if any of them is a Nothing.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -function increment(value) {
                  -  return value + 1;
                  -}
                  -
                  -Maybe.Just(increment).apply(Maybe.Just(1));
                  -// ==> Maybe.Just(2)
                  -
                  -Maybe.Just(increment).apply(Maybe.Nothing());
                  -// ==> Maybe.Nothing()
                  -
                  -Maybe.Nothing().apply(Maybe.Just(1));
                  -// ==> Maybe.Nothing()
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 57, column 18
                  {
                  -    /*~*/
                  -    Nothing: function apply(aMaybe) {
                  -      assertMaybe('Maybe.Nothing#apply', aMaybe);
                  -      return this;
                  -    },
                  -
                  -    /*~*/
                  -    Just: function apply(aMaybe) {
                  -      assertMaybe('Maybe.Just#apply', aMaybe);
                  -      return aMaybe.map(this.value);
                  -    }
                  -  }
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.cata.html b/docs/api/en/folktale.data.maybe.maybe.cata.html deleted file mode 100644 index db5c598..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.cata.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - cata - - - - - -

                  cata

                  This method has been replaced by matchWith(pattern). cata(morphism) selects -and executes a function for each variant of the Maybe structure.

                  -
                  Deprecated since 2.0.0

                  The cata(morphism) terminology is not very welcoming for people -who are not familiar with some obscure jargon in functional programming. -In addition to that, due to the design of Folktale's 2 ADT constructor, -it's not possible to provide the same interface as Folktale 1's .cata() -method, so changing the name while deprecating the old functionality -allows people to move to Folktale 2 without breaking their code.

                  -

                  Signature

                  forall a, b:
                  -  (Maybe a).({
                  -    Nothing: () => b,
                  -    Just: (a) => b
                  -  }) => b

                  Documentation

                  This method has been replaced by matchWith(pattern). cata(morphism) selects -and executes a function for each variant of the Maybe structure.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -Maybe.Just(1).cata({
                  -  Nothing: ()   => 'nothing',
                  -  Just: (value) => `got ${value}`
                  -});
                  -// ==> 'got 1'
                  -
                  -Maybe.Nothing().cata({
                  -  Nothing: ()   => 'nothing',
                  -  Just: (value) => `got ${value}`
                  -});
                  -// ==> 'nothing'
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 57, column 18
                  {
                  -    /*~*/
                  -    Nothing: function cata(pattern) {
                  -      warnDeprecation('`.cata(pattern)` is deprecated. Use `.matchWith(pattern)` instead.');
                  -      return pattern.Nothing();
                  -    },
                  -
                  -    /*~*/
                  -    Just: function cata(pattern) {
                  -      warnDeprecation('`.cata(pattern)` is deprecated. Use `.matchWith(pattern)` instead.');
                  -      return pattern.Just(this.value);
                  -    }
                  -  }
                  Stability
                  deprecated
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.chain.html b/docs/api/en/folktale.data.maybe.maybe.chain.html deleted file mode 100644 index c0408ea..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.chain.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - chain - - - - - -

                  chain

                  Transforms an entire Maybe structure with the provided function. As with -.map(), the transformation is only applied if the value is a Just, but -unlike .map() the transformation is expected to return a new Maybe value.

                  -

                  Signature

                  forall a, b: (Maybe a).((a) => Maybe b) => Maybe b

                  Documentation

                  Transforms an entire Maybe structure with the provided function. As with -.map(), the transformation is only applied if the value is a Just, but -unlike .map() the transformation is expected to return a new Maybe value.

                  -

                  Having the transformation function return a new Maybe value means that the -transformation may fail, and the failure is appropriately propagated. In this -sense, a.chain(f) works similarly to the sequencing of statements done by the -; syntax in JavaScript — the next instruction only runs if the previous -instruction succeeds, and either instructions may fail.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -function first(list) {
                  -  return list.length > 0 ?  Maybe.Just(list[0])
                  -  :      /* otherwise */    Maybe.Nothing();
                  -}
                  -
                  -first([]).chain(first);
                  -// ==> Maybe.Nothing()
                  -
                  -first([[1]]).chain(first);
                  -// ==> Maybe.Just(1)
                  -
                  -first([[]]).chain(first);
                  -// ==> Maybe.Nothing()
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 57, column 18
                  {
                  -    /*~*/
                  -    Nothing: function chain(transformation) {
                  -      assertFunction('Maybe.Nothing#chain', transformation);
                  -      return this;
                  -    },
                  -
                  -    /*~*/
                  -    Just: function chain(transformation) {
                  -      assertFunction('Maybe.Just#chain', transformation);
                  -      return transformation(this.value);
                  -    }
                  -  }
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.fold.html b/docs/api/en/folktale.data.maybe.maybe.fold.html deleted file mode 100644 index 3f8d51f..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.fold.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - fold - - - - - -

                  fold

                  Applies a function to each variant of the Maybe structure.

                  -

                  Signature

                  forall a, b: (Maybe a).(() => b, (a) => b) => b

                  Documentation

                  Applies a function to each variant of the Maybe structure.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -Maybe.Just(1).fold(
                  -  (()  => 'nothing'),
                  -  ((v) => `got ${v}`)
                  -);
                  -// ==> 'got 1'
                  -
                  -Maybe.Nothing().fold(
                  -  (()  => 'nothing'),
                  -  ((v) => `got ${v}`)
                  -);
                  -// ==> 'nothing'
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 57, column 18
                  {
                  -    /*~*/
                  -    Nothing: function(transformNothing, transformJust) {
                  -      assertFunction('Maybe.Nothing#fold', transformNothing);
                  -      assertFunction('Maybe.Nothing#fold', transformJust);
                  -      return transformNothing();
                  -    },
                  -
                  -    /*~*/
                  -    Just: function(transformNothing, transformJust) {
                  -      assertFunction('Maybe.Just#fold', transformNothing);
                  -      assertFunction('Maybe.Just#fold', transformJust);
                  -      return transformJust(this.value);
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.get.html b/docs/api/en/folktale.data.maybe.maybe.get.html deleted file mode 100644 index 86032fd..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.get.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - get - - - - - -

                  get

                  This method has been renamed to unsafeGet().

                  -
                  Deprecated since 2.0.0

                  We want to discourage the use of partial functions, and having short names -makes it easy for people to want to use them without thinking about the -problems.

                  -

                  For more details see https://github.com/origamitower/folktale/issues/42

                  -

                  Signature

                  get()
                  forall a: (Maybe a).() => a :: (throws TypeError)

                  Documentation

                  This method has been renamed to unsafeGet().

                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 224, column 21
                  'get'() {
                  -    warnDeprecation('`.get()` is deprecated, and has been renamed to `.unsafeGet()`.');
                  -    return this.unsafeGet();
                  -  }
                  Stability
                  deprecated
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.getorelse.html b/docs/api/en/folktale.data.maybe.maybe.getorelse.html deleted file mode 100644 index 7725a6b..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.getorelse.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - getOrElse - - - - - -

                  getOrElse

                  Extracts the value of a Maybe structure, if it exists (i.e.: is a Just), -otherwise returns the provided default value.

                  -

                  Signature

                  forall a: (Maybe a).(a) => a

                  Documentation

                  Extracts the value of a Maybe structure, if it exists (i.e.: is a Just), -otherwise returns the provided default value.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -Maybe.Just(1).getOrElse(2);   // ==> 1
                  -Maybe.Nothing().getOrElse(2); // ==> 2
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 57, column 18
                  {
                  -    /*~*/
                  -    Nothing: function getOrElse(_default) {
                  -      return _default;
                  -    },
                  -
                  -    /*~*/
                  -    Just: function getOrElse(_default) {
                  -      return this.value;
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.inspect.html b/docs/api/en/folktale.data.maybe.maybe.inspect.html deleted file mode 100644 index a01304d..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.inspect.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - toString - - - - - -

                  toString

                  A textual representation of the Nothing variant.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toString()
                  () => String

                  Documentation

                  A textual representation of the Nothing variant.

                  -

                  Properties

                  Source Code

                  () => variantName
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.just.html b/docs/api/en/folktale.data.maybe.maybe.just.html deleted file mode 100644 index 0000b78..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.just.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Just - - - - - -

                  Just

                  Constructs a Maybe value that represents a successful value (a Just).

                  -

                  Signature

                  Just(value)
                  forall a: (a) => Maybe a

                  Documentation

                  Constructs a Maybe value that represents a successful value (a Just).

                  -
                  -

                  NOTE:
                  The provided value is stored as-given in the structure. If you want to -convert a nullable value (a value that may be null/undefined) to a Maybe -value, use the Maybe.fromNullable(value) function instead of -Maybe.Just(value).

                  -
                  -

                  See the documentation for the Maybe structure to understand how to use this.

                  -

                  Static properties

                  Comparing and testing

                  hasInstance(value)

                  Tests if an arbitrary value is a Just case of a Maybe instance.

                  -

                  Debugging

                  inspect: toString()

                  A textual representation of the Just variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the Just variant.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor function for this variant.

                  -
                  prototype

                  The container for instance methods for Just variants of the Maybe structure.

                  -
                  get tag

                  The tag for this variant, unique among the Maybe variants.

                  -
                  get type

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -

                  Instance (prototype) properties

                  Comparing and testing

                  equals(value)

                  Performs a deep-comparison of two Maybe values for equality. See core/adt/derivations/equality for details.

                  -
                  Experimental
                  hasInstance(value)

                  Tests if an arbitrary value is a Maybe instance.

                  -
                  Inherited
                  get isJust

                  True if the value is a Just instance.

                  -
                  Deprecated

                  Constructing

                  of(value)

                  Constructs a Maybe value that represents a successful value (a Just).

                  -
                  Inherited

                  Converting to other types

                  toResult(fallbackValue)

                  A convenience method for the folktale/data/conversions/maybe-to-result module.

                  -
                  ExperimentalInherited
                  toValidation(fallbackValue)

                  A convenience method for the folktale/data/conversions/maybe-to-validation module.

                  -
                  ExperimentalInherited

                  Data fields

                  get value

                  The value contained in a Just instance of the Maybe structure.

                  -
                  Abstract

                  Debugging

                  inspect: toString()

                  A textual representation for Maybe instances.

                  -
                  Experimental
                  toString()

                  A textual representation for Maybe instances.

                  -
                  Experimental

                  Extracting values

                  get()

                  This method has been renamed to unsafeGet().

                  -
                  DeprecatedInherited
                  getOrElse()

                  Extracts the value of a Maybe structure, if it exists (i.e.: is a Just), -otherwise returns the provided default value.

                  -
                  unsafeGet()

                  Extracts the value from a Just structure.

                  -

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/chain(transformation)

                  Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

                  -
                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -
                  fantasy-land/map(transformation)

                  Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

                  -
                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Pattern matching

                  cata()

                  This method has been replaced by matchWith(pattern). cata(morphism) selects -and executes a function for each variant of the Maybe structure.

                  -
                  Deprecated
                  fold()

                  Applies a function to each variant of the Maybe structure.

                  -
                  matchWith(pattern)

                  Chooses and executes a function for each variant in the Maybe structure.

                  -

                  Recovering from errors

                  orElse()

                  Allows recovering from from failed Maybe values.

                  -

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aMaybe.toJSON() into a proper Maybe structure.

                  -
                  ExperimentalInherited
                  toJSON()

                  Converts a Maybe value to a JavaScript object that may be stored as a JSON value.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor function for this variant.

                  -
                  variants

                  The variants in the Maybe structure.

                  -
                  Inherited

                  Transforming

                  apply()

                  Transforms a Maybe value using a function contained in another Maybe. As with -.map(), the Maybe values are expected to be Just, and no operation is -performed if any of them is a Nothing.

                  -
                  chain()

                  Transforms an entire Maybe structure with the provided function. As with -.map(), the transformation is only applied if the value is a Just, but -unlike .map() the transformation is expected to return a new Maybe value.

                  -
                  map()

                  Documentation for both entities goes here~

                  -

                  Variants

                  Just(value)

                  Constructs a Maybe value that represents a successful value (a Just).

                  -
                  Inherited
                  Nothing()

                  Constructs a Maybe value that represents a failure (a Nothing).

                  -
                  Inherited

                  Source Code

                  Just(value) {
                  -    return { value };
                  -  }
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.map.html b/docs/api/en/folktale.data.maybe.maybe.map.html deleted file mode 100644 index 6c770c6..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.map.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - map - - - - - -

                  map

                  Documentation for both entities goes here~

                  -

                  Signature

                  forall a, b: (Maybe a).((a) => b) => Maybe b

                  Documentation

                  Documentation for both entities goes here~

                  -
                  
                  -[JavaScript examples use a special syntax](#writing-testable-examples) to allow them to be tested. Writing testable examples means that we can make sure that the examples in the documentation work with the latest version of the library.
                  -
                  -
                  -## Improving existing documentation
                  -
                  -In order to improve existing documentation, you need to find the file where it's defined inside `docs/source` and edit it. The documentation folder tries to follow the same layout the source folder has, and additionally each method/function gets its own documentation file, that matches the name of that method/function.
                  -
                  -A documentation file is consists generally of one or more annotation lines (`@annotate: ...`), followed by an [YAML](http://yaml.org/) document defining metadata, and then a portion of Markdown text that's the textual documentation for that entity. Examples inside should ideally [marked to be testable](#writing-testable-examples).
                  -
                  -
                  -## Writing testable examples
                  -
                  -Documentation examples should, ideally, be runnable. This way we ensure that
                  -all the examples contained in the documentation work with the code they're
                  -documenting.
                  -
                  -To mark an example as runnable, just write a regular Markdown codeblock and
                  -end the previous paragraph or heading with two colons (`::`). In the code block,
                  -you indicate the result of expressions using [arrow comments](https://github.com/origamitower/metamagical/tree/master/packages/babel-plugin-assertion-comments),
                  -which support structural (deep) equality.
                  -
                  -That is, you could use:
                  -
                  -```md
                  -This is a runnable example:
                  -
                  -    1 + 1;
                  -    // ==> 2
                  -

                  Or:

                  -
                  # This is a runnable example:
                  -
                  -    [1].concat([2]);
                  -    // ==> [1, 2]
                  -
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 57, column 18
                  {
                  -    /*~*/
                  -    Nothing: function map(transformation) {
                  -      assertFunction('Maybe.Nothing#map', transformation);
                  -      return this;
                  -    },
                  -
                  -    /*~*/
                  -    Just: function map(transformation) {
                  -      assertFunction('Maybe.Just#map', transformation);
                  -      return Just(transformation(this.value));
                  -    }
                  -  }
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.of.html b/docs/api/en/folktale.data.maybe.maybe.of.html deleted file mode 100644 index 9eb4895..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.of.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - of - - - - - -

                  of

                  Constructs a Maybe value that represents a successful value (a Just).

                  -

                  Signature

                  of(value)
                  forall a: (a) => Maybe a

                  Documentation

                  Constructs a Maybe value that represents a successful value (a Just).

                  -
                  -

                  NOTE:
                  The provided value is stored as-given in the structure. If you want to -convert a nullable value (a value that may be null/undefined) to a Maybe -value, use the Maybe.fromNullable(value) function instead of -Maybe.of(value).

                  -
                  -

                  See the documentation for the Maybe structure to understand how to use this.

                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 224, column 21
                  of(value) {
                  -    return Just(value);
                  -  }
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.orelse.html b/docs/api/en/folktale.data.maybe.maybe.orelse.html deleted file mode 100644 index f69622d..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.orelse.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - orElse - - - - - -

                  orElse

                  Allows recovering from from failed Maybe values.

                  -

                  Signature

                  forall a: (Maybe a).((a) => Maybe a) => Maybe a

                  Documentation

                  Allows recovering from from failed Maybe values.

                  -

                  While .chain() allows one to sequence operations, such that the second -operation is ran only if the first one succeeds, and their state is propagated, -.orElse() allows one to recover from a failed operation by providing a new -state.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -function first(list) {
                  -  return list.length > 0 ?   Maybe.Just(list[0])
                  -  :      /* otherwise */     Maybe.Nothing();
                  -}
                  -
                  -let failures = 0;
                  -function emitFailure() {
                  -  failures += 1;
                  -  return Maybe.Just('failed');
                  -}
                  -
                  -first(['one']).orElse(emitFailure);
                  -// ==> Maybe.Just('one')
                  -
                  -failures; // ==> 0
                  -
                  -first([]).orElse(emitFailure);
                  -// ==> Maybe.Just('failed')
                  -
                  -failures; // ==> 1
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 57, column 18
                  {
                  -    /*~*/
                  -    Nothing: function orElse(handler) {
                  -      assertFunction('Maybe.Nothing#orElse', handler);
                  -      return handler(this.value);
                  -    },
                  -
                  -    /*~*/
                  -    Just: function orElse(handler) {
                  -      assertFunction('Maybe.Nothing#orElse', handler);
                  -      return this;
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.toresult.html b/docs/api/en/folktale.data.maybe.maybe.toresult.html deleted file mode 100644 index 466ff9b..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.toresult.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - toResult - - - - - -

                  toResult

                  A convenience method for the folktale/data/conversions/maybe-to-result module.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toResult(fallbackValue)
                  forall a, b: (Maybe a).(b) => Result b a

                  Documentation

                  A convenience method for the folktale/data/conversions/maybe-to-result module.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -const Result = require('folktale/data/result');
                  -
                  -Maybe.Just(1).toResult(0);
                  -// ==> Result.Ok(1)
                  -
                  -Maybe.Nothing().toResult(0)
                  -// ==> Result.Error(0)
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 224, column 21
                  toResult(fallbackValue) {
                  -    return require('folktale/data/conversions/maybe-to-result')(this, fallbackValue);  
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.tovalidation.html b/docs/api/en/folktale.data.maybe.maybe.tovalidation.html deleted file mode 100644 index 4aef53d..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.tovalidation.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - toValidation - - - - - -

                  toValidation

                  A convenience method for the folktale/data/conversions/maybe-to-validation module.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toValidation(fallbackValue)
                  forall a, b: (Maybe a).(b) => Result b a

                  Documentation

                  A convenience method for the folktale/data/conversions/maybe-to-validation module.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -const Validation = require('folktale/data/validation');
                  -
                  -Maybe.Just(1).toValidation(0);
                  -// ==> Validation.Success(1)
                  -
                  -Maybe.Nothing().toValidation(0)
                  -// ==> Validation.Failure(0)
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 224, column 21
                  toValidation(fallbackValue) {
                  -    return require('folktale/data/conversions/maybe-to-validation')(this, fallbackValue);
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.unsafeget.html b/docs/api/en/folktale.data.maybe.maybe.unsafeget.html deleted file mode 100644 index 308887d..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.unsafeget.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - unsafeGet - - - - - -

                  unsafeGet

                  Extracts the value from a Just structure.

                  -

                  Signature

                  forall a: (Maybe a).() => a :: (throws TypeError)

                  Documentation

                  Extracts the value from a Just structure.

                  -
                  -

                  WARNING
                  This method is partial, which means that it will only work for -Just structures, not for Nothing structures. It's recommended -to use .getOrElse() or .matchWith() instead.

                  -
                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -Maybe.Just(1).unsafeGet(); // ==> 1
                  -
                  -try {
                  -  Maybe.Nothing().unsafeGet();
                  -  // TypeError: Can't extract the value of a Nothing
                  -} catch (e) {
                  -  e instanceof TypeError; // ==> true
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 57, column 18
                  {
                  -    /*~*/
                  -    Nothing: function unsafeGet() {
                  -      throw new TypeError(`Can't extract the value of a Nothing.
                  -
                  -    Since Nothing holds no values, it's not possible to extract one from them.
                  -    You might consider switching from Maybe#get to Maybe#getOrElse, or some other method
                  -    that is not partial.
                  -      `);
                  -    },
                  -
                  -    /*~*/
                  -    Just: function unsafeGet() {
                  -      return this.value;
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.maybe.maybe.value.html b/docs/api/en/folktale.data.maybe.maybe.value.html deleted file mode 100644 index f552771..0000000 --- a/docs/api/en/folktale.data.maybe.maybe.value.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - value - - - - - -

                  value

                  The value contained in a Just instance of the Maybe structure.

                  -

                  Signature

                  get value()
                  forall a: get (Maybe a) => a

                  Documentation

                  The value contained in a Just instance of the Maybe structure.

                  -

                  This is usually used to destructure the instance in a .matchWith call.

                  -

                  Example:

                  -
                  const Maybe = require('folktale/data/maybe');
                  -
                  -Maybe.Just(1).matchWith({
                  -  Just: ({ value }) => value, // equivalent to (x) => x.value
                  -  Nothing: () => 'nothing'
                  -});
                  -// ==> 1
                  -

                  Properties

                  Source Code

                  Defined in src/data/maybe/maybe.js at line 44, column 23
                  get value() {
                  -    throw new TypeError('`value` can’t be accessed in an abstract instance of Maybe.Just');
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/maybe/maybe
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.frommaybe.html b/docs/api/en/folktale.data.result.frommaybe.html deleted file mode 100644 index 242c909..0000000 --- a/docs/api/en/folktale.data.result.frommaybe.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - fromMaybe - - - - - -

                  fromMaybe

                  A convenience method for the folktale/data/conversions/maybe-to-result module.

                  -

                  Signature

                  fromMaybe(aMaybe, failureValue)
                  forall a, b: (Maybe b, a) => Result a b

                  Documentation

                  A convenience method for the folktale/data/conversions/maybe-to-result module.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -const Maybe = require('folktale/data/maybe');
                  -
                  -Result.fromMaybe(Maybe.Just(1), 'error');
                  -// ==> Result.Ok(1)
                  -
                  -Result.fromMaybe(Maybe.Nothing(), 'error');
                  -// ==> Result.Error('error')
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/index.js at line 18, column 17
                  fromMaybe(aMaybe, failureValue) {
                  -    return require('folktale/data/conversions/maybe-to-result')(aMaybe, failureValue);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.fromnullable.html b/docs/api/en/folktale.data.result.fromnullable.html deleted file mode 100644 index e381fe3..0000000 --- a/docs/api/en/folktale.data.result.fromnullable.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - fromNullable - - - - - -

                  fromNullable

                  A convenience method for the folktale/data/conversions/nullable-to-result -module.

                  -

                  Signature

                  fromNullable(aNullable)
                  forall a: (a or None) => Result None a

                  Documentation

                  A convenience method for the folktale/data/conversions/nullable-to-result -module.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.fromNullable(1);
                  -// ==> Result.Ok(1)
                  -
                  -Result.fromNullable(null);
                  -// ==> Result.Error(null)
                  -
                  -Result.fromNullable(undefined);
                  -// ==> Result.Error(undefined)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/index.js at line 18, column 17
                  fromNullable(aNullable) {
                  -    return require('folktale/data/conversions/nullable-to-result')(aNullable);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.fromvalidation.html b/docs/api/en/folktale.data.result.fromvalidation.html deleted file mode 100644 index f0c48ed..0000000 --- a/docs/api/en/folktale.data.result.fromvalidation.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - fromValidation - - - - - -

                  fromValidation

                  A convenience method for the folktale/data/conversions/validation-to-result -module.

                  -

                  Signature

                  fromValidation(aValidation)
                  forall a, b: (Validation a b) => Result a b

                  Documentation

                  A convenience method for the folktale/data/conversions/validation-to-result -module.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -const Validation = require('folktale/data/validation');
                  -
                  -Result.fromValidation(Validation.Success(1));
                  -// ==> Result.Ok(1)
                  -
                  -Result.fromValidation(Validation.Failure(1));
                  -// ==> Result.Error(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/index.js at line 18, column 17
                  fromValidation(aValidation) {
                  -    return require('folktale/data/conversions/validation-to-result')(aValidation);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.html b/docs/api/en/folktale.data.result.html deleted file mode 100644 index 6269cb7..0000000 --- a/docs/api/en/folktale.data.result.html +++ /dev/null @@ -1,604 +0,0 @@ - - - - - module folktale/data/result - - - - - -

                  module folktale/data/result

                  A data structure that models the result of operations that may fail. A Result -helps with representing errors and propagating them, giving users a more -controllable form of sequencing operations than that offered by constructs like -try/catch.

                  -

                  Documentation

                  A data structure that models the result of operations that may fail. A Result -helps with representing errors and propagating them, giving users a more -controllable form of sequencing operations than that offered by constructs like -try/catch.

                  -

                  A Result may be either an Ok(value), which contains a successful value, or -an Error(value), which contains an error.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -const { data, derivations } = require('folktale/core/adt');
                  -
                  -const DivisionErrors = data('division-errors', {
                  -  DivisionByZero(dividend) {
                  -    return { dividend };
                  -  }
                  -}).derive(
                  -  derivations.equality,
                  -  derivations.debugRepresentation
                  -);
                  -
                  -const { DivisionByZero } = DivisionErrors;
                  -
                  -
                  -const divideBy = (dividend, divisor) => 
                  -  divisor === 0 ?  Result.Error(DivisionByZero(dividend))
                  -: /* otherwise */  Result.Ok(Math.floor(dividend / divisor));
                  -
                  -divideBy(4, 2);
                  -// ==> Result.Ok(2)
                  -
                  -divideBy(4, 0);
                  -// ==> Result.Error(DivisionByZero(4))
                  -

                  Why use Result?

                  -

                  Sometimes functions fail, for many reasons: someone might have provided an -unexpected value to it, the internet connection might have gone down in the -middle of an HTTP request, the database might have died. Regardless of which -reason, we have to handle these failures. And, of course, we'd like to handle -failures in the simplest way possible.

                  -

                  In JavaScript you're often left with two major ways of dealing with these -failures: a branching instruction (like if/else), or throwing errors and -catching them.

                  -

                  To see how Result compares to these, we'll look at a function that needs to -validate some information, and that incorporates some more complex validation -rules. A person may sign-up for a service by providing the form they would -prefer being contacted (email or phone), and the information related to that -preference has to be provided, but any other info is optional:

                  -
                  // Functions to assert the format of each data
                  -const isValidName  = (name)  => name.trim() !== '';
                  -const isValidEmail = (email) => /(.+)@(.+)/.test(email);
                  -const isValidPhone = (phone) => /^\d+$/.test(phone);
                  -
                  -// Objects representing each possible failure in the validation
                  -const { data, derivations } = require('folktale/core/adt');
                  -
                  -const ValidationErrors = data('validation-errors', {
                  -  Required(field) {
                  -    return { field };
                  -  },
                  -
                  -  InvalidEmail(email) {
                  -    return { email };
                  -  },
                  -
                  -  InvalidPhone(phone) {
                  -    return { phone };
                  -  },
                  -
                  -  InvalidType(type) {
                  -    return { type };
                  -  },
                  -
                  -  Optional(error) {
                  -    return { error };
                  -  }
                  -}).derive(derivations.equality);
                  -
                  -const { 
                  -  Required, 
                  -  InvalidEmail, 
                  -  InvalidPhone, 
                  -  InvalidType, 
                  -  Optional 
                  -} = ValidationErrors;
                  -

                  Branching stops being a very feasible thing after a couple of cases. It's very -simple to forget to handle failures (often with catastrophic effects, as can be -seen in things like NullPointerException and the likes), and there's no error -propagation, so every part of the code has to handle the same error over and -over again:

                  -
                  const validateBranching = ({ name, type, email, phone }) => {
                  -  if (!isValidName(name)) {
                  -    return Required('name');
                  -  } else if (type === 'email') {
                  -    if (!isValidEmail(email)) {
                  -      return InvalidEmail(email);
                  -    } else if (phone && !isValidPhone(phone)) {
                  -      return Optional(InvalidPhone(phone));
                  -    } else {
                  -      return { type, name, email, phone };
                  -    }
                  -  } else if (type === 'phone') {
                  -    if (!isValidPhone(phone)) {
                  -      return InvalidPhone(phone);
                  -    } else if (email && !isValidEmail(email)) {
                  -      return Optional(InvalidEmail(email));
                  -    } else {
                  -      return { type, name, email, phone };
                  -    }
                  -  } else {
                  -    return InvalidType(type);
                  -  }
                  -};
                  -
                  -
                  -validateBranching({
                  -  name: 'Max',
                  -  type: 'email',
                  -  phone: '11234456'
                  -});
                  -// ==> InvalidEmail(undefined)
                  -
                  -validateBranching({
                  -  name: 'Alissa',
                  -  type: 'email',
                  -  email: 'alissa@somedomain'
                  -});
                  -// ==> { type: 'email', name: 'Alissa', email: 'alissa@somedomain', phone: undefined }
                  -

                  Exceptions (with the throw and try/catch constructs) alleviate this a bit. -They don't solve the cases where you forget to handle a failure—although that -often results in crashing the process, which is better than continuing but doing -the wrong thing—, but they allow failures to propagate, so fewer places in the -code need to really deal with the problem:

                  -
                  const id = (a) => a;
                  -
                  -const assertEmail = (email, wrapper=id) => {
                  -  if (!isValidEmail(email)) {
                  -    throw wrapper(InvalidEmail(email));
                  -  }
                  -};
                  -
                  -const assertPhone = (phone, wrapper=id) => {
                  -  if (!isValidPhone(phone)) {
                  -    throw wrapper(InvalidEmail(email));
                  -  }
                  -};
                  -
                  -const validateThrow = ({ name, type, email, phone }) => {
                  -  if (!isValidName(name)) {
                  -    throw Required('name');
                  -  }
                  -  switch (type) {
                  -    case 'email':
                  -      assertEmail(email);
                  -      if (phone)  assertPhone(phone, Optional);
                  -      return { type, name, email, phone };
                  -
                  -    case 'phone':
                  -      assertPhone(phone);
                  -      if (email)  assertEmail(email, Optional);
                  -      return { type, name, email, phone };
                  -
                  -    default:
                  -      throw InvalidType(type);
                  -  }
                  -};
                  -
                  -
                  -try {
                  -  validateThrow({
                  -    name: 'Max',
                  -    type: 'email',
                  -    phone: '11234456'
                  -  });
                  -} catch (e) {
                  -  e; // ==> InvalidEmail(undefined)
                  -}
                  -
                  -validateThrow({
                  -  name: 'Alissa',
                  -  type: 'email',
                  -  email: 'alissa@somedomain'
                  -});
                  -// ==> { type: 'email', name: 'Alissa', email: 'alissa@somedomain', phone: undefined }
                  -

                  On the other hand, the error propagation that we have with throw doesn't tell -us much about how much of the code has actually been executed, and this is -particularly problematic when you have side-effects. How are you supposed to -recover from a failure when you don't know in which state your application is?

                  -

                  Result helps with both of these cases. With a Result, the user is forced to -be aware of the failure, since they're not able to use the value at all without -unwrapping the value first. At the same time, using a Result value will -automatically propagate the errors when they're not handled, making error -handling easier. Since Result runs one operation at a time when you use the -value, and does not do any dynamic stack unwinding (as throw does), it's much -easier to understand in which state your application should be.

                  -

                  Using Result, the previous examples would look like this:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -const checkName = (name) =>
                  -  isValidName(name) ?  Result.Ok(name)
                  -: /* otherwise */      Result.Error(Required('name'));
                  -
                  -const checkEmail = (email) =>
                  -  isValidEmail(email) ?  Result.Ok(email)
                  -: /* otherwise */        Result.Error(InvalidEmail(email));
                  -
                  -const checkPhone = (phone) =>
                  -  isValidPhone(phone) ?  Result.Ok(phone)
                  -: /* otherwise */        Result.Error(InvalidPhone(phone));
                  -
                  -const optional = (check) => (value) =>
                  -  value           ?  check(value).mapError(Optional)
                  -: /* otherwise */    Result.Ok(value);
                  -
                  -const maybeCheckEmail = optional(checkEmail);
                  -const maybeCheckPhone = optional(checkPhone);
                  -
                  -
                  -const validateResult = ({ name, type, email, phone }) =>
                  -  checkName(name).chain(_ => 
                  -    type === 'email' ?  checkEmail(email).chain(_ =>
                  -                          maybeCheckPhone(phone).map(_ => ({
                  -                            name, type, email, phone
                  -                          }))
                  -                        )
                  -
                  -  : type === 'phone' ?  checkPhone(phone).chain(_ =>
                  -                          maybeCheckEmail(email).map(_ => ({
                  -                            name, type, email, phone
                  -                          }))
                  -                        )
                  -
                  -  : /* otherwise */     Result.Error(InvalidType(type))
                  -  );
                  -
                  -
                  -validateResult({
                  -  name: 'Max',
                  -  type: 'email',
                  -  phone: '11234456'
                  -});
                  -// ==> Result.Error(InvalidEmail(undefined))
                  -
                  -validateResult({
                  -  name: 'Alissa',
                  -  type: 'email',
                  -  email: 'alissa@somedomain'
                  -});
                  -// ==> Result.Ok({ name: 'Alissa', type: 'email', phone: undefined, email: 'alissa@somedomain' })
                  -

                  So, Results give you simpler and more predictable forms of error handling, that -still allow error propagation and composition to happen, as with regular -JavaScript exceptions, at the cost of some additional syntactical overhead, -since JavaScript does not allow one to abstract over syntax.

                  -

                  Working with Result values

                  -

                  A Result value may be one of the following cases:

                  -
                    -
                  • Ok(value) — represents a successful value (e.g.: the correct return value -from a function).

                    -
                  • -
                  • Error(value) — represents an unsuccessful value (e.g.: an error during the -evaluation of a function).

                    -
                  • -
                  -

                  Functions that may fail just return one of these two cases instead of failing. -That is, instead of writing something like this:

                  -
                  //: (Number, Number) => Number throws DivisionByZero
                  -const divideBy1 = (dividend, divisor) => {
                  -  if (divisor === 0) {
                  -    throw new Error('Division by zero');
                  -  } else {
                  -    return dividend / divisor;
                  -  }
                  -}
                  -
                  -divideBy1(6, 3); // ==> 2
                  -

                  One would write something like this:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -//: (Number, Number) => Result DivisionByZero Number
                  -const divideBy2 = (dividend, divisor) => {
                  -  if (divisor === 0) {
                  -    return Result.Error('Division by zero');
                  -  } else {
                  -    return Result.Ok(dividend / divisor);
                  -  }
                  -}
                  -
                  -divideBy2(6, 3); // ==> Result.Ok(2)
                  -

                  The function returns a value of the type Result <error-type> <success-type>, -which is quite similar to the first version of the function, with the difference -that the error is made into a real value that the function returns, and as such -can be interacted with in the same way one interacts with any other object in -the language.

                  -

                  Because the value is wrapped in the Result structure, in order to use the -value one must first unwrap it. Folktale's Result provides methods to help -with this, and they can be divided roughly into 3 categories:

                  -
                    -
                  • Sequencing computations: A Result is the result of a computation that -can fail. Sometimes we want to run several computations that may fail in -sequence, and these methods help with that. This is roughly the equivalent -of ; in imperative programming, where the next instruction is only -executed if the previous instruction succeeds.

                    -
                  • -
                  • Transforming values: Sometimes we get a Result value that isn't -quite the value we're looking for. We don't really want to change the -status of the computation (errors should continue to be errors, successes -should continue to be successes), but we'd like to tweak the resulting -value a bit. This is the equivalent of applying functions in an -expression.

                    -
                  • -
                  • Extracting values: Sometimes we need to pass the value into things that -don't really know what a Result is, so we have to somehow extract the -value out of the structure. These methods help with that.

                    -
                  • -
                  -

                  We'll see each of these categories in more details below.

                  -

                  Sequencing computations

                  -

                  Because Result is used for partial functions which may fail in, possibly, many -different ways a common use case for the structure is combining all of these -functions such that only successful values flow through.

                  -

                  You can sequence computations in this manner with the Result structure by -using the .chain method. The method takes as argument a single function that -will receive the value in the Result structure, and must return a new Result -structure, which then becomes the result of the method. Only successful values -flow through the function argument, errors are just propagated to the result -immediately.

                  -

                  As an example, imagine we want to parse an integer. Integers are basically a -sequence of many digits, but we can start smaller and try figuring out how we -parse a single digit:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -const isDigit = (character) =>
                  -  '0123456789'.split('').includes(character);
                  -
                  -const digit = (input) => {
                  -  const character = input.slice(0, 1);
                  -  const rest = input.slice(1);
                  -
                  -  return isDigit(character) ?  Result.Ok([character, rest])
                  -  :      /* otherwise */       Result.Error(`Expected a digit (0..9), got "${character}"`);
                  -};
                  -
                  -digit('012'); 
                  -// ==> Result.Ok(['0', '12'])
                  -
                  -digit('a12'); 
                  -// ==> Result.Error('Expected a digit (0..9), got "a"')
                  -

                  So far our parser correctly recognises the first digit in a sequence of -characters, but to parse integers we need it to recognise more than one digit. -We can also only proceed to the next character if the first one succeeds -(otherwise we already know it's not an integer!).

                  -

                  If we have a fixed number of digits that would look like the following:

                  -
                  const twoDigits = (input) =>
                  -  digit(input).chain(([char1, rest]) =>
                  -    digit(rest).map(([char2, rest]) =>
                  -      [char1 + char2, rest]
                  -    )
                  -  );
                  -
                  -twoDigits('012');
                  -// ==> Result.Ok(['01', '2'])
                  -
                  -twoDigits('a12');
                  -// ==> Result.Error('Expected a digit (0..9), got "a"')
                  -
                  -twoDigits('0a2');
                  -// ==> Result.Error('Expected a digit (0..9), got "a"')
                  -

                  We can generalise this to arbitrary numbers of digits by writing a recursive -function:

                  -
                  const digits = (input) =>
                  -  input === '' ?   Result.Error('Expected a digit (0..9), but there was nothing to parse')
                  -: /* otherwise */  digit(input).chain(([character, rest]) =>
                  -                     rest === '' ?  Result.Ok(character)
                  -                   : /* else */     digits(rest).chain(characters =>
                  -                                      Result.Ok(character + characters)
                  -                                    )
                  -                   );
                  -
                  -digits('012');
                  -// ==> Result.Ok('012')
                  -
                  -digits('a12');
                  -// ==> Result.Error('Expected a digit (0..9), got "a"')
                  -
                  -digits('01a');
                  -// ==> Result.Error('Expected a digit (0..9), got "a"')
                  -
                  -digits('');
                  -// ==> Result.Error('Expected a digit (0..9), but there was nothing to parse')
                  -
                  -

                  NOTE
                  While the recursive .chain can be used when performing an arbitrary number -of computations, it should be noted that it may grow the stack of calls in a -JavaScript implementation beyond what that implementation supports, resulting -in a Max Call Stack Size Exceeded error.

                  -
                  -

                  Finally, parsing should give us a number instead of a string, so that string -needs to be converted. Since we already ensured that the resulting string only -has digits, the conversion from String to Number can never fail, but we can -still use .chain if we always return a Result.Ok:

                  -
                  const integer = (input) =>
                  -  digits(input).chain(x => Result.Ok(Number(x)));
                  -
                  -integer('012');
                  -// ==> Result.Ok(12)
                  -
                  -integer('01a')
                  -// ==> Result.Error('Expected a digit (0..9), got "a"')
                  -

                  Transforming values

                  -

                  Sometimes we want to transform just the value that is inside of a Result, -without touching the context of that value (whether the Result is a success or -an error). In the previous section, the integer transformation is a good -example of this. For these cases, the .map method can be used instead of the -.chain method:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Ok('012').map(Number);
                  -// ==> Result.Ok(12)
                  -

                  Note that, like .chain, the .map method only runs on successful values, thus -it propagates failures as well:

                  -
                  Result.Error('012').map(Number);
                  -// ==> Result.Error('012')
                  -

                  Extracting values

                  -

                  While one can always just put all the rest of a computation inside of a -.chain, sometimes it may be preferrable to extract the value out of a Result -structure instead. For these cases there's a .getOrElse method:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Ok(1).getOrElse('not found');
                  -// ==> 1
                  -
                  -Result.Error(1).getOrElse('not found');
                  -// ==> 'not found'
                  -

                  Additionally, if one doesn't care about whether the value failed or succeeded, -the .merge method just returns whatever value is wrapped in the Result:

                  -
                  Result.Ok(1).merge();
                  -// ==> 1
                  -
                  -Result.Error(1).merge();
                  -// ==> 1
                  -

                  Error handling

                  -

                  Since the purpose of a Result structure is to represent failures, we need to -be able to handle these failures in some way. The .getOrElse method gives us -some very specific and limited form of error handling, but if we want to do -something in order to recover from an error, this doesn't help us much.

                  -

                  For a more general form of error handling, the Result structure provides the -.orElse method. This works pretty much in the same way .chain does, except -it invokes the function on errors (successes are propagated):

                  -
                  const Result = require('folktale/data/result');
                  -
                  -const parseNumber = (input) =>
                  -  isNaN(input) ?   Result.Error(`Not a number: ${input}`) 
                  -: /* otherwise */  Result.Ok(Number(input));
                  -
                  -const parseBool = (input) =>
                  -  input === 'true'  ?  Result.Ok(true)
                  -: input === 'false' ?  Result.Ok(false)
                  -: /* otherwise */      Result.Error(`Not a boolean: ${input}`);
                  -
                  -
                  -const parseNumberOrBool = (input) =>
                  -  parseNumber(input)
                  -    .orElse(_ => parseBool(input));
                  -
                  -
                  -parseNumberOrBool('13');
                  -// ==> Result.Ok(13)
                  -
                  -parseNumberOrBool('true');
                  -// ==> Result.Ok(true)
                  -
                  -parseNumberOrBool('foo');
                  -// ==> Result.Error('Not a boolean: foo')
                  -

                  As with successes' .map, one may also transform the failure value of a -Result without changing the context of the computation by using the -.mapError method:

                  -
                  const parseNumberOrBool2 = (input) =>
                  -  parseNumber(input)
                  -    .orElse(_ => parseBool(input))
                  -    .mapError(_ => `Not a number or boolean: ${input}`);
                  -
                  -parseNumberOrBool2('foo');
                  -// ==> Result.Error('Not a number or boolean: foo')
                  -

                  Pattern matching

                  -

                  As with other union structures in Folktale, Result provides a .matchWith() -method to perform a limited form of pattern matching. Pattern matching allows -one to specify a piece of code for each case in a structure, like an if/else -or switch, but specific to that structure.

                  -

                  We could use .matchWith() to run different computations depending on whether a -MResult value represents a success or a failure, for example, without the -requirement of having to return a Result:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Ok(1).matchWith({
                  -  Ok:    ({ value }) => `Ok: ${value}`,
                  -  Error: ({ value }) => `Error: ${value}`
                  -});
                  -// ==> 'Ok: 1'
                  -
                  -Result.Error(1).matchWith({
                  -  Ok:    ({ value }) => `Ok: ${value}`,
                  -  Error: ({ value }) => `Error: ${value}`
                  -});
                  -// ==> 'Error: 1'
                  -

                  How does Result compare to Validation?

                  -

                  Result and Validation are pretty close structures. They both try to represent -whether a particular thing has failed or succeeded, and even their vocabulary is -very similar (Error vs. Failure, Ok vs. Success). The major difference -is in some of their methods.

                  -

                  A Result is a data structure that implements the Monad interface (.chain). -This makes Result a pretty good structure to model a sequence of computations -that may fail, where a computation may only run if the previous computation -succeeded. In this sense, a Result's .chain method is very similar to -JavaScript's ; at the end of statements: the statement at the right of the -semicolon only runs if the statement at the left did not throw an error.

                  -

                  A Validation is a data structure that implements the Applicative interface -(.apply), and does so in a way that if a failure is applied to another -failure, then it results in a new validation that contains the failures of both -validations. In other words, Validation is a data structure made for errors that -can be aggregated, and it makes sense in the contexts of things like form -validations, where you want to display to the user all of the fields that failed -the validation rather than just stopping at the first failure.

                  -

                  Validations can't be as easily used for sequencing operations because the -.apply method takes two validations, so the operations that create them must -have been executed already. While it is possible to use Validations in a -sequential manner, it's better to leave the job to Result, a data structure made -for that.

                  -

                  Properties

                  Comparing and testing

                  hasInstance(value)

                  Tests if an arbitrary value is a Result instance.

                  -
                  Experimental

                  Constructing

                  of(value)

                  Constructs a Result holding an Ok value.

                  -
                  Experimental

                  Converting from other types

                  fromMaybe(aMaybe, failureValue)

                  A convenience method for the folktale/data/conversions/maybe-to-result module.

                  -
                  fromNullable(aNullable)

                  A convenience method for the folktale/data/conversions/nullable-to-result -module.

                  -
                  fromValidation(aValidation)

                  A convenience method for the folktale/data/conversions/validation-to-result -module.

                  -

                  Handling errors

                  try: _try(f)

                  Runs a function that may raise an exception, trapping it. Returns an Ok with -the return value of the function, if it has finished successfully, or an Error -with the raised exception.

                  -
                  Experimental

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aResult.toJSON() into a proper Result structure.

                  -
                  Experimental

                  Variants

                  Error(value)

                  Constructs a Result whose value represents a failure.

                  -
                  Experimental
                  Ok(value)

                  Constructs a Result whose value represents a success.

                  -
                  Experimental

                  Source Code

                  Defined in src/data/result/index.js at line 18, column 0
                  {
                  -  Error: Result.Error,
                  -  Ok: Result.Ok,
                  -  hasInstance: Result.hasInstance,
                  -  of: Result.of,
                  -  fromJSON: Result.fromJSON,
                  -  [typeSymbol]: Result[typeSymbol],
                  -  try: require('./try'),
                  -
                  -  /*~
                  -   * type: |
                  -   *   forall a: (a or None) => Result None a
                  -   */
                  -  fromNullable(aNullable) {
                  -    return require('folktale/data/conversions/nullable-to-result')(aNullable);
                  -  },
                  -
                  -  /*~
                  -   * type: |
                  -   *   forall a, b: (Validation a b) => Result a b
                  -   */
                  -  fromValidation(aValidation) {
                  -    return require('folktale/data/conversions/validation-to-result')(aValidation);
                  -  },
                  -
                  -  /*~
                  -   * type: |
                  -   *   forall a, b: (Maybe b, a) => Result a b
                  -   */
                  -  fromMaybe(aMaybe, failureValue) {
                  -    return require('folktale/data/conversions/maybe-to-result')(aMaybe, failureValue);
                  -  }
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.1.html b/docs/api/en/folktale.data.result.result.1.html deleted file mode 100644 index 8384a70..0000000 --- a/docs/api/en/folktale.data.result.result.1.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Ok - - - - - -

                  Ok

                  Constructs a Result whose value represents a success.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Ok(value)
                  forall a, b: (b) => Result a b

                  Documentation

                  Constructs a Result whose value represents a success.

                  -

                  See the documentation for the Result structure to understand how to use this.

                  -

                  Static properties

                  Comparing and testing

                  hasInstance(value)

                  Tests if an arbitrary value is a Ok case of a Result instance.

                  -
                  Experimental

                  Debugging

                  inspect: toString()

                  A textual representation of the Ok variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the Ok variant.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor for this variant.

                  -
                  Experimental
                  prototype

                  The container for instance methods for Ok variants of the Result structure.

                  -
                  Experimental
                  get tag

                  The tag for this variant, unique among the Result variants.

                  -
                  Experimental
                  get type

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -
                  Experimental

                  Instance (prototype) properties

                  Comparing and testing

                  equals(value)

                  Performs a deep-comparison of two Result values for equality. See core/adt/derivations/equality for details.

                  -
                  Experimental
                  hasInstance(value)

                  Tests if an arbitrary value is a Result instance.

                  -
                  ExperimentalInherited
                  get isOk

                  True if the value is a Ok instance.

                  -
                  Deprecated

                  Constructing

                  of(value)

                  Constructs a Result holding an Ok value.

                  -
                  ExperimentalInherited

                  Converting to other types

                  toMaybe()

                  Transforms a Result into a Maybe. Error values are lost in the process.

                  -
                  ExperimentalInherited
                  toValidation()

                  Transforms a Result into a Validation.

                  -
                  ExperimentalInherited

                  Data fields

                  get value

                  The value contained in an Ok instance of the Result structure.

                  -
                  Abstract

                  Debugging

                  inspect: toString()

                  A textual representation for Result instances.

                  -
                  Experimental
                  toString()

                  A textual representation for Result instances.

                  -
                  Experimental

                  Extracting values

                  get()

                  This method has been renamed to unsafeGet().

                  -
                  DeprecatedInherited
                  getOrElse()

                  Extracts the value of a Result structure, if it exists (i.e.: is an Ok), -otherwise returns the provided default value.

                  -
                  Experimental
                  merge()

                  Returns the value inside of the Result structure, regardless of its state.

                  -
                  ExperimentalInherited
                  unsafeGet()

                  Extracts the value from a Result structure.

                  -
                  Experimental

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/bimap(f, g)

                  Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

                  -
                  fantasy-land/chain(transformation)

                  Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

                  -
                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -
                  fantasy-land/map(transformation)

                  Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

                  -
                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Pattern matching

                  fold()

                  Applies a function to each case of a Result.

                  -
                  Experimental
                  matchWith(pattern)

                  Chooses and executes a function for each variant in the Result structure.

                  -
                  Experimental

                  Recovering from errors

                  orElse()

                  Allows recovering from Error values with a handler function.

                  -
                  Experimental
                  swap()

                  Inverts the context of a Result value such that Errors are transformed into Oks, -and Oks are transformed into Errors. Does not touch the value inside of the -Result.

                  -
                  Experimental

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aResult.toJSON() into a proper Result structure.

                  -
                  ExperimentalInherited
                  toJSON()

                  Converts a Result value to a JavaScript object that may be stored as a JSON value.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor for this variant.

                  -
                  variants

                  The variants in the Result structure.

                  -
                  ExperimentalInherited

                  Transforming

                  apply()

                  Applies the function contained in one Result to the value in another Result. -Application only occurs if both Results are Ok, otherwise keeps the first -Error.

                  -
                  Experimental
                  bimap()

                  Transforms each side of a Result with a function, without changing the context -of the computation. That is, Errors will still be Errors, Oks will still be -Oks.

                  -
                  Experimental
                  chain()

                  Transforms the value and context of a Result computation with an unary function. -As with .map(), the transformation is only applied if the value is an Ok, -but the transformation is expected a new Result value, which then becomes the -result of the method.

                  -
                  Experimental
                  map()

                  Transforms the value inside of a Result structure with an unary function without -changing the context of the computation. That is, Error values continue to be -Error values, and Ok values continue to be Ok values.

                  -
                  Experimental
                  mapError()

                  Transforms the value inside an Error without changing the context of the -computation.

                  -
                  Experimental

                  Variants

                  Error(value)

                  Constructs a Result whose value represents a failure.

                  -
                  ExperimentalInherited
                  Ok(value)

                  Constructs a Result whose value represents a success.

                  -
                  ExperimentalInherited

                  Source Code

                  Ok(value) {
                  -    return { value };
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.apply.html b/docs/api/en/folktale.data.result.result.apply.html deleted file mode 100644 index 491c509..0000000 --- a/docs/api/en/folktale.data.result.result.apply.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - apply - - - - - -

                  apply

                  Applies the function contained in one Result to the value in another Result. -Application only occurs if both Results are Ok, otherwise keeps the first -Error.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall a, b, c:
                  -  (Result a ((b) => c)).(Result a b) => Result a c

                  Documentation

                  Applies the function contained in one Result to the value in another Result. -Application only occurs if both Results are Ok, otherwise keeps the first -Error.

                  -

                  Note that Result.Ok(x => x + 1).apply(Result.Ok(1)) is equivalent to -Result.Ok(1).map(x => x + 1).

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -function increment(value) {
                  -  return value + 1;
                  -}
                  -
                  -Result.Ok(increment).apply(Result.Ok(1));
                  -// ==> Result.Ok(2)
                  -
                  -Result.Ok(increment).apply(Result.Error(1));
                  -// ==> Result.Error(1)
                  -
                  -Result.Error(increment).apply(Result.Ok(1));
                  -// ==> Result.Error(increment)
                  -
                  -Result.Error(increment).apply(Result.Error(1));
                  -// ==> Result.Error(increment)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function apply(anResult) {
                  -      assertResult('Result.Error#apply', anResult);
                  -      return this;
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function apply(anResult) {
                  -      assertResult('Result.Ok#apply', anResult);
                  -      return anResult.map(this.value);
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.bimap.html b/docs/api/en/folktale.data.result.result.bimap.html deleted file mode 100644 index 6d87b29..0000000 --- a/docs/api/en/folktale.data.result.result.bimap.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - bimap - - - - - -

                  bimap

                  Transforms each side of a Result with a function, without changing the context -of the computation. That is, Errors will still be Errors, Oks will still be -Oks.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  (Result a b).((a) => c, (b) => d) => Result c d

                  Documentation

                  Transforms each side of a Result with a function, without changing the context -of the computation. That is, Errors will still be Errors, Oks will still be -Oks.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -const inc = (x) => x + 1;
                  -const dec = (x) => x - 1;
                  -
                  -
                  -Result.Ok(1).bimap(inc, dec);
                  -// ==> Result.Ok(dec(1))
                  -
                  -Result.Error(1).bimap(inc, dec);
                  -// ==> Result.Error(inc(1))
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function bimap(f, g) {
                  -      assertFunction('Result.Error#bimap', f);
                  -      assertFunction('Result.Error#bimap', g);
                  -      return Error(f(this.value));
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function bimap(f, g) {
                  -      assertFunction('Result.Ok#bimap', f);
                  -      assertFunction('Result.Ok#bimap', g);
                  -      return Ok(g(this.value));
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.chain.html b/docs/api/en/folktale.data.result.result.chain.html deleted file mode 100644 index a30095f..0000000 --- a/docs/api/en/folktale.data.result.result.chain.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - chain - - - - - -

                  chain

                  Transforms the value and context of a Result computation with an unary function. -As with .map(), the transformation is only applied if the value is an Ok, -but the transformation is expected a new Result value, which then becomes the -result of the method.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall a, b, c:
                  -  (Result a b).((b) => Result a c) => Result a c

                  Documentation

                  Transforms the value and context of a Result computation with an unary function. -As with .map(), the transformation is only applied if the value is an Ok, -but the transformation is expected a new Result value, which then becomes the -result of the method.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -const divideBy = (a) => (b) =>
                  -  a === 0        ?  Result.Error('division by zero')
                  -: /* otherwise */   Result.Ok(b / a);
                  -
                  -
                  -Result.Ok(4).chain(divideBy(2));
                  -// ==> Result.Ok(2)
                  -
                  -Result.Error(4).chain(divideBy(2));
                  -// ==> Result.Error(4)
                  -
                  -Result.Ok(4).chain(divideBy(0));
                  -// ==> Result.Error('division by zero')
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function chain(f) {
                  -      assertFunction('Result.Error#chain', f);
                  -      return this;
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function chain(f) {
                  -      assertFunction('Result.Ok#chain', f);
                  -      return f(this.value);
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.error.html b/docs/api/en/folktale.data.result.result.error.html deleted file mode 100644 index f71124b..0000000 --- a/docs/api/en/folktale.data.result.result.error.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Error - - - - - -

                  Error

                  Constructs a Result whose value represents a failure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Error(value)
                  forall a, b: (a) => Result a b

                  Documentation

                  Constructs a Result whose value represents a failure.

                  -

                  See the documentation for the Result structure to understand how to use this.

                  -

                  Static properties

                  Comparing and testing

                  hasInstance(value)

                  Tests if an arbitrary value is a Error case of a Result instance.

                  -
                  Experimental

                  Debugging

                  inspect: toString()

                  A textual representation of the Error variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the Error variant.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor for this variant.

                  -
                  Experimental
                  prototype

                  The container for instance methods for Error variants of the Result structure.

                  -
                  Experimental
                  get tag

                  The tag for this variant, unique among the Result variants.

                  -
                  Experimental
                  get type

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -
                  Experimental

                  Instance (prototype) properties

                  Comparing and testing

                  equals(value)

                  Performs a deep-comparison of two Result values for equality. See core/adt/derivations/equality for details.

                  -
                  Experimental
                  hasInstance(value)

                  Tests if an arbitrary value is a Result instance.

                  -
                  ExperimentalInherited
                  get isError

                  True if the value is a Error instance.

                  -
                  Deprecated

                  Constructing

                  of(value)

                  Constructs a Result holding an Ok value.

                  -
                  ExperimentalInherited

                  Converting to other types

                  toMaybe()

                  Transforms a Result into a Maybe. Error values are lost in the process.

                  -
                  ExperimentalInherited
                  toValidation()

                  Transforms a Result into a Validation.

                  -
                  ExperimentalInherited

                  Data fields

                  get value

                  The value contained in an Error instance of the Result structure.

                  -
                  Abstract

                  Debugging

                  inspect: toString()

                  A textual representation for Result instances.

                  -
                  Experimental
                  toString()

                  A textual representation for Result instances.

                  -
                  Experimental

                  Extracting values

                  get()

                  This method has been renamed to unsafeGet().

                  -
                  DeprecatedInherited
                  getOrElse()

                  Extracts the value of a Result structure, if it exists (i.e.: is an Ok), -otherwise returns the provided default value.

                  -
                  Experimental
                  merge()

                  Returns the value inside of the Result structure, regardless of its state.

                  -
                  ExperimentalInherited
                  unsafeGet()

                  Extracts the value from a Result structure.

                  -
                  Experimental

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/bimap(f, g)

                  Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

                  -
                  fantasy-land/chain(transformation)

                  Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

                  -
                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -
                  fantasy-land/map(transformation)

                  Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

                  -
                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Pattern matching

                  fold()

                  Applies a function to each case of a Result.

                  -
                  Experimental
                  matchWith(pattern)

                  Chooses and executes a function for each variant in the Result structure.

                  -
                  Experimental

                  Recovering from errors

                  orElse()

                  Allows recovering from Error values with a handler function.

                  -
                  Experimental
                  swap()

                  Inverts the context of a Result value such that Errors are transformed into Oks, -and Oks are transformed into Errors. Does not touch the value inside of the -Result.

                  -
                  Experimental

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aResult.toJSON() into a proper Result structure.

                  -
                  ExperimentalInherited
                  toJSON()

                  Converts a Result value to a JavaScript object that may be stored as a JSON value.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor for this variant.

                  -
                  variants

                  The variants in the Result structure.

                  -
                  ExperimentalInherited

                  Transforming

                  apply()

                  Applies the function contained in one Result to the value in another Result. -Application only occurs if both Results are Ok, otherwise keeps the first -Error.

                  -
                  Experimental
                  bimap()

                  Transforms each side of a Result with a function, without changing the context -of the computation. That is, Errors will still be Errors, Oks will still be -Oks.

                  -
                  Experimental
                  chain()

                  Transforms the value and context of a Result computation with an unary function. -As with .map(), the transformation is only applied if the value is an Ok, -but the transformation is expected a new Result value, which then becomes the -result of the method.

                  -
                  Experimental
                  map()

                  Transforms the value inside of a Result structure with an unary function without -changing the context of the computation. That is, Error values continue to be -Error values, and Ok values continue to be Ok values.

                  -
                  Experimental
                  mapError()

                  Transforms the value inside an Error without changing the context of the -computation.

                  -
                  Experimental

                  Variants

                  Error(value)

                  Constructs a Result whose value represents a failure.

                  -
                  ExperimentalInherited
                  Ok(value)

                  Constructs a Result whose value represents a success.

                  -
                  ExperimentalInherited

                  Source Code

                  Error(value) {
                  -    return { value };
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.fold.html b/docs/api/en/folktale.data.result.result.fold.html deleted file mode 100644 index fb3f1a6..0000000 --- a/docs/api/en/folktale.data.result.result.fold.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - fold - - - - - -

                  fold

                  Applies a function to each case of a Result.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall a, b, c:
                  -  (Result a b).((a) => c, (b) => c) => c

                  Documentation

                  Applies a function to each case of a Result.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -const inc = (x) => x + 1;
                  -const dec = (x) => x - 1;
                  -
                  -Result.Error(1).fold(inc, dec);
                  -// ==> inc(1)
                  -
                  -Result.Ok(1).fold(inc, dec);
                  -// ==> dec(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function fold(f, g) {
                  -      assertFunction('Result.Error#fold', f);
                  -      assertFunction('Result.Error#fold', g);
                  -      return f(this.value);
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function fold(f, g) {
                  -      assertFunction('Result.Ok#fold', f);
                  -      assertFunction('Result.Ok#fold', g);
                  -      return g(this.value);
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.get.html b/docs/api/en/folktale.data.result.result.get.html deleted file mode 100644 index 40fb0b7..0000000 --- a/docs/api/en/folktale.data.result.result.get.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - get - - - - - -

                  get

                  This method has been renamed to unsafeGet().

                  -
                  Deprecated since 2.0.0

                  We want to discourage the use of partial functions, and having short names -makes it easy for people to want to use them without thinking about the -problems.

                  -

                  For more details see https://github.com/origamitower/folktale/issues/42

                  -

                  Signature

                  get()
                  forall a, b: (Result a b).() => b :: (throws TypeError)

                  Documentation

                  This method has been renamed to unsafeGet().

                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 285, column 22
                  'get'() {
                  -    warnDeprecation('`.get()` is deprecated, and has been renamed to `.unsafeGet()`.');
                  -    return this.unsafeGet();
                  -  }
                  Stability
                  deprecated
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.getorelse.html b/docs/api/en/folktale.data.result.result.getorelse.html deleted file mode 100644 index 7cf3e34..0000000 --- a/docs/api/en/folktale.data.result.result.getorelse.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - getOrElse - - - - - -

                  getOrElse

                  Extracts the value of a Result structure, if it exists (i.e.: is an Ok), -otherwise returns the provided default value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall a, b: (Result a b).(b) => b

                  Documentation

                  Extracts the value of a Result structure, if it exists (i.e.: is an Ok), -otherwise returns the provided default value.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Ok(1).getOrElse(2);
                  -// ==> 1
                  -
                  -Result.Error(1).getOrElse(2);
                  -// ==> 2
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function getOrElse(_default) {
                  -      return _default;
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function getOrElse(_default) {
                  -      return this.value;
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.inspect.html b/docs/api/en/folktale.data.result.result.inspect.html deleted file mode 100644 index f2e5649..0000000 --- a/docs/api/en/folktale.data.result.result.inspect.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - toString - - - - - -

                  toString

                  A textual representation of the Ok variant.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toString()
                  () => String

                  Documentation

                  A textual representation of the Ok variant.

                  -

                  Properties

                  Source Code

                  () => variantName
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.map.html b/docs/api/en/folktale.data.result.result.map.html deleted file mode 100644 index 43b74be..0000000 --- a/docs/api/en/folktale.data.result.result.map.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - map - - - - - -

                  map

                  Transforms the value inside of a Result structure with an unary function without -changing the context of the computation. That is, Error values continue to be -Error values, and Ok values continue to be Ok values.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall a, b, c:
                  -  (Result a b).((b) => c) => Result a c

                  Documentation

                  Transforms the value inside of a Result structure with an unary function without -changing the context of the computation. That is, Error values continue to be -Error values, and Ok values continue to be Ok values.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -function increment(value) {
                  -  return value + 1;
                  -}
                  -
                  -Result.Ok(1).map(increment);
                  -// ==> Result.Ok(2)
                  -
                  -Result.Error(1).map(increment);
                  -// ==> Result.Error(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function map(f) {
                  -      assertFunction('Result.Error#map', f);
                  -      return this;
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function map(f) {
                  -      assertFunction('Result.Ok#map', f);
                  -      return Ok(f(this.value));
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.maperror.html b/docs/api/en/folktale.data.result.result.maperror.html deleted file mode 100644 index 111413e..0000000 --- a/docs/api/en/folktale.data.result.result.maperror.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - mapError - - - - - -

                  mapError

                  Transforms the value inside an Error without changing the context of the -computation.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall a, b, c:
                  -  (Result a b).((a) => c) => Result c b

                  Documentation

                  Transforms the value inside an Error without changing the context of the -computation.

                  -

                  This is similar to .map, except it operates on Errors instead of Oks.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Error(1).mapError(x => x + 1);
                  -// ==> Result.Error(2)
                  -
                  -Result.Ok(1).mapError(x => x + 1);
                  -// ==> Result.Ok(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function mapError(f) {
                  -      assertFunction('Result.Error#mapError', f);
                  -      return Error(f(this.value));
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function mapError(f) {
                  -      assertFunction('Result.Ok#mapError', f);
                  -      return this;
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.merge.html b/docs/api/en/folktale.data.result.result.merge.html deleted file mode 100644 index f462cec..0000000 --- a/docs/api/en/folktale.data.result.result.merge.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - merge - - - - - -

                  merge

                  Returns the value inside of the Result structure, regardless of its state.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  merge()
                  forall a, b: (Result a b).() => a or b

                  Documentation

                  Returns the value inside of the Result structure, regardless of its state.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Ok(1).merge();
                  -// ==> 1
                  -
                  -Result.Error(1).merge();
                  -// ==> 1
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 285, column 22
                  merge() {
                  -    return this.value;
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.of.html b/docs/api/en/folktale.data.result.result.of.html deleted file mode 100644 index 812add9..0000000 --- a/docs/api/en/folktale.data.result.result.of.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - of - - - - - -

                  of

                  Constructs a Result holding an Ok value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  of(value)
                  forall a, b: (b) => Result a b

                  Documentation

                  Constructs a Result holding an Ok value.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.of(1);
                  -// ==> Result.Ok(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 285, column 22
                  of(value) {
                  -    return Ok(value);
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.orelse.html b/docs/api/en/folktale.data.result.result.orelse.html deleted file mode 100644 index 5ed1747..0000000 --- a/docs/api/en/folktale.data.result.result.orelse.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - orElse - - - - - -

                  orElse

                  Allows recovering from Error values with a handler function.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall a, b, c:
                  -  (Result a b).((a) => Result c b) => Result c b

                  Documentation

                  Allows recovering from Error values with a handler function.

                  -

                  While .chain() allows one to sequence operations, such that the second -operation is ran only if the first one succeeds, the .orElse() method allows -one to recover from an Error by running a function that provides a new Result -value.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Ok(4).orElse(error => Result.Ok(error + 1));
                  -// ==> Result.Ok(4)
                  -
                  -Result.Error(4).orElse(error => Result.Ok(error + 1));
                  -// ==> Result.Ok(5)
                  -
                  -Result.Error(4).orElse(error => Result.Error(error - 1));
                  -// ==> Result.Error(3)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function orElse(handler) {
                  -      assertFunction('Result.Error#orElse', handler);
                  -      return handler(this.value);
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function orElse(handler) {
                  -      assertFunction('Result.Ok#orElse', handler);
                  -      return this;
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.swap.html b/docs/api/en/folktale.data.result.result.swap.html deleted file mode 100644 index c56e154..0000000 --- a/docs/api/en/folktale.data.result.result.swap.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - swap - - - - - -

                  swap

                  Inverts the context of a Result value such that Errors are transformed into Oks, -and Oks are transformed into Errors. Does not touch the value inside of the -Result.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall a, b: (Result a b).() => Result b a

                  Documentation

                  Inverts the context of a Result value such that Errors are transformed into Oks, -and Oks are transformed into Errors. Does not touch the value inside of the -Result.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Ok(1).swap();
                  -// ==> Result.Error(1)
                  -
                  -Result.Error(1).swap();
                  -// ==> Result.Ok(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function swap() {
                  -      return Ok(this.value);
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function swap() {
                  -      return Error(this.value);
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.tomaybe.html b/docs/api/en/folktale.data.result.result.tomaybe.html deleted file mode 100644 index 901d79d..0000000 --- a/docs/api/en/folktale.data.result.result.tomaybe.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - toMaybe - - - - - -

                  toMaybe

                  Transforms a Result into a Maybe. Error values are lost in the process.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toMaybe()
                  forall a, b: (Result a b).() => Maybe b

                  Documentation

                  Transforms a Result into a Maybe. Error values are lost in the process.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -const Maybe = require('folktale/data/maybe');
                  -
                  -Result.Ok(1).toMaybe();
                  -// ==> Maybe.Just(1)
                  -
                  -Result.Error(1).toMaybe();
                  -// ==> Maybe.Nothing()
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 285, column 22
                  toMaybe() {
                  -    return require('folktale/data/conversions/result-to-maybe')(this);
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.tovalidation.html b/docs/api/en/folktale.data.result.result.tovalidation.html deleted file mode 100644 index 0ecbdf5..0000000 --- a/docs/api/en/folktale.data.result.result.tovalidation.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - toValidation - - - - - -

                  toValidation

                  Transforms a Result into a Validation.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toValidation()
                  forall a, b: (Result a b).() => Validation a b

                  Documentation

                  Transforms a Result into a Validation.

                  -

                  Result's Oks are mapped into Validation's Successes, and Result's Errors -are mapped into Validation's Failures.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -const Validation = require('folktale/data/validation');
                  -
                  -Result.Ok(1).toValidation();
                  -// ==> Validation.Success(1)
                  -
                  -Result.Error(1).toValidation();
                  -// ==> Validation.Failure(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 285, column 22
                  toValidation() {
                  -    return require('folktale/data/conversions/result-to-validation')(this);
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.unsafeget.html b/docs/api/en/folktale.data.result.result.unsafeget.html deleted file mode 100644 index 592226f..0000000 --- a/docs/api/en/folktale.data.result.result.unsafeget.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - unsafeGet - - - - - -

                  unsafeGet

                  Extracts the value from a Result structure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  forall a, b: (Result a b).() => b :: throws TypeError

                  Documentation

                  Extracts the value from a Result structure.

                  -
                  -

                  WARNING
                  This method is partial, which means that it will only work for Ok -structures, not for Error structures. It's recommended to use .getOrElse() -or .matchWith() instead.

                  -
                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Ok(1).unsafeGet();
                  -// ==> 1
                  -
                  -
                  -try {
                  -  Result.Error(1).unsafeGet();
                  -  // TypeError: Can't extract the value of an Error
                  -} catch (e) {
                  -  e instanceof TypeError; // ==> true
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 75, column 19
                  {
                  -    /*~*/
                  -    Error: function unsafeGet() {
                  -      throw new TypeError(`Can't extract the value of an Error.
                  -
                  -Error does not contain a normal value - it contains an error.
                  -You might consider switching from Result#unsafeGet to Result#getOrElse,
                  -or some other method that is not partial.
                  -      `);
                  -    },
                  -
                  -    /*~*/
                  -    Ok: function unsafeGet() {
                  -      return this.value;
                  -    }
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.result.value.html b/docs/api/en/folktale.data.result.result.value.html deleted file mode 100644 index 2c5f70c..0000000 --- a/docs/api/en/folktale.data.result.result.value.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - value - - - - - -

                  value

                  The value contained in an Ok instance of the Result structure.

                  -

                  Signature

                  get value()
                  forall a, b: get (Result a b) => b

                  Documentation

                  The value contained in an Ok instance of the Result structure.

                  -

                  This is usually used to destructure the instance in a .matchWith call.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -
                  -Result.Ok(1).matchWith({
                  -  Error: ({ value }) => 'nothing',
                  -  Ok:    ({ value }) => value    // equivalent to (x) => x.value
                  -});
                  -// ==> 1
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/result.js at line 60, column 21
                  get value() {
                  -    throw new TypeError('`value` can’t be accessed in an abstract instance of Result.Ok');
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/result/result
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.result.try.try.html b/docs/api/en/folktale.data.result.try.try.html deleted file mode 100644 index 2d99942..0000000 --- a/docs/api/en/folktale.data.result.try.try.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - _try - - - - - -

                  _try

                  Runs a function that may raise an exception, trapping it. Returns an Ok with -the return value of the function, if it has finished successfully, or an Error -with the raised exception.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  _try(f)
                  forall a, b: (() => b :: throws a) => Result a b

                  Documentation

                  Runs a function that may raise an exception, trapping it. Returns an Ok with -the return value of the function, if it has finished successfully, or an Error -with the raised exception.

                  -

                  Example:

                  -
                  function successor(natural) {
                  -  if (natural < 0) {
                  -    throw `Not a natural number: ${natural}`;
                  -  } else {
                  -    return natural + 1;
                  -  }
                  -}
                  -
                  -const Result = require('folktale/data/result');
                  -
                  -Result.try(() => successor(-1));
                  -// ==> Result.Error('Not a natural number: -1')
                  -
                  -Result.try(() => successor(1));
                  -// ==> Result.Ok(2)
                  -

                  Properties

                  Source Code

                  Defined in src/data/result/try.js at line 20, column 0
                  (f) => {
                  -  try {
                  -    return Ok(f());
                  -  } catch (e) {
                  -    return Error(e);
                  -  }
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/result/try
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task-execution._taskexecution.html b/docs/api/en/folktale.data.task._task-execution._taskexecution.html deleted file mode 100644 index 91c1298..0000000 --- a/docs/api/en/folktale.data.task._task-execution._taskexecution.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - TaskExecution - - - - - -

                  TaskExecution

                  Represents the execution of a Task, with methods to cancel it, react to its -results, and retrieve its eventual value. TaskExecution objects aren't created -directly by users, but instead returned as a result from Task's run() method. -b

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  Represents the execution of a Task, with methods to cancel it, react to its -results, and retrieve its eventual value. TaskExecution objects aren't created -directly by users, but instead returned as a result from Task's run() method. -b

                  -

                  Static properties

                  Special values

                  prototype

                  The container for instance methods for the TaskExecution structure.

                  -
                  Experimental

                  Instance (prototype) properties

                  Cancelling tasks

                  cancel()

                  Cancels a task execution. Does nothing if the task has already been resolved.

                  -

                  Extracting eventual values

                  future()

                  Gets the eventual value of a Task as a Folktale Future.

                  -
                  promise()

                  Gets the eventual value of the task as a JavaScript's Promise.

                  -

                  Reacting to Task state transitions

                  listen()

                  Adds a functions to be called when the task settles for each possible state it can transition to.

                  -

                  Types

                  constructor()

                  Represents the execution of a Task, with methods to cancel it, react to its -results, and retrieve its eventual value. TaskExecution objects aren't created -directly by users, but instead returned as a result from Task's run() method. -b

                  -
                  Experimental

                  Source Code

                  Defined in src/data/task/_task-execution.js at line 11, column 0
                  class TaskExecution {
                  -  /*~*/
                  -  constructor(task, deferred) {
                  -    this._task = task;
                  -    this._deferred = deferred;
                  -  }
                  -
                  -  /*~*/
                  -  cancel() {
                  -    this._deferred.maybeCancel();
                  -    return this;
                  -  }
                  -
                  -  /*~*/
                  -  listen(pattern) {
                  -    this._deferred.listen(pattern);
                  -    return this;
                  -  }
                  -
                  -  /*~*/
                  -  promise() {
                  -    return this._deferred.promise();
                  -  }
                  -
                  -  /*~*/
                  -  future() {
                  -    return this._deferred.future();
                  -  }
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task-execution
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task._task.html b/docs/api/en/folktale.data.task._task._task.html deleted file mode 100644 index 7a57e79..0000000 --- a/docs/api/en/folktale.data.task._task._task.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - Task - - - - - -

                  Task

                  Tasks model asynchronous processes with automatic resource handling. They are generally constructed with the task function.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Task(computation, onCancel, cleanup)
                  forall value, reason, resources:
                  -  new (
                  -    ({ resolve: (value) => Void, reject: (reason) => Void, cancel: () => Void }) => resources,
                  -    (resources) => Void,
                  -    (resources) => Void
                  -  ) => Task value reason resources

                  Documentation

                  Tasks model asynchronous processes with automatic resource handling. They are generally constructed with the task function.

                  -

                  See the documentation for folktale/data/task for more details.

                  -

                  Static properties

                  Constructing

                  of(value)

                  Constructs a Task that resolves with a successful value.

                  -
                  Experimental
                  rejected(reason)

                  Constructs a Task that resolves with a rejected value.

                  -
                  Experimental

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Special values

                  prototype

                  The container for instance methods for the Task structure.

                  -
                  Experimental

                  Instance (prototype) properties

                  Combining tasks

                  and: value(that)

                  Constructs a new task that awaits both tasks to resolve. The result of the new task is a tuple containing the results of the left and right tasks, if they all succeed, or the first failure if they fail.

                  -
                  Experimental
                  or: value(that)

                  Combines two tasks such that the resulting task assimilates the result of the -first one to resolve.

                  -
                  Experimental

                  Executing tasks

                  run: value()

                  Executes a Task and returns a TaskExecution object representing the execution.

                  -
                  Experimental

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/bimap(f, g)

                  Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

                  -
                  fantasy-land/chain(transformation)

                  Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

                  -
                  fantasy-land/map(transformation)

                  Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

                  -

                  Pattern matching

                  willMatchWith: value(pattern)

                  Chooses and executes a function for each variant in a Task. The function must -return a new task, whose value and state will be assimilated.

                  -
                  Experimental

                  Recovering from errors

                  orElse: value(handler)

                  Transforms a failed task's value and state.

                  -
                  Experimental
                  swap: value()

                  Inverts the state of a Task. That is, turns successful tasks into failed ones, and failed tasks into successful ones.

                  -
                  Experimental

                  Transforming tasks

                  apply: value(task)

                  Applies the function in the left task to the value on the right task. The left -task is ran to completion before the right task is started.

                  -
                  Experimental
                  bimap: value(rejectionTransformation, successTransformation)

                  Transforms the rejected or resolved values of a Task with a function. The state of the task is not changed.

                  -
                  Experimental
                  chain: value(transformation)

                  Transforms the value and state of a Task.

                  -
                  Experimental
                  map: value(transformation)

                  Transforms the value of a successful task.

                  -
                  Experimental
                  mapRejected: value(transformation)

                  Transforms the value of a failed task.

                  -
                  Experimental

                  Types

                  constructor: Task(computation, onCancel, cleanup)

                  Tasks model asynchronous processes with automatic resource handling. They are generally constructed with the task function.

                  -
                  Experimental

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  class Task {
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall value, reason, resources:
                  -   *     new (
                  -   *       ({ resolve: (value) => Void, reject: (reason) => Void, cancel: () => Void }) => resources,
                  -   *       (resources) => Void,
                  -   *       (resources) => Void
                  -   *     ) => Task value reason resources
                  -   */
                  -  constructor(computation, onCancel, cleanup) {
                  -    this._computation = computation;
                  -    this._onCancel    = onCancel || noop;
                  -    this._cleanup     = cleanup  || noop;
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e, v1, v2, r:
                  -   *     (Task e v1 r).((v1) => Task e v2 r) => Task e v2 r
                  -   */
                  -  chain(transformation) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  resolver.reject,
                  -          onResolved:  value => {
                  -            transformation(value).run().listen({
                  -              onCancelled: resolver.cancel,
                  -              onRejected:  resolver.reject,
                  -              onResolved:  resolver.resolve
                  -            });
                  -          }
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e, v1, v2, r:
                  -   *     (Task e v1 r).((v1) => v2) => Task e v2 r
                  -   */
                  -  map(transformation) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  resolver.reject,
                  -          onResolved:  value => resolver.resolve(transformation(value))
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e1, e2, v, r:
                  -   *     (Task e1 v r).((e1) => e2) => Task e2 v r
                  -   */
                  -  mapRejected(transformation) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  reason => resolver.reject(transformation(reason)),
                  -          onResolved:  resolver.resolve
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e, v1, v2, r:
                  -   *     (Task e ((v1) => v2) r).(Task e v1 r) => Task e v2 r
                  -   */
                  -  apply(task) {
                  -    return this.chain(f => task.map(f));
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e1, e2, v1, v2, r:
                  -   *     (Task e1 v1 r).((e1) => e2, (v1) => v2) => Task e2 v2 r
                  -   */
                  -  bimap(rejectionTransformation, successTransformation) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  reason => resolver.reject(rejectionTransformation(reason)),
                  -          onResolved:  value => resolver.resolve(successTransformation(value))
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e1, e2, v1, v2, r:
                  -   *     type Pattern = { row |
                  -   *       Cancelled: ()  => Task e2 v2 r,
                  -   *       Resolved:  (b) => Task e2 v2 r,
                  -   *       Rejected:  (a) => Task e2 v2 r
                  -   *     }
                  -   *
                  -   *     (Task e1 v1 r).(Pattern) => Task e2 v2 r
                  -   */
                  -  willMatchWith(pattern) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        const resolve = (handler) => (value) => handler(value).run().listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  resolver.reject,
                  -          onResolved:  resolver.resolve
                  -        });
                  -        execution.listen({
                  -          onCancelled: resolve(_ => pattern.Cancelled()),
                  -          onRejected:  resolve(pattern.Rejected),
                  -          onResolved:  resolve(pattern.Resolved)
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e, v, r: (Task e v r).() => Task v e r
                  -   */
                  -  swap() {
                  -    return new Task(
                  -      resolver => {
                  -        let execution = this.run();   // eslint-disable-line prefer-const
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  resolver.resolve,
                  -          onResolved:  resolver.reject
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e, e2, v, r1, r2:
                  -   *     (Task e v r1).((e) => Task e2 v r2) => Task e2 v r2
                  -   */
                  -  orElse(handler) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onResolved:  resolver.resolve,
                  -          onRejected:  reason => {
                  -            handler(reason).run().listen({
                  -              onCancelled: resolver.cancel,
                  -              onRejected:  resolver.reject,
                  -              onResolved:  resolver.resolve
                  -            });
                  -          }
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  -
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e, v, r1, r2:
                  -   *     (Task e v r1).(Task e v r2) => Task e v (r1 and r2)
                  -   */
                  -  or(that) {
                  -    return new Task(
                  -      resolver => {
                  -        let thisExecution = this.run();   // eslint-disable-line prefer-const
                  -        let thatExecution = that.run();   // eslint-disable-line prefer-const
                  -        let done = false;
                  -
                  -        const guard = (fn, execution) => (value) => {
                  -          if (!done) {
                  -            done = true;
                  -            execution.cancel();
                  -            fn(value);
                  -          }
                  -        };
                  -
                  -        thisExecution.listen({
                  -          onRejected:  guard(resolver.reject, thatExecution),
                  -          onCancelled: guard(resolver.cancel, thatExecution),
                  -          onResolved:  guard(resolver.resolve, thatExecution)
                  -        });
                  -
                  -        thatExecution.listen({
                  -          onRejected:  guard(resolver.reject, thisExecution),
                  -          onCancelled: guard(resolver.cancel, thisExecution),
                  -          onResolved:  guard(resolver.resolve, thisExecution)
                  -        });
                  -
                  -        return [thisExecution, thatExecution];
                  -      },
                  -      ([thisExecution, thatExecution]) => {
                  -        thisExecution.cancel();
                  -        thatExecution.cancel();
                  -      }
                  -    );
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e, v1, v2, r1, r2:
                  -   *     (Task e v1 r1).(Task e v2 r2) => Task e (v1, v2) (r1 and r2)
                  -   */
                  -  and(that) {
                  -    return new Task(
                  -      resolver => {   // eslint-disable-line max-statements
                  -        let thisExecution = this.run();   // eslint-disable-line prefer-const
                  -        let thatExecution = that.run();   // eslint-disable-line prefer-const
                  -        let valueLeft = null;
                  -        let valueRight = null;
                  -        let doneLeft = false;
                  -        let doneRight = false;
                  -        let cancelled = false;
                  -
                  -        const guardResolve = (setter) => (value) => {
                  -          if (cancelled)  return;
                  -
                  -          setter(value);
                  -          if (doneLeft && doneRight) {
                  -            resolver.resolve([valueLeft, valueRight]);
                  -          }
                  -        };
                  -
                  -        const guardRejection = (fn, execution) => (value) => {
                  -          if (cancelled)  return;
                  -
                  -          cancelled = true;
                  -          execution.cancel();
                  -          fn(value);
                  -        };
                  -
                  -        thisExecution.listen({
                  -          onRejected:  guardRejection(resolver.reject, thatExecution),
                  -          onCancelled: guardRejection(resolver.cancel, thatExecution),
                  -          onResolved:  guardResolve(x => {
                  -            valueLeft = x;
                  -            doneLeft = true;
                  -          })
                  -        });
                  -
                  -        thatExecution.listen({
                  -          onRejected:  guardRejection(resolver.reject, thisExecution),
                  -          onCancelled: guardRejection(resolver.cancel, thisExecution),
                  -          onResolved:  guardResolve(x => {
                  -            valueRight = x;
                  -            doneRight = true;
                  -          })
                  -        });
                  -
                  -        return [thisExecution, thatExecution];
                  -      },
                  -      ([thisExecution, thatExecution]) => {
                  -        thisExecution.cancel();
                  -        thatExecution.cancel();
                  -      }
                  -    );
                  -  }
                  -
                  -  /*~
                  -   * stability: experimental
                  -   * type: |
                  -   *   forall e, v, r: (Task e v r).() => TaskExecution e v r
                  -   */
                  -  run() {
                  -    let deferred = new Deferred();    // eslint-disable-line prefer-const
                  -    deferred.listen({
                  -      onCancelled: _ => {
                  -        defer(_ => {
                  -          this._onCancel(resources);
                  -          this._cleanup(resources);
                  -        });
                  -      },
                  -
                  -      onResolved: _value => {
                  -        defer(_ => {
                  -          this._cleanup(resources);
                  -        });
                  -      },
                  -
                  -      onRejected: _reason => {
                  -        defer(_ => {
                  -          this._cleanup(resources);
                  -        });
                  -      }
                  -    });
                  -
                  -    const resources = this._computation({
                  -      reject:  error => { deferred.reject(error) },
                  -      resolve: value => { deferred.resolve(value) },
                  -      cancel:  _     => { deferred.maybeCancel() }
                  -    });
                  -
                  -    return new TaskExecution(this, deferred);
                  -  }
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.and.html b/docs/api/en/folktale.data.task._task.and.html deleted file mode 100644 index 66c93e4..0000000 --- a/docs/api/en/folktale.data.task._task.and.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - and - - - - - -

                  and

                  Constructs a new task that awaits both tasks to resolve. The result of the new task is a tuple containing the results of the left and right tasks, if they all succeed, or the first failure if they fail.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(that)
                  forall e, v1, v2, r1, r2:
                  -  (Task e v1 r1).(Task e v2 r2) => Task e (v1, v2) (r1 and r2)

                  Documentation

                  Constructs a new task that awaits both tasks to resolve. The result of the new task is a tuple containing the results of the left and right tasks, if they all succeed, or the first failure if they fail.

                  -

                  While the tasks are started from left-to-right, the method will not wait one task to finish before starting another. For asynchronous tasks this effectively gives you concurrent execution.

                  -

                  Note that cancelling one of the input tasks will cancel the combined tasks as well. Cancelling the combined tasks will cancell both input tasks. If any of the input tasks fail, the other input task will be cancelled as well.

                  -

                  If you need to combine more than two tasks concurrently, take a look at the waitAll function in the data/task module.

                  -

                  Example:

                  -
                  const { task } = require('folktale/data/task');
                  -
                  -const delay = (ms) => task(
                  -  resolver => setTimeout(() => resolver.resolve(ms), ms),
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer)
                  -  }
                  -);
                  -
                  -const result = await delay(30).and(delay(40)).run().promise();
                  -$ASSERT(result == [30, 40]);
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  and(that) {
                  -    return new Task(
                  -      resolver => {   // eslint-disable-line max-statements
                  -        let thisExecution = this.run();   // eslint-disable-line prefer-const
                  -        let thatExecution = that.run();   // eslint-disable-line prefer-const
                  -        let valueLeft = null;
                  -        let valueRight = null;
                  -        let doneLeft = false;
                  -        let doneRight = false;
                  -        let cancelled = false;
                  -
                  -        const guardResolve = (setter) => (value) => {
                  -          if (cancelled)  return;
                  -
                  -          setter(value);
                  -          if (doneLeft && doneRight) {
                  -            resolver.resolve([valueLeft, valueRight]);
                  -          }
                  -        };
                  -
                  -        const guardRejection = (fn, execution) => (value) => {
                  -          if (cancelled)  return;
                  -
                  -          cancelled = true;
                  -          execution.cancel();
                  -          fn(value);
                  -        };
                  -
                  -        thisExecution.listen({
                  -          onRejected:  guardRejection(resolver.reject, thatExecution),
                  -          onCancelled: guardRejection(resolver.cancel, thatExecution),
                  -          onResolved:  guardResolve(x => {
                  -            valueLeft = x;
                  -            doneLeft = true;
                  -          })
                  -        });
                  -
                  -        thatExecution.listen({
                  -          onRejected:  guardRejection(resolver.reject, thisExecution),
                  -          onCancelled: guardRejection(resolver.cancel, thisExecution),
                  -          onResolved:  guardResolve(x => {
                  -            valueRight = x;
                  -            doneRight = true;
                  -          })
                  -        });
                  -
                  -        return [thisExecution, thatExecution];
                  -      },
                  -      ([thisExecution, thatExecution]) => {
                  -        thisExecution.cancel();
                  -        thatExecution.cancel();
                  -      }
                  -    );
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.apply.html b/docs/api/en/folktale.data.task._task.apply.html deleted file mode 100644 index 4fee7d1..0000000 --- a/docs/api/en/folktale.data.task._task.apply.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - apply - - - - - -

                  apply

                  Applies the function in the left task to the value on the right task. The left -task is ran to completion before the right task is started.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(task)
                  forall e, v1, v2, r:
                  -  (Task e ((v1) => v2) r).(Task e v1 r) => Task e v2 r

                  Documentation

                  Applies the function in the left task to the value on the right task. The left -task is ran to completion before the right task is started.

                  -

                  Note that the right task isn't ran if the left task contains a failure.

                  -

                  If any of the tasks fail, the result will be that failure. Likewise, if any of -the tasks is cancelled, the result will be that cancellation.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/task');
                  -
                  -const result1 = await of(x => x + 1).apply(of(1)).run().promise();
                  -$ASSERT(result1 == 2);
                  -
                  -try {
                  -  const result2 = await of(x => x + 1).apply(rejected(1)).run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 1);
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  apply(task) {
                  -    return this.chain(f => task.map(f));
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.bimap.html b/docs/api/en/folktale.data.task._task.bimap.html deleted file mode 100644 index b358f19..0000000 --- a/docs/api/en/folktale.data.task._task.bimap.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - bimap - - - - - -

                  bimap

                  Transforms the rejected or resolved values of a Task with a function. The state of the task is not changed.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(rejectionTransformation, successTransformation)
                  forall e1, e2, v1, v2, r:
                  -  (Task e1 v1 r).((e1) => e2, (v1) => v2) => Task e2 v2 r

                  Documentation

                  Transforms the rejected or resolved values of a Task with a function. The state of the task is not changed.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/task');
                  -
                  -const result1 = await of(1).bimap(
                  -  (error) => error + 1,
                  -  (success) => success - 1
                  -).run().promise();
                  -$ASSERT(result1 == 0);
                  -
                  -try {
                  -  const result2 = await rejected(1).bimap(
                  -    (error) => error + 1,
                  -    (success) => success - 1
                  -  ).run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 2);
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  bimap(rejectionTransformation, successTransformation) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  reason => resolver.reject(rejectionTransformation(reason)),
                  -          onResolved:  value => resolver.resolve(successTransformation(value))
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.chain.html b/docs/api/en/folktale.data.task._task.chain.html deleted file mode 100644 index 50f889e..0000000 --- a/docs/api/en/folktale.data.task._task.chain.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - chain - - - - - -

                  chain

                  Transforms the value and state of a Task.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(transformation)
                  forall e, v1, v2, r:
                  -  (Task e v1 r).((v1) => Task e v2 r) => Task e v2 r

                  Documentation

                  Transforms the value and state of a Task.

                  -

                  As with .map() the transformation only happens if the original task resolves successfully, but instead of incorporating just the value, .chain() assimilates the value and state of the returned Task. This allows .chain() to be used for sequencing computations involving Task.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/task');
                  -
                  -const helloWorld = of('hello').chain(v => of(v + ' world'));
                  -const result1 = await helloWorld.run().promise();
                  -$ASSERT(result1 == 'hello world');
                  -
                  -const world = of('hello').chain(v => rejected('world'));
                  -try {
                  -  const result2 = await world.run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 'world');
                  -}
                  -
                  -const hello = rejected('hello').chain(v => of('world'));
                  -try {
                  -  const result3 = await hello.run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 'hello');
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  chain(transformation) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  resolver.reject,
                  -          onResolved:  value => {
                  -            transformation(value).run().listen({
                  -              onCancelled: resolver.cancel,
                  -              onRejected:  resolver.reject,
                  -              onResolved:  resolver.resolve
                  -            });
                  -          }
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.map.html b/docs/api/en/folktale.data.task._task.map.html deleted file mode 100644 index 353a8a4..0000000 --- a/docs/api/en/folktale.data.task._task.map.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - map - - - - - -

                  map

                  Transforms the value of a successful task.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(transformation)
                  forall e, v1, v2, r:
                  -  (Task e v1 r).((v1) => v2) => Task e v2 r

                  Documentation

                  Transforms the value of a successful task.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/task');
                  -
                  -const hello = of('hello').map(v => v.toUpperCase());
                  -const result1 = await hello.run().promise();
                  -$ASSERT(result1 == 'HELLO');
                  -
                  -const hello2 = rejected('hello').map(v => v.toUpperCase());
                  -try {
                  -  const result2 = await hello2.run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 'hello');
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  map(transformation) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  resolver.reject,
                  -          onResolved:  value => resolver.resolve(transformation(value))
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.maprejected.html b/docs/api/en/folktale.data.task._task.maprejected.html deleted file mode 100644 index c4e649c..0000000 --- a/docs/api/en/folktale.data.task._task.maprejected.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - mapRejected - - - - - -

                  mapRejected

                  Transforms the value of a failed task.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(transformation)
                  forall e1, e2, v, r:
                  -  (Task e1 v r).((e1) => e2) => Task e2 v r

                  Documentation

                  Transforms the value of a failed task.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/task');
                  -
                  -const hello = of('hello').mapRejected(v => v.toUpperCase());
                  -const result1 = await hello.run().promise();
                  -$ASSERT(result1 == 'hello');
                  -
                  -const hello2 = rejected('hello').mapRejected(v => v.toUpperCase());
                  -try {
                  -  const result2 = await hello2.run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 'HELLO');
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  mapRejected(transformation) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  reason => resolver.reject(transformation(reason)),
                  -          onResolved:  resolver.resolve
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.of.html b/docs/api/en/folktale.data.task._task.of.html deleted file mode 100644 index 173996e..0000000 --- a/docs/api/en/folktale.data.task._task.of.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - of - - - - - -

                  of

                  Constructs a Task that resolves with a successful value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  of(value)
                  forall e, v, r: (v) => Task e v r

                  Documentation

                  Constructs a Task that resolves with a successful value.

                  -

                  The value is computed eagerly. If you need the value to be computed only when the task is ran you'll have to use the task function.

                  -

                  Example:

                  -
                  const { of } = require('folktale/data/task');
                  -
                  -const result = await of('hello').run().promise();
                  -$ASSERT(result == 'hello');
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 359, column 20
                  of(value) {
                  -    return new Task(resolver => resolver.resolve(value));
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.or.html b/docs/api/en/folktale.data.task._task.or.html deleted file mode 100644 index 489a3ad..0000000 --- a/docs/api/en/folktale.data.task._task.or.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - or - - - - - -

                  or

                  Combines two tasks such that the resulting task assimilates the result of the -first one to resolve.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(that)
                  forall e, v, r1, r2:
                  -  (Task e v r1).(Task e v r2) => Task e v (r1 and r2)

                  Documentation

                  Combines two tasks such that the resulting task assimilates the result of the -first one to resolve.

                  -

                  Note that once a task finishes, the other task is cancelled. If the combined -task is cancelled, both tasks are also cancelled.

                  -

                  As a convenience for combining a large or unknown amount of tasks, the -waitAny() function in the data/task module preceives an array of Tasks to -"or" together.

                  -

                  Example:

                  -
                  const { task } = require('folktale/data/task');
                  -
                  -const delay = (ms) => task(
                  -  resolver => setTimeout(() => resolver.resolve(ms), ms),
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer)
                  -  }
                  -);
                  -
                  -const timeout = (ms) => task(
                  -  resolver => setTimeout(() => resolver.reject(ms), ms),
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer)
                  -  }
                  -);
                  -
                  -const result = await delay(20).or(timeout(300))
                  -                 .run().promise();
                  -$ASSERT(result == 20);
                  -
                  -const result2 = await delay(200).or(timeout(100))
                  -                  .run().promise().catch(e => `timeout ${e}`);
                  -$ASSERT(result2 == 'timeout 100');
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  or(that) {
                  -    return new Task(
                  -      resolver => {
                  -        let thisExecution = this.run();   // eslint-disable-line prefer-const
                  -        let thatExecution = that.run();   // eslint-disable-line prefer-const
                  -        let done = false;
                  -
                  -        const guard = (fn, execution) => (value) => {
                  -          if (!done) {
                  -            done = true;
                  -            execution.cancel();
                  -            fn(value);
                  -          }
                  -        };
                  -
                  -        thisExecution.listen({
                  -          onRejected:  guard(resolver.reject, thatExecution),
                  -          onCancelled: guard(resolver.cancel, thatExecution),
                  -          onResolved:  guard(resolver.resolve, thatExecution)
                  -        });
                  -
                  -        thatExecution.listen({
                  -          onRejected:  guard(resolver.reject, thisExecution),
                  -          onCancelled: guard(resolver.cancel, thisExecution),
                  -          onResolved:  guard(resolver.resolve, thisExecution)
                  -        });
                  -
                  -        return [thisExecution, thatExecution];
                  -      },
                  -      ([thisExecution, thatExecution]) => {
                  -        thisExecution.cancel();
                  -        thatExecution.cancel();
                  -      }
                  -    );
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.orelse.html b/docs/api/en/folktale.data.task._task.orelse.html deleted file mode 100644 index e802541..0000000 --- a/docs/api/en/folktale.data.task._task.orelse.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - orElse - - - - - -

                  orElse

                  Transforms a failed task's value and state.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(handler)
                  forall e, e2, v, r1, r2:
                  -  (Task e v r1).((e) => Task e2 v r2) => Task e2 v r2

                  Documentation

                  Transforms a failed task's value and state.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/task');
                  -
                  -const hello = of('hello').orElse(error => of('world'));
                  -const result1 = await hello.run().promise();
                  -$ASSERT(result1 == 'hello');
                  -
                  -const world = rejected('hello').orElse(error => of('world'));
                  -const result2 = await world.run().promise();
                  -$ASSERT(result2 == 'world');
                  -
                  -const helloWorld = rejected('hello').orElse(error => rejected(error + ' world'));
                  -try {
                  -  const result3 = await helloWorld.run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 'hello world');
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  orElse(handler) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onResolved:  resolver.resolve,
                  -          onRejected:  reason => {
                  -            handler(reason).run().listen({
                  -              onCancelled: resolver.cancel,
                  -              onRejected:  resolver.reject,
                  -              onResolved:  resolver.resolve
                  -            });
                  -          }
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.rejected.html b/docs/api/en/folktale.data.task._task.rejected.html deleted file mode 100644 index eac8be5..0000000 --- a/docs/api/en/folktale.data.task._task.rejected.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - rejected - - - - - -

                  rejected

                  Constructs a Task that resolves with a rejected value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  rejected(reason)
                  forall e, v, r: (e) => Task e v r

                  Documentation

                  Constructs a Task that resolves with a rejected value.

                  -

                  The value is computed eagerly. If you need the value to be computed only when the task is ran you'll have to use the task function.

                  -

                  Example:

                  -
                  const { rejected } = require('folktale/data/task');
                  -
                  -try {
                  -  const result = await rejected('hello').run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 'hello');
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 359, column 20
                  rejected(reason) {
                  -    return new Task(resolver => resolver.reject(reason));
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.run.html b/docs/api/en/folktale.data.task._task.run.html deleted file mode 100644 index 2e864f5..0000000 --- a/docs/api/en/folktale.data.task._task.run.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - run - - - - - -

                  run

                  Executes a Task and returns a TaskExecution object representing the execution.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value()
                  forall e, v, r: (Task e v r).() => TaskExecution e v r

                  Documentation

                  Executes a Task and returns a TaskExecution object representing the execution.

                  -

                  Example:

                  -
                  const { task } = require('folktale/data/task');
                  -
                  -let message = '';
                  -const sayHello = task(resolver => {
                  -  message = 'hello';
                  -  resolver.resolve();
                  -});
                  -
                  -$ASSERT(message == '');
                  -
                  -await sayHello.run().promise();
                  -
                  -$ASSERT(message == 'hello');
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  run() {
                  -    let deferred = new Deferred();    // eslint-disable-line prefer-const
                  -    deferred.listen({
                  -      onCancelled: _ => {
                  -        defer(_ => {
                  -          this._onCancel(resources);
                  -          this._cleanup(resources);
                  -        });
                  -      },
                  -
                  -      onResolved: _value => {
                  -        defer(_ => {
                  -          this._cleanup(resources);
                  -        });
                  -      },
                  -
                  -      onRejected: _reason => {
                  -        defer(_ => {
                  -          this._cleanup(resources);
                  -        });
                  -      }
                  -    });
                  -
                  -    const resources = this._computation({
                  -      reject:  error => { deferred.reject(error) },
                  -      resolve: value => { deferred.resolve(value) },
                  -      cancel:  _     => { deferred.maybeCancel() }
                  -    });
                  -
                  -    return new TaskExecution(this, deferred);
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.swap.html b/docs/api/en/folktale.data.task._task.swap.html deleted file mode 100644 index e65679e..0000000 --- a/docs/api/en/folktale.data.task._task.swap.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - swap - - - - - -

                  swap

                  Inverts the state of a Task. That is, turns successful tasks into failed ones, and failed tasks into successful ones.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value()
                  forall e, v, r: (Task e v r).() => Task v e r

                  Documentation

                  Inverts the state of a Task. That is, turns successful tasks into failed ones, and failed tasks into successful ones.

                  -

                  Example:

                  -
                  const { of, rejected } = require('folktale/data/task');
                  -
                  -try {
                  -  const result1 = await of(1).swap().run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 1);
                  -}
                  -
                  -const result2 = await rejected(1).swap().run().promise();
                  -$ASSERT(result2 == 1);
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  swap() {
                  -    return new Task(
                  -      resolver => {
                  -        let execution = this.run();   // eslint-disable-line prefer-const
                  -        execution.listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  resolver.resolve,
                  -          onResolved:  resolver.reject
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task._task.willmatchwith.html b/docs/api/en/folktale.data.task._task.willmatchwith.html deleted file mode 100644 index 296cd01..0000000 --- a/docs/api/en/folktale.data.task._task.willmatchwith.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - willMatchWith - - - - - -

                  willMatchWith

                  Chooses and executes a function for each variant in a Task. The function must -return a new task, whose value and state will be assimilated.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  value(pattern)
                  forall e1, e2, v1, v2, r:
                  -  type Pattern = { row |
                  -    Cancelled: ()  => Task e2 v2 r,
                  -    Resolved:  (b) => Task e2 v2 r,
                  -    Rejected:  (a) => Task e2 v2 r
                  -  }
                  -
                  -  (Task e1 v1 r).(Pattern) => Task e2 v2 r

                  Documentation

                  Chooses and executes a function for each variant in a Task. The function must -return a new task, whose value and state will be assimilated.

                  -

                  Example:

                  -
                  const { task, of, rejected } = require('folktale/data/task');
                  -
                  -const result1 = await of('hello').willMatchWith({
                  -  Cancelled: () => of('cancelled'),
                  -  Rejected: (error) => of(`rejected ${error}`),
                  -  Resolved: (value) => of(`resolved ${value}`)
                  -}).run().promise();
                  -$ASSERT(result1 == 'resolved hello');
                  -
                  -const result2 = await rejected('hello').willMatchWith({
                  -  Cancelled: () => of('cancelled'),
                  -  Rejected: (error) => of(`rejected ${error}`),
                  -  Resolved: (value) => of(`resolved ${value}`)
                  -}).run().promise();
                  -$ASSERT(result2 == 'rejected hello');
                  -
                  -const result3 = await task(r => r.cancel()).willMatchWith({
                  -  Cancelled: () => of('cancelled'),
                  -  Rejected: (error) => of(`rejected ${error}`),
                  -  Resolved: (value) => of(`resolved ${value}`)
                  -}).run().promise();
                  -$ASSERT(result3 == 'cancelled');
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/_task.js at line 20, column 0
                  willMatchWith(pattern) {
                  -    return new Task(
                  -      resolver => {
                  -        const execution = this.run();
                  -        const resolve = (handler) => (value) => handler(value).run().listen({
                  -          onCancelled: resolver.cancel,
                  -          onRejected:  resolver.reject,
                  -          onResolved:  resolver.resolve
                  -        });
                  -        execution.listen({
                  -          onCancelled: resolve(_ => pattern.Cancelled()),
                  -          onRejected:  resolve(pattern.Rejected),
                  -          onResolved:  resolve(pattern.Resolved)
                  -        });
                  -        return execution;
                  -      },
                  -      execution => execution.cancel()
                  -    );
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/_task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task.fromnodeback.html b/docs/api/en/folktale.data.task.fromnodeback.html deleted file mode 100644 index b5713ef..0000000 --- a/docs/api/en/folktale.data.task.fromnodeback.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - fromNodeback - - - - - -

                  fromNodeback

                  A convenience method for the folktale/data/conversions/nodeback-to-task module.

                  -

                  Signature

                  fromNodeback(aNodeback)
                  forall s, e, r:
                  -((Any..., (e, s) => Void) => Void)
                  -=> (Any...)
                  -=> Task e s r

                  Documentation

                  A convenience method for the folktale/data/conversions/nodeback-to-task module.

                  -

                  Example:

                  -
                  const Task = require('folktale/data/task');
                  -
                  -const fn = (str, str2, cb) => cb(null, str + str2 + 'processed');
                  -const convertedFn = Task.fromNodeback(fn);
                  -const task = convertedFn('test', '-was-');
                  -const value = await task.run().promise();
                  -
                  -$ASSERT(value === 'test-was-processed');
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/index.js at line 16, column 17
                  fromNodeback(aNodeback) {
                  -    return require('folktale/data/conversions/nodeback-to-task')(aNodeback);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task.html b/docs/api/en/folktale.data.task.html deleted file mode 100644 index f421dcf..0000000 --- a/docs/api/en/folktale.data.task.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - module folktale/data/task - - - - - -

                  module folktale/data/task

                  A data structure that models asynchronous actions, supporting safe cancellation and automatic resource handling.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Documentation

                  A data structure that models asynchronous actions, supporting safe cancellation and automatic resource handling.

                  -

                  Example:

                  -
                  const { task } = require('folktale/data/task');
                  -
                  -const delay = (ms) => task(
                  -  (resolver) => setTimeout(() => resolver.resolve(ms), ms),
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer)
                  -  }
                  -);
                  -
                  -// waits 100ms
                  -const result = await delay(100).or(delay(2000)).run().promise();
                  -$ASSERT(result == 100);
                  -

                  Why use Task?

                  -

                  Because JavaScript implementations are usually single-threaded, and there's no coroutine support, concurrent applications tend to use either callbacks (continuation-passing style) or Promise.

                  -

                  Callbacks aren't very composable. In order to combine callbacks, a user has to write code specific to each place that will use them. While you can make code written using callbacks maintainable, their low-level nature forces you to deal with a fair amount of detail that could be resolved by a library, including optimal concurrency:

                  -
                  const map = (list, fn, done) => {
                  -  let result = [];
                  -  let pending = list.length;
                  -  let resolved = false;
                  -
                  -  list.forEach((item, index) => {
                  -    fn(item, (error, value) => {
                  -      if (!resolved) {
                  -        if (error) {
                  -          resolved = true;
                  -          done(error, null);
                  -        } else {
                  -          pending -= 1;
                  -          result[index] = value;
                  -          if (pending === 0) {
                  -            done(null, result);
                  -          }
                  -        }
                  -      }
                  -    });
                  -  });
                  -};
                  -
                  -map([1, 2], (x, c) => c(null, x + 1), (e, v) => {
                  -  $ASSERT(e == null);
                  -  $ASSERT(v == []);
                  -});
                  -
                  -map([1, 2], (x, c) => c(x), (e, v) => {
                  -  $ASSERT(e == 1);
                  -  $ASSERT(v == null);
                  -});
                  -

                  Because functions using callbacks don't return a value to the caller, they're not composable. They are also, of course, not usable with JavaScript control-flow constructs either. So it's not possible to write something like:

                  -
                  if (someAsyncPredicate(...)) {
                  -  ...
                  -}
                  -

                  Instead of returning a value, someAsyncPredicate passes the result of its computation to another function (the callback). Because of this, there's no value for the if statement to work with.

                  -

                  Promises alleviate this a bit. Promises are first-class values, so regular synchronous functions may invoke functions yielding promises and get a value back. In some cases, that's not going to be the right value, but with async/await you get a lot of the compositionality back, as you can mix promises and regular synchronous constructs freely in special (async) functions.

                  -

                  Promises, however, do not support cancellations. Since they represent values, not computations, a Promise by itself has no concept of "what to cancel". It only waits for an external process to provide a value to it. In JavaScript, promises also suffer from not being able to nest. This is not a problem for most common cases, but it makes writing some data structures much less convenient and more error-prone.

                  -

                  Task, on the other hand, works at the computation level, so it knows which resources a computation has allocated to do the work, and can safely collect those resources automatically when the computation is cancelled. Very similar to how killing a thread or process allows you to clean things up. Because Tasks abstract computations, and not values, things that aren't possible with Promises, like running operations sequentially, is supported natively by the Task API.

                  -

                  Constructing tasks

                  -

                  The task function is how Tasks are generally created. It takes a computation (a function that will perform all of the work), and optionally an object defining handlers for how to clean up the resources allocated by the computation, and what to do if the task is cancelled.

                  -

                  A task that simply resolves after a certain amount of time would look like this:

                  -
                  const { task } = require('folktale/data/task');
                  -
                  -const delay = (time) => task(
                  -  (resolver) => {
                  -    return setTimeout(() => resolver.resolve(time), time);
                  -  },
                  -  {
                  -    cleanup(timerId) {
                  -      clearTimeout(timerId);
                  -    },
                  -    onCancelled(timerId) {
                  -      /* does nothing */
                  -    }
                  -  }
                  -);
                  -
                  -const result = await delay(100).run().promise();
                  -$ASSERT(result == 100);
                  -

                  Here the computation takes a resolver argument, which contains methods to change the state of the task execution. resolver.resolve(value) signals that the execution succeeded, and provides a return value for it. resolver.reject(reason) signals that the execution failed, and provides the reason of its failure. resolver.cancel() cancels the exection of the task.

                  -
                  -

                  NOTE
                  While .cancel() will cancel the execution of the Task, the processes started by the task computation will not be automatically stopped. The task computation must stop those itself, as we'll see later in the section about cancelling tasks.

                  -
                  -

                  The onCancelled and cleanup functions will receive any value returned by the task computation. Typically, the computation will allocate some resources, and return a handle to those resources such that cleanup and onCancelled may free those as they see fit. cleanup is always called once a Task finishes its execution, regardless of what state it ends up in (cancelled, rejected, or resolved). If not provided, Folktale just does nothing in response to those events.

                  -

                  Sometimes Task functions expect a Task as input or result value, but you already have the value that should be computed. While you can always resolve a Task synchronously, like so:

                  -
                  const one = task(resolver => resolver.resolve(1));
                  -

                  It's practical to use the of() and rejected() methods instead. The first creates a task that resolves successfuly with a value, whereas rejected() creates a task that resolves with a failure:

                  -
                  const { of, rejected } = require('folktale/data/task');
                  -
                  -const one_ = of(1);
                  -const two_ = rejected(2);
                  -

                  Running tasks

                  -

                  Creating a Task does not start any computation, it only provides a description for how to do something. In a sense, they are similar to a function definition. In order to execute the operations a Task defines, one must run it:

                  -
                  const { task } = require('folktale/data/task');
                  -
                  -const hello = task(resolver => resolver.resolve('hello'));
                  -
                  -const helloExecution = hello.run();
                  -

                  Running a Task with the .run() method returns a TaskExecution object. This object allows one to cancel the execution of the task, or query its eventual value either as JavaScript's Promise, or a Folktale's Future:

                  -
                  const value = await helloExecution.promise();
                  -$ASSERT(value === 'hello');
                  -
                  -helloExecution.future().map(value => {
                  -  $ASSERT(value === 'hello');
                  -});
                  -
                  -

                  NOTE
                  While Promises let you use JavaScript's async/await feature, it does not support nested promises, and cancellations are handled as rejections. Future is a simpler structure, which models all three states of a Task's eventual value, but does not support async/await.

                  -
                  -

                  TaskExecution also allows one to react to the result of running a task with the listen() method. This is useful for handling cancellations or rejections at the top level, where one doesn't need to combine the task with anything else:

                  -
                  helloExecution.listen({
                  -  onCancelled: () => 'task was cancelled',
                  -  onRejected:  (reason) => 'task was rejected',
                  -  onResolved:  (value) => $ASSERT(value == 'hello')
                  -});
                  -

                  Combining tasks concurrently

                  -

                  Task's primary goal is helping with concurrency, or the ordering of independent processes within an application. There are three primary categories of operations for this in Folktale:

                  -
                    -
                  • Sequencing: when process A depends on process B, and thus must only be executed after A is done.
                  • -
                  • Choosing non-deterministically: A and B are independent processes that provide a similar answer. The program chooses the first process that finishes.
                  • -
                  • Waiting related processes: A and B are independent processes, but C depends on both, and thus must only be executed after A and B are done.
                  • -
                  -

                  Sequencing tasks

                  -

                  One task models and independent process that eventually computes a value. Sometimes one task depends on the result of another task, and as thus may only run if that task resolves successfully. In order to sequence tasks we use the .chain() method:

                  -
                  const { task, of } = require('folktale/data/task');
                  -
                  -const concat = (a, b) => task(resolver => resolver.resolve(a + b));
                  -
                  -const taskA = of('hello');
                  -const taskB = of('world');
                  -
                  -const theTask = taskA.chain(x => taskB.chain(y => concat(x, y)));
                  -
                  -const result = await theTask.run().promise();
                  -$ASSERT(result == 'helloworld');
                  -

                  In this case, taskB only starts after taskA finishes executing successfully, and concat only starts after both taskA and taskB finish executing. It makes sense for concat to wait on both taskA and taskB, as it needs the two tasks to finish successfully before it can be executed, but there's no reason for taskA and taskB to wait for each other.

                  -

                  Choosing the first of N tasks

                  -

                  Suppose you send a request to a server, but if you don't get a response in a couple of seconds the program should just give up. This scenario can be modelled as two independent processes: a request to a server, and a timer that fires after a couple of seconds. The program should pick whichever process resolves first. With Folktale's Task, this is done with the .or() method.

                  -

                  The .or() method combines two tasks such that the resulting task assimilates the result of the first one to resolve:

                  -
                  const { task } = require('folktale/data/task');
                  -
                  -const delay = (ms) => task(
                  -  resolver => setTimeout(() => resolver.resolve(ms), ms),
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer)
                  -  }
                  -);
                  -
                  -const timeout = (ms) => task(
                  -  resolver => setTimeout(() => resolver.reject(ms), ms),
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer)
                  -  }
                  -);
                  -
                  -const result = await delay(20).or(timeout(300))
                  -                 .run().promise();
                  -$ASSERT(result == 20);
                  -
                  -const result2 = await delay(200).or(timeout(100))
                  -                  .run().promise().catch(e => `timeout ${e}`);
                  -$ASSERT(result2 == 'timeout 100');
                  -

                  As a convenience for combining a large or unknown amount of tasks, the waitAny() function receives an array of Tasks to "or" together:

                  -
                  const { waitAny } = require('folktale/data/task');
                  -
                  -const result3 = await waitAny([
                  -  delay(10),
                  -  delay(20),
                  -  delay(30)
                  -]).run().promise(); // equivalent to `delay(10).or(delay(20).or(delay(30)))`
                  -$ASSERT(result3 == 10);
                  -

                  Waiting many independent processes

                  -

                  If some computation depends on the results of more than one process you could use a nested sequence of .chain() calls to describe these dependencies, but that could be inefficient. If you don't care about the ordering of these processes, .chain() would impose an order on them. In essence, you wouldn't be getting any concurrency performance out of it.

                  -

                  Instead of sequencing unrelated tasks, you can combine them with the .and() operation. a.and(b) combines two tasks concurrently. That is, when you run this result, it'll start both a and b concurrently, and wait for their return without imposing any ordering on it. The result of the task will be a tuple containing the values of a and b:

                  -
                  const { task } = require('folktale/data/task');
                  -
                  -const delay = (ms) => task(
                  -  resolver => setTimeout(() => resolver.resolve(ms), ms),
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer)
                  -  }
                  -);
                  -
                  -// This takes 100ms
                  -const result = await delay(60).chain(x => delay(40).map(y => [x, y])).run().promise();
                  -$ASSERT(result == [60, 40]);
                  -
                  -// This takes 60ms
                  -const result2 = await delay(60).and(delay(40)).run().promise();
                  -$ASSERT(result == [60, 40]);
                  -

                  Because the tasks are started concurrently, and no ordering is imposed on them, the entire computation takes as long as the slowest of its processes. If you were to use .chain() to combine them, it would take the sum of all processes' times.

                  -

                  As a convenience for combining a large or unknown amount of tasks, the waitAll() function receives an array of Tasks to "and" together. waitAll() returns a normalised array of the results instead of nested tuples:

                  -
                  const { waitAll } = require('folktale/data/task');
                  -
                  -const result3 = await delay(10).and(delay(20).and(delay(30))).run().promise();
                  -$ASSERT(result3 == [10, [20, 30]]);
                  -
                  -const result4 = await waitAll([
                  -  delay(10),
                  -  delay(20),
                  -  delay(30)
                  -]).run().promise();
                  -$ASSERT(result4 == [10, 20, 30]);
                  -

                  Error handling

                  -

                  Sometimes processes will fail. You can recover from such failures using the .orElse() method. The method takes a function, passes to it the error value, if one happened, and expects it to return a new Task, whose state will be assimilated. In order to recover from the error you'd return a successful task, so computations that depend on it may proceed.

                  -

                  For example, this could be used to retry a particular computation:

                  -
                  const { task, of, rejected } = require('folktale/data/task');
                  -
                  -let errors = [];
                  -
                  -
                  -const result = await rejected('nope').orElse(reason => {
                  -  errors.push(reason);
                  -  return of('yay');
                  -}).run().promise();
                  -
                  -$ASSERT(result == 'yay');
                  -$ASSERT(errors == ['nope']);
                  -

                  .orElse() can also return rejected or cancelled tasks, and their state will be assimilated likewise:

                  -
                  errors = [];
                  -const retry = (task, times) => {
                  -  return task.orElse(reason => {
                  -    errors.push(reason);
                  -    if (times > 1) {
                  -      return retry(task, times - 1)
                  -    } else {
                  -      return rejected('I give up');
                  -    }
                  -  });
                  -};
                  -
                  -let runs = 0;
                  -const ohNoes = task(r => {
                  -  runs += 1;
                  -  r.reject('fail');
                  -});
                  -
                  -try {
                  -  const result2 = await retry(ohNoes, 3).run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(runs == 3);
                  -  $ASSERT(errors == ['fail', 'fail', 'fail']);
                  -  $ASSERT(error == 'I give up');
                  -}
                  -

                  Properties

                  Combining tasks

                  waitAll(tasks)

                  Constructs a new task that waits all given tasks resolve. The result of the new -task is an array with the results of the input tasks, if they all succeed, or -the first failure if they fail.

                  -
                  Experimental
                  waitAny(tasks)

                  Constructs a new task that waits any of the given tasks resolve. The result of -the first task to resolve is assimilated by the new task.

                  -
                  Experimental

                  Constructing

                  of(value)

                  Constructs a Task that resolves with a successful value.

                  -
                  Experimental
                  rejected(reason)

                  Constructs a Task that resolves with a rejected value.

                  -
                  Experimental
                  task(computation, handlers = { - onCancelled: noop, - cleanup: noop -})

                  Constructs a Task and associates a computation to it. The computation is executed every time the Task is ran, and should provide the result of the task: a success or failure along with its value.

                  -
                  Experimental

                  Converting from function with Node-style callback

                  fromNodeback(aNodeback)

                  A convenience method for the folktale/data/conversions/nodeback-to-task module.

                  -

                  Types

                  _Task: Task(computation, onCancel, cleanup)

                  Tasks model asynchronous processes with automatic resource handling. They are generally constructed with the task function.

                  -
                  Experimental
                  _TaskExecution()

                  Represents the execution of a Task, with methods to cancel it, react to its -results, and retrieve its eventual value. TaskExecution objects aren't created -directly by users, but instead returned as a result from Task's run() method. -b

                  -
                  Experimental

                  Source Code

                  Defined in src/data/task/index.js at line 16, column 0
                  {
                  -  of: Task.of,
                  -  rejected: Task.rejected,
                  -  task: require('./task'),
                  -  waitAny: require('./wait-any'),
                  -  waitAll: require('./wait-all'),
                  -  _Task: Task,
                  -  _TaskExecution: require('./_task-execution'),
                  -
                  -  /*~
                  -   * type: |
                  -   *    forall s, e, r:
                  -   *    ((Any..., (e, s) => Void) => Void)
                  -   *    => (Any...)
                  -   *    => Task e s r
                  -   */
                  -  fromNodeback(aNodeback) {
                  -    return require('folktale/data/conversions/nodeback-to-task')(aNodeback);
                  -  }
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task.task.task.html b/docs/api/en/folktale.data.task.task.task.html deleted file mode 100644 index c2fa364..0000000 --- a/docs/api/en/folktale.data.task.task.task.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - task - - - - - -

                  task

                  Constructs a Task and associates a computation to it. The computation is executed every time the Task is ran, and should provide the result of the task: a success or failure along with its value.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  task(computation, handlers = { - onCancelled: noop, - cleanup: noop -})
                  forall value, reason, resources:
                  -  (
                  -    ({ resolve: (value) => Void, reject: (reason) => Void, cancel: () => Void }) => resources,
                  -    {
                  -      onCancelled: (resources) => Void,
                  -      cleanup: (resources) => Void
                  -    }
                  -  ) => Task reason value resources

                  Documentation

                  Constructs a Task and associates a computation to it. The computation is executed every time the Task is ran, and should provide the result of the task: a success or failure along with its value.

                  -

                  A computation is required. For task, this is a function that receives one argument, the resolver, and does some work that may be asynchronous. Once done, the computation uses the resolver to resolve() a task succesfully, or reject() it with an error.

                  -

                  Asynchronous computations that allocate some external resource (for example, starting an HTTP request) can return a handler for those resources and define a cleanup function. The cleanup function will be called with the resources returned, and will have the chance of disposing of them properly once the Task is finished, either properly, as a success or rejection, or eagerly, as a cancellation.

                  -

                  Optionally, a Task may define an onCancelled function that will be called if the Task is cancelled, before the cleanup.

                  -

                  Example:

                  -
                  const { task } = require('folktale/data/task');
                  -

                  A simple, successful task:

                  -
                  const hello = task(resolver => resolver.resolve('hello'));
                  -
                  -const result1 = await hello.run().promise();
                  -$ASSERT(result1 == 'hello');
                  -

                  A simple, failed task:

                  -
                  const nope = task(resolver => resolver.reject('hello'));
                  -
                  -try {
                  -  await nope.run().promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(error == 'hello');
                  -}
                  -

                  An asynchronous task that allocates and frees resources:

                  -
                  const delay50 = task(
                  -  resolver => {
                  -    return setTimeout(() => resolver.resolve('yay'), 50);
                  -  },
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer)
                  -  }
                  -);
                  -
                  -const result2 = await delay50.run().promise();
                  -$ASSERT(result2 == 'yay');
                  -

                  A task with a cancellation handler:

                  -
                  let resolved = false;
                  -const cancelMe = task(
                  -  resolver => {
                  -    return setTimeout(() => {
                  -      resolved = true;
                  -      resolver.resolve('yay');
                  -    }, 50);
                  -  },
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer),
                  -    onCancelled: (timer) => {
                  -      'task was cancelled';
                  -    }
                  -  }
                  -);
                  -
                  -try {
                  -  const execution = cancelMe.run();
                  -  execution.cancel();
                  -  const result3 = await execution.promise();
                  -  throw 'never happens';
                  -} catch (error) {
                  -  $ASSERT(resolved == false);
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/task.js at line 26, column 0
                  (computation, handlers = { onCancelled: noop, cleanup: noop }) =>
                  -  new Task(computation, handlers.onCancelled, handlers.cleanup)
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/task
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task.wait-all.waitall.html b/docs/api/en/folktale.data.task.wait-all.waitall.html deleted file mode 100644 index e76f6cd..0000000 --- a/docs/api/en/folktale.data.task.wait-all.waitall.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - waitAll - - - - - -

                  waitAll

                  Constructs a new task that waits all given tasks resolve. The result of the new -task is an array with the results of the input tasks, if they all succeed, or -the first failure if they fail.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  waitAll(tasks)
                  forall v, e: ([Task e v Any]) => Task e [v] Any

                  Documentation

                  Constructs a new task that waits all given tasks resolve. The result of the new -task is an array with the results of the input tasks, if they all succeed, or -the first failure if they fail.

                  -

                  While the tasks are started in the order they appear in the array, the function -will not wait one task to finish before starting another. For asynchronous -tasks this effectively gives you concurrent execution.

                  -

                  Note that cancelling one of the input tasks will cancel the combined task as -well. Cancelling the combined task will cancel all of the input tasks. If any of -the input tasks fails, all of the other input tasks will be cancelled as well.

                  -

                  Example:

                  -
                  const { of, waitAll } = require('folktale/data/task');
                  -
                  -const result = await waitAll([
                  -  of(1),
                  -  of(2),
                  -  of(3)
                  -]).run().promise();
                  -
                  -$ASSERT(result == [1, 2, 3]);
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/wait-all.js at line 17, column 0
                  (tasks) => {
                  -  if (tasks.length === 0) {
                  -    throw new Error('Task.waitAll() requires a non-empty array of tasks.');
                  -  }
                  -
                  -  return tasks.reduce(
                  -    (a, b) => a.and(b).map(([xs, x]) => [...xs, x]),
                  -    of([])
                  -  );
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/wait-all
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.task.wait-any.waitany.html b/docs/api/en/folktale.data.task.wait-any.waitany.html deleted file mode 100644 index 7d045e6..0000000 --- a/docs/api/en/folktale.data.task.wait-any.waitany.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - waitAny - - - - - -

                  waitAny

                  Constructs a new task that waits any of the given tasks resolve. The result of -the first task to resolve is assimilated by the new task.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  waitAny(tasks)
                  forall v, e: ([Task e v Any]) => Task e v Any

                  Documentation

                  Constructs a new task that waits any of the given tasks resolve. The result of -the first task to resolve is assimilated by the new task.

                  -

                  While the tasks are started in the order they appear in the array, the function -will not wait one task to finish before starting another. For asynchronous -tasks this effectively gives you concurrent execution.

                  -

                  Note that cancelling the combined task will cancel all of the input tasks, and -any of the input tasks resolving will also cancel all of the other input tasks.

                  -

                  Example:

                  -
                  const { task, waitAny } = require('folktale/data/task');
                  -
                  -const delay = (ms) => task(
                  -  resolver => setTimeout(() => resolver.resolve(ms), ms),
                  -  {
                  -    cleanup: (timer) => clearTimeout(timer)
                  -  }
                  -);
                  -
                  -const result = await waitAny([
                  -  delay(60),  // cancelled after 30ms
                  -  delay(30)
                  -]).run().promise();
                  -
                  -$ASSERT(result == 30);
                  -

                  Properties

                  Source Code

                  Defined in src/data/task/wait-any.js at line 16, column 0
                  (tasks) => {
                  -  if (tasks.length === 0) {
                  -    throw new Error('Task.waitAny() requires a non-empty array of tasks.');
                  -  }
                  -
                  -  return tasks.reduce((a, b) => a.or(b));
                  -}
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/task/wait-any
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.collect.collect.html b/docs/api/en/folktale.data.validation.collect.collect.html deleted file mode 100644 index c364071..0000000 --- a/docs/api/en/folktale.data.validation.collect.collect.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - collect - - - - - -

                  collect

                  Combines all validation values from an array of them.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  collect(validations)
                  forall a, b: (Array (Validation a b)) => Validation a b
                  -where a is Semigroup

                  Documentation

                  Combines all validation values from an array of them.

                  -

                  The function is a convenient way of concatening validations one by one, and will concatenate failures together, but will only maintain the last successful value if they are all successful.

                  -

                  Example:

                  -
                  const { Success, Failure, collect } = require('folktale/data/validation');
                  -
                  -collect([
                  -  Success('a'),
                  -  Success('b'),
                  -  Success('c')
                  -]);
                  -// ==> Success('c')
                  -
                  -collect([
                  -  Failure('a'),
                  -  Success('b'),
                  -  Failure('c')
                  -]);
                  -// ==> Failure('ac')
                  -
                  -collect([
                  -  Failure('a'),
                  -  Failure('b'),
                  -  Failure('c')
                  -]);
                  -// ==> Failure('abc')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/collect.js at line 20, column 0
                  (validations) =>
                  -  validations.reduce((a, b) => a.concat(b), Success())
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/validation/collect
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.frommaybe.html b/docs/api/en/folktale.data.validation.frommaybe.html deleted file mode 100644 index 4264bed..0000000 --- a/docs/api/en/folktale.data.validation.frommaybe.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - fromMaybe - - - - - -

                  fromMaybe

                  A convenience method for the folktale/data/conversions/maybe-to-validation module.

                  -

                  Signature

                  fromMaybe(aMaybe, fallbackValue)
                  forall a, b: (Maybe b, a) => Validation a b

                  Documentation

                  A convenience method for the folktale/data/conversions/maybe-to-validation module.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -const Maybe = require('folktale/data/maybe');
                  -
                  -Validation.fromMaybe(Maybe.Just(1), 'error');
                  -// ==> Validation.Success(1)
                  -
                  -Validation.fromMaybe(Maybe.Nothing(), 'error');
                  -// ==> Validation.Failure('error')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/index.js at line 18, column 17
                  fromMaybe(aMaybe, fallbackValue) {
                  -    return require('folktale/data/conversions/maybe-to-validation')(aMaybe, fallbackValue);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.fromnullable.html b/docs/api/en/folktale.data.validation.fromnullable.html deleted file mode 100644 index b0bed14..0000000 --- a/docs/api/en/folktale.data.validation.fromnullable.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - fromNullable - - - - - -

                  fromNullable

                  A convenience method for the folktale/data/conversions/nullable-to-validation module.

                  -

                  Signature

                  fromNullable(aNullable, fallbackValue)
                  forall a, b: (a or None, b) => Validation b a

                  Documentation

                  A convenience method for the folktale/data/conversions/nullable-to-validation module.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -
                  -Validation.fromNullable(1, 'error');
                  -// ==> Validation.Success(1)
                  -
                  -Validation.fromNullable(null, 'error');
                  -// ==> Validation.Failure('error')
                  -
                  -Validation.fromNullable(undefined, 'error');
                  -// ==> Validation.Failure('error')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/index.js at line 18, column 17
                  fromNullable(aNullable, fallbackValue) {
                  -    return require('folktale/data/conversions/nullable-to-validation')(aNullable, fallbackValue);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.fromresult.html b/docs/api/en/folktale.data.validation.fromresult.html deleted file mode 100644 index 1d69fca..0000000 --- a/docs/api/en/folktale.data.validation.fromresult.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - fromResult - - - - - -

                  fromResult

                  A convenience method for the folktale/data/conversions/result-to-validation module.

                  -

                  Signature

                  fromResult(aResult)
                  forall a, b: (Result a b) => Validation a b

                  Documentation

                  A convenience method for the folktale/data/conversions/result-to-validation module.

                  -

                  Example:

                  -
                  const Result = require('folktale/data/result');
                  -const Validation = require('folktale/data/validation');
                  -
                  -Validation.fromResult(Result.Ok(1));
                  -// ==> Validation.Success(1)
                  -
                  -Validation.fromResult(Result.Error('error'));
                  -// ==> Validation.Failure('error')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/index.js at line 18, column 17
                  fromResult(aResult) {
                  -    return require('folktale/data/conversions/result-to-validation')(aResult);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.html b/docs/api/en/folktale.data.validation.html deleted file mode 100644 index 1f4f6dc..0000000 --- a/docs/api/en/folktale.data.validation.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - module folktale/data/validation - - - - - -

                  module folktale/data/validation

                  A data structure that typically models form validations, and other scenarios where -you want to aggregate all failures, rather than short-circuit if an error -happens (for which Result is better suited).

                  -

                  Documentation

                  A data structure that typically models form validations, and other scenarios where -you want to aggregate all failures, rather than short-circuit if an error -happens (for which Result is better suited).

                  -

                  A Validation may either be a Success(value), which contains a successful value, -or a Failure(value), which contains an error.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -const { Success, Failure } = Validation;
                  -
                  -const isPasswordLongEnough = (password) =>
                  -  password.length > 6 ?   Success(password)
                  -: /* otherwise */         Failure(['Password must have more than 6 characters.']);
                  -
                  -const isPasswordStrongEnough = (password) =>
                  -  /[\W]/.test(password) ?  Success(password)
                  -: /* otherwise */          Failure(['Password must contain a special character.']);
                  -
                  -const isPasswordValid = (password) =>
                  -  Success().concat(isPasswordLongEnough(password))
                  -           .concat(isPasswordStrongEnough(password))
                  -           .map(_ => password);
                  -
                  -isPasswordValid('foo');
                  -// ==> Failure(['Password must have more than 6 characters.', 'Password must contain a special character.'])
                  -
                  -isPasswordValid('rosesarered');
                  -// ==> Failure(['Password must contain a special character.'])
                  -
                  -isPasswordValid('rosesarered$andstuff')
                  -// ==> Success('rosesarered$andstuff')
                  -

                  Why use Validation?

                  -

                  Things like form and schema validation are pretty common in programming, but we end up either using branching or designing very specific solutions for each case.

                  -

                  With branching, things get quickly out of hand, because it's difficult to abstract over it, and it's thus difficult to understand the resulting program:

                  -
                  function validateForm(data) {
                  -  const errors = [];
                  -
                  -  if (!data.name.trim()) {
                  -    errors.push('Name is required');
                  -  }
                  -  if (data.password.length < 6) {
                  -    errors.push('Password must have at least 6 characters');
                  -  }
                  -  if (!/\W/.test(data.password)) {
                  -    errors.push('Password must contain a special character');
                  -  }
                  -
                  -  return errors;
                  -}
                  -
                  -validateForm({
                  -  name: '',
                  -  password: 'roses$are$red'
                  -});
                  -// ==> ['Name is required']
                  -
                  -validateForm({
                  -  name: 'Alissa',
                  -  password: 'alis'
                  -});
                  -// ==> ['Password must have at least 6 characters', 'Password must contain a special character']
                  -
                  -
                  -validateForm({
                  -  name: 'Alissa',
                  -  password: 'roses$are$red'
                  -});
                  -// ==> []
                  -

                  Because this function uses if conditions and modifies a local variable it's not very modular. This means it's not possible to split these checks in smaller pieces that can be entirely understood by themselves — they modify something, and so you have to understand how they modify that thing, in which context, etc. For very simple things it's not too bad, but as complexity grows it becomes unmanageable.

                  -

                  You can manage this complexity by designing a special function for verifying if an object passes some tests. This is common in validation libraries (like jquery-validation) and schema libraries (like jsonschema), but they're ultimately incompatible with other validation routines, and uncomposable:

                  -
                  const validators = {
                  -  notEmpty(object, { property }) {
                  -    return !object[property].trim() ?  [`${property} can't be empty`]
                  -    :      /* else */                  [];
                  -  },
                  -
                  -  minLength(object, { property, min }) {
                  -    const value = object[property];
                  -    return value.length < min ?  [`${property} must have at least ${min} characters`]
                  -    :      /* else */            [];
                  -  },
                  -
                  -  regexp(object, { property, regexp, message }) {
                  -    return !regexp.test(object[property]) ?  [message]
                  -    :      /* else */                       [];
                  -  }
                  -};
                  -
                  -const validate = (rules) => (object) =>
                  -  rules.reduce((result, rule) => 
                  -    [...result, ...validators[rule.rule](object, rule)], 
                  -    []
                  -  );
                  -
                  -function validateForm2(data) {
                  -  return validate([
                  -    {
                  -      rule: 'notEmpty',
                  -      property: 'name'
                  -    },
                  -    {
                  -      rule: 'minLength',
                  -      property: 'password',
                  -      min: 6
                  -    },
                  -    {
                  -      rule: 'regexp',
                  -      property: 'password',
                  -      regexp: /\W/,
                  -      message: 'password must contain a special character'
                  -    }
                  -  ])(data);
                  -}
                  -
                  -validateForm2({
                  -  name: '',
                  -  password: 'roses$are$red'
                  -});
                  -// ==> ['name can\'t be empty']
                  -
                  -validateForm2({
                  -  name: 'Alissa',
                  -  password: 'alis'
                  -});
                  -// ==> ['password must have at least 6 characters', 'password must contain a special character']
                  -
                  -validateForm2({
                  -  name: 'Alissa',
                  -  password: 'roses$are$red'
                  -});
                  -// ==> []
                  -

                  Now, while you can understand validations on their own, and share validations between different methods (if they fit the specific use case of the validation library), it's hard to extend it to support new validations (as you can't reuse existing validations), and it's hard to compose validations, because the library defines its own little language for that.

                  -

                  Neither of those are very compelling. The Validation structure gives you a tool for basing validation libraries and functions on in a way that's reusable and composable:

                  -
                  const Validation = require('folktale/data/validation');
                  -const { Success, Failure } = Validation;
                  -
                  -const notEmpty = (field, value) =>
                  -  value.trim() ?   Success(field)
                  -: /* else */       Failure([`${field} can't be empty`]);
                  -
                  -const minLength = (field, min, value) =>
                  -  value.length > min ?   Success(value)
                  -: /* otherwise */        Failure([`${field} must have at least ${min} characters`]);
                  -
                  -const matches = (field, regexp, value, message = '') =>
                  -  regexp.test(value) ?  Success(value)
                  -: /* otherwise */       Failure([message || `${field} must match ${regexp}`]);
                  -
                  -const isPasswordValid = (password) =>
                  -  Success().concat(minLength('password', 6, password))
                  -           .concat(matches('password', /\W/, password, 'password must contain a special character'))
                  -           .map(_ => password);
                  -
                  -const isNameValid = (name) =>
                  -  notEmpty('name', name);
                  -
                  -const validateForm3 = (data) =>
                  -  Success().concat(isPasswordValid(data.password))
                  -           .concat(isNameValid(data.name))
                  -           .map(_ => data);
                  -
                  -validateForm3({
                  -  name: '',
                  -  password: 'roses$are$red'
                  -});
                  -// ==> Failure(['name can\'t be empty'])
                  -
                  -validateForm3({
                  -  name: 'Alissa',
                  -  password: 'alis'
                  -});
                  -// ==> Failure(['password must have at least 6 characters', 'password must contain a special character'])
                  -
                  -
                  -validateForm3({
                  -  name: 'Alissa',
                  -  password: 'roses$are$red'
                  -});
                  -// ==> Success({ name: 'Alissa', password: 'roses$are$red' })
                  -

                  Working with Validation values

                  -

                  A validation m ay be one of the following cases:

                  -
                    -
                  • Success(value) — represents a successful value (e.g.: the result of passing a validator);
                  • -
                  • Failure(value) — represents an unsuccessful value (e.g.: the result of failing a validation rule);
                  • -
                  -

                  Validation functions just return one of these two cases instead of throwing errors or mutating other variables. Working with Validation values typically falls into one of the following categories:

                  -
                    -
                  • Combining validations: Sometimes we want to create more complex validation rules that reuse simpler ones. These functions let us take the result of those rules and put them together into a single Validation value.

                    -
                  • -
                  • Transforming values: Sometimes we get a Validation value that isn't quite what we're looking for. We don't really want to change anything about the status of the validation (whether it passed or failed), but we'd like to tweak the value a little bit. This is the equivalent of applying functions in an expression.

                    -
                  • -
                  • Reacting to results: Once we have a Validation value, we must be able to run pieces of code depending on whether the validation succeeded or failed, with access to the failure reason in the later case.

                    -
                  • -
                  -

                  We'll see each of these categories in more details below.

                  -

                  Combining validations

                  -

                  Combining validations is the most common thing to do with the Validation structure once you have some more complex validations in place. There are a few options that may be more or less convenient for you.

                  -

                  The simplest way of combining validations is through the .concat method. When concatenating validations, failures are themselves concatenated, but concatenating two successes just yields the latter one:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Failure('a').concat(Failure('b'));
                  -// ==> Failure('ab')
                  -
                  -Failure('a').concat(Success('b'));
                  -// ==> Failure('a')
                  -
                  -Success('a').concat(Success('b'));
                  -// ==> Success('b')
                  -

                  If you have a constructor for a data structure that can be curried, it's often more convenient to use the .apply method instead:

                  -
                  const curry = require('folktale/core/lambda/curry');
                  -
                  -const Language = (name, compiler) => ({ name, compiler });
                  -
                  -Success(curry(2, Language))
                  -  .apply(Success('Rust'))
                  -  .apply(Success('rustc'));
                  -// ==> Success({ name: 'Rust', compiler: 'rustc' })
                  -

                  Finally, if you have an array of validations, it's convenient to use the module-level collect function:

                  -
                  const { collect } = require('folktale/data/validation');
                  -
                  -collect([Failure('a'), Failure('b'), Success('c')]);
                  -// ==> Failure('ab')
                  -

                  collect uses .concat internally, so you end up with the last success if all validations succeed:

                  -
                  collect([Success('a'), Success('b')]);
                  -// ==> Success('b')
                  -

                  Transforming values

                  -

                  It's usually more convenient to use .apply when possible to get transformed values in one go, but sometimes you want to discard some of the values, or you may not know how many values you're getting in the validation. Sometimes you don't even want any of the success values in your resulting structure. For all of these cases, .apply makes less sense, and you have to transform the result after combining the validations. That's what .map is for:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success(1).map(x => x + 1);
                  -// ==> Success(2)
                  -
                  -Failure('a').map(x => x + 1);
                  -// ==> Failure('a')
                  -
                  -Success(1).concat(Success(2)).map(_ => 'hello');
                  -// ==> Success('hello')
                  -

                  It's also possible to transform the failure values through the .mapFailure function:

                  -
                  Failure('a').mapFailure(x => x.toUpperCase());
                  -// ==> Failure('A')
                  -
                  -Success('a').mapFailure(x => x.toUpperCase());
                  -// ==> Success('a')
                  -

                  Reacting to results

                  -

                  Once you've combined all of the validations, you usually want to see if the overall validation succeeded or failed, and then take the appropriate path in your code for each case. The .matchWith function helps with this. .matchWith is a function provided for every union structure in Foltkale, and it lets you select a piece of code to run based on how the value you're interacting with is tagged. In the case of Validations, it lets you select a piece of code for failures, and a piece of code for successes:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success(1).matchWith({
                  -  Success: ({ value }) => `Success: ${value}`,
                  -  Failure: ({ value }) => `Failure: ${value}`
                  -});
                  -// ==> 'Success: 1'
                  -
                  -Failure(1).matchWith({
                  -  Success: ({ value }) => `Success: ${value}`,
                  -  Failure: ({ value }) => `Failure: ${value}`
                  -});
                  -// ==> 'Failure: 1'
                  -

                  How does Validation compare to Result?

                  -

                  Result and Validation are pretty close structures. They both try to represent -whether a particular thing has failed or succeeded, and even their vocabulary is -very similar (Error vs. Failure, Ok vs. Success). The major difference -is in some of their methods.

                  -

                  A Result is a data structure that implements the Monad interface (.chain). -This makes Result a pretty good structure to model a sequence of computations -that may fail, where a computation may only run if the previous computation -succeeded. In this sense, a Result's .chain method is very similar to -JavaScript's ; at the end of statements: the statement at the right of the -semicolon only runs if the statement at the left did not throw an error.

                  -

                  A Validation is a data structure that implements the Applicative interface -(.apply), and does so in a way that if a failure is applied to another -failure, then it results in a new validation that contains the failures of both -validations. In other words, Validation is a data structure made for errors that -can be aggregated, and it makes sense in the contexts of things like form -validations, where you want to display to the user all of the fields that failed -the validation rather than just stopping at the first failure.

                  -

                  Validations can't be as easily used for sequencing operations because the -.apply method takes two validations, so the operations that create them must -have been executed already. While it is possible to use Validations in a -sequential manner, it's better to leave the job to Result, a data structure made -for that.

                  -

                  Properties

                  Combining validations

                  collect(validations)

                  Combines all validation values from an array of them.

                  -
                  Experimental

                  Comparing and testing

                  hasInstance(value)

                  Tests if an arbitrary value is a Validation instance.

                  -
                  Experimental

                  Constructing

                  of(value)

                  Constructs a Validation holding a Success value.

                  -

                  Converting from other types

                  fromMaybe(aMaybe, fallbackValue)

                  A convenience method for the folktale/data/conversions/maybe-to-validation module.

                  -
                  fromNullable(aNullable, fallbackValue)

                  A convenience method for the folktale/data/conversions/nullable-to-validation module.

                  -
                  fromResult(aResult)

                  A convenience method for the folktale/data/conversions/result-to-validation module.

                  -

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

                  -
                  Experimental

                  Variants

                  Failure(value)

                  Constructs a Validation whose value represents a failure.

                  -
                  Experimental
                  Success(value)

                  Constructs a Validation whose value represents a success.

                  -
                  Experimental

                  Source Code

                  Defined in src/data/validation/index.js at line 18, column 0
                  {
                  -  Success: Validation.Success,
                  -  Failure: Validation.Failure,
                  -  hasInstance: Validation.hasInstance,
                  -  of: Validation.of,
                  -  fromJSON: Validation.fromJSON,
                  -  [typeSymbol]: Validation[typeSymbol],
                  -  collect: require('./collect'),
                  -
                  -  /*~
                  -   * type: |
                  -   *   forall a, b: (a or None, b) => Validation b a
                  -   */
                  -  fromNullable(aNullable, fallbackValue) {
                  -    return require('folktale/data/conversions/nullable-to-validation')(aNullable, fallbackValue);
                  -  },
                  -
                  -  /*~
                  -   * type: |
                  -   *   forall a, b: (Result a b) => Validation a b
                  -   */
                  -  fromResult(aResult) {
                  -    return require('folktale/data/conversions/result-to-validation')(aResult);
                  -  },
                  -
                  -  /*~
                  -   * type: |
                  -   *   forall a, b: (Maybe b, a) => Validation a b
                  -   */
                  -  fromMaybe(aMaybe, fallbackValue) {
                  -    return require('folktale/data/conversions/maybe-to-validation')(aMaybe, fallbackValue);
                  -  }
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale/data/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.1.html b/docs/api/en/folktale.data.validation.validation.1.html deleted file mode 100644 index 335f870..0000000 --- a/docs/api/en/folktale.data.validation.validation.1.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - Success - - - - - -

                  Success

                  Constructs a Validation whose value represents a success.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Success(value)
                  forall a, b: (b) => Validation a b

                  Documentation

                  Constructs a Validation whose value represents a success.

                  -

                  See the documentation for the Validation structure to understand how to use this.

                  -

                  Static properties

                  Comparing and testing

                  hasInstance(value)

                  Tests if an arbitrary value is a Success case of a Validation instance.

                  -
                  Experimental

                  Debugging

                  inspect: toString()

                  A textual representation of the Success variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the Success variant.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor for this variant.

                  -
                  Experimental
                  prototype

                  The container for instance methods for Success variants of the Validation structure.

                  -
                  Experimental
                  get tag

                  The tag for this variant, unique among the Validation variants.

                  -
                  Experimental
                  get type

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -
                  Experimental

                  Instance (prototype) properties

                  Combining validations

                  apply()

                  If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

                  -
                  concat()

                  Combines two validations together such that failures are aggregated.

                  -

                  Comparing and testing

                  equals(value)

                  Performs a deep-comparison of two Validation values for equality.

                  -
                  Experimental
                  hasInstance(value)

                  Tests if an arbitrary value is a Validation instance.

                  -
                  ExperimentalInherited
                  get isSuccess

                  True if the value is a Success instance.

                  -
                  Deprecated

                  Constructing

                  of(value)

                  Constructs a Validation holding a Success value.

                  -
                  Inherited

                  Converting to other types

                  toMaybe()

                  Transforms a Validation into a Maybe. Failure values are lost in the process.

                  -
                  Inherited
                  toResult()

                  Transforms a Validation into a Reseult.

                  -
                  Inherited

                  Data fields

                  get value

                  The value contained in an Success instance of the Validation structure.

                  -
                  Abstract

                  Debugging

                  inspect: toString()

                  A textual representation for Validation instances.

                  -
                  Experimental
                  toString()

                  A textual representation for Validation instances.

                  -
                  Experimental

                  Extracting values

                  get()

                  This method has been renamed to unsafeGet().

                  -
                  DeprecatedInherited
                  getOrElse()

                  Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

                  -
                  merge()

                  Returns the value inside of the Validation structure, regardless of its state.

                  -
                  Inherited
                  unsafeGet()

                  Extracts the value from a Validation structure.

                  -

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/bimap(f, g)

                  Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

                  -
                  fantasy-land/concat(that)

                  Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

                  -
                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -
                  fantasy-land/map(transformation)

                  Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

                  -
                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Pattern matching

                  fold()

                  Applies a function to each case of a Validation.

                  -
                  matchWith(pattern)

                  Chooses and executes a function for each variant in the Validation structure.

                  -
                  Experimental

                  Recovering from errors

                  orElse()

                  Allows recovering from Failure values with a handler function.

                  -
                  swap()

                  Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

                  -

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

                  -
                  ExperimentalInherited
                  toJSON()

                  Converts a Validation value to a JavaScript object that may be stored as a JSON value.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor for this variant.

                  -
                  variants

                  The variants in the Validation structure.

                  -
                  ExperimentalInherited

                  Transforming

                  bimap()

                  Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

                  -
                  map()

                  Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -
                  mapFailure()

                  Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -

                  Variants

                  Failure(value)

                  Constructs a Validation whose value represents a failure.

                  -
                  ExperimentalInherited
                  Success(value)

                  Constructs a Validation whose value represents a success.

                  -
                  ExperimentalInherited

                  Source Code

                  Success(value) { 
                  -    return { value };
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.apply.html b/docs/api/en/folktale.data.validation.validation.apply.html deleted file mode 100644 index 63d30a1..0000000 --- a/docs/api/en/folktale.data.validation.validation.apply.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - apply - - - - - -

                  apply

                  If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

                  -

                  Signature

                  forall a, b, c: (Validation (b) => c).(Validation a b) => Validation a c

                  Documentation

                  If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -const tuple = (a) => (b) => [a, b];
                  -
                  -Success(tuple).apply(Success(1)).apply(Success(2));
                  -// ==> Success([1, 2])
                  -
                  -Success(tuple).apply(Success(1)).apply(Failure('a'));
                  -// ==> Failure('a')
                  -
                  -Success(tuple).apply(Failure('a')).apply(Success(1));
                  -// ==> Failure('a')
                  -
                  -Success(tuple).apply(Failure('a')).apply(Failure('b'));
                  -// ==> Failure('ab')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function apply(aValidation) {
                  -      assertValidation('Failure#apply', aValidation);
                  -      return Failure.hasInstance(aValidation) ? Failure(this.value.concat(aValidation.value))
                  -      :      /* otherwise */                    this;
                  -    },
                  -
                  -    /*~*/
                  -    Success: function apply(aValidation) {
                  -      assertValidation('Success#apply', aValidation);
                  -      return Failure.hasInstance(aValidation) ? aValidation
                  -      :      /* otherwise */                    aValidation.map(this.value);
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.bimap.html b/docs/api/en/folktale.data.validation.validation.bimap.html deleted file mode 100644 index 6bc9934..0000000 --- a/docs/api/en/folktale.data.validation.validation.bimap.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - bimap - - - - - -

                  bimap

                  Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

                  -

                  Signature

                  forall a, b, c, d:
                  -  (Validation a b).((a) => c, (b) => d) => Validation c d

                  Documentation

                  Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -
                  -const upcase = (a) => a.toUpperCase();
                  -const duplicate = (a) => `${a}${a}`;
                  -
                  -Validation.Success('a').bimap(duplicate, upcase);
                  -// ==> Validation.Success('A')
                  -
                  -Validation.Failure('a').bimap(duplicate, upcase);
                  -// ==> Validation.Failure('aa')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function bimap(failureTransformation, successTransformation) {
                  -      assertFunction('Validation.Failure#fold', failureTransformation);
                  -      assertFunction('Validation.Failure#fold', successTransformation);
                  -      return Failure(failureTransformation(this.value));
                  -    },
                  -
                  -    /*~*/
                  -    Success: function bimap(failureTransformation, successTransformation) {
                  -      assertFunction('Validation.Success#fold', failureTransformation);
                  -      assertFunction('Validation.Success#fold', successTransformation);
                  -      return Success(successTransformation(this.value));
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.concat.html b/docs/api/en/folktale.data.validation.validation.concat.html deleted file mode 100644 index bc3e978..0000000 --- a/docs/api/en/folktale.data.validation.validation.concat.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - concat - - - - - -

                  concat

                  Combines two validations together such that failures are aggregated.

                  -

                  Signature

                  forall a, b:
                  -  (Validation a b).(Validation a b) => Validation a b
                  -where a is Semigroup

                  Documentation

                  Combines two validations together such that failures are aggregated.

                  -

                  In cases where both validations contain a successful value, this method just selects the last validation.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Failure('a').concat(Failure('b'));
                  -// ==> Failure('ab')
                  -
                  -Failure('a').concat(Success('b'));
                  -// ==> Failure('a')
                  -
                  -Success('a').concat(Failure('b'));
                  -// ==> Failure('b')
                  -
                  -Success('a').concat(Success('b'));
                  -// ==> Success('b')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function concat(aValidation) {
                  -      assertValidation('Validation.Failure#concat', aValidation);
                  -      if (Failure.hasInstance(aValidation)) {
                  -        return Failure(this.value.concat(aValidation.value));
                  -      } else {
                  -        return this;
                  -      }
                  -    },
                  -
                  -    /*~*/
                  -    Success: function concat(aValidation) {
                  -      assertValidation('Validation.Success#concat', aValidation);
                  -      return aValidation;
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.failure.html b/docs/api/en/folktale.data.validation.validation.failure.html deleted file mode 100644 index 2e09d77..0000000 --- a/docs/api/en/folktale.data.validation.validation.failure.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - Failure - - - - - -

                  Failure

                  Constructs a Validation whose value represents a failure.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  Failure(value)
                  forall a, b: (a) => Validation a b

                  Documentation

                  Constructs a Validation whose value represents a failure.

                  -

                  See the documentation for the Validation structure to understand how to use this.

                  -

                  Static properties

                  Comparing and testing

                  hasInstance(value)

                  Tests if an arbitrary value is a Failure case of a Validation instance.

                  -
                  Experimental

                  Debugging

                  inspect: toString()

                  A textual representation of the Failure variant.

                  -
                  Experimental
                  toString()

                  A textual representation of the Failure variant.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor for this variant.

                  -
                  Experimental
                  prototype

                  The container for instance methods for Failure variants of the Validation structure.

                  -
                  Experimental
                  get tag

                  The tag for this variant, unique among the Validation variants.

                  -
                  Experimental
                  get type

                  The type for this variant, unique among Folktale data structures (and ideally unique among all ADTs in your application, as its used for type checking).

                  -
                  Experimental

                  Instance (prototype) properties

                  Combining validations

                  apply()

                  If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

                  -
                  concat()

                  Combines two validations together such that failures are aggregated.

                  -

                  Comparing and testing

                  equals(value)

                  Performs a deep-comparison of two Validation values for equality.

                  -
                  Experimental
                  hasInstance(value)

                  Tests if an arbitrary value is a Validation instance.

                  -
                  ExperimentalInherited
                  get isFailure

                  True if the value is a Failure instance.

                  -
                  Deprecated

                  Constructing

                  of(value)

                  Constructs a Validation holding a Success value.

                  -
                  Inherited

                  Converting to other types

                  toMaybe()

                  Transforms a Validation into a Maybe. Failure values are lost in the process.

                  -
                  Inherited
                  toResult()

                  Transforms a Validation into a Reseult.

                  -
                  Inherited

                  Data fields

                  get value

                  The value contained in an Failure instance of the Validation structure.

                  -
                  Abstract

                  Debugging

                  inspect: toString()

                  A textual representation for Validation instances.

                  -
                  Experimental
                  toString()

                  A textual representation for Validation instances.

                  -
                  Experimental

                  Extracting values

                  get()

                  This method has been renamed to unsafeGet().

                  -
                  DeprecatedInherited
                  getOrElse()

                  Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

                  -
                  merge()

                  Returns the value inside of the Validation structure, regardless of its state.

                  -
                  Inherited
                  unsafeGet()

                  Extracts the value from a Validation structure.

                  -

                  Fantasy Land

                  ap(that)

                  Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

                  -
                  fantasy-land/ap(that)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

                  -
                  fantasy-land/bimap(f, g)

                  Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

                  -
                  fantasy-land/concat(that)

                  Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

                  -
                  fantasy-land/equals(that)

                  Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

                  -
                  fantasy-land/map(transformation)

                  Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

                  -
                  fantasy-land/of(value)

                  Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

                  -

                  Meta-programming

                  derive(...derivations)

                  Allows a function to provide functionality to variants in an ADT.

                  -
                  ExperimentalInherited

                  Pattern matching

                  fold()

                  Applies a function to each case of a Validation.

                  -
                  matchWith(pattern)

                  Chooses and executes a function for each variant in the Validation structure.

                  -
                  Experimental

                  Recovering from errors

                  orElse()

                  Allows recovering from Failure values with a handler function.

                  -
                  swap()

                  Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

                  -

                  Serialising

                  fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

                  Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

                  -
                  ExperimentalInherited
                  toJSON()

                  Converts a Validation value to a JavaScript object that may be stored as a JSON value.

                  -
                  Experimental

                  Special values

                  get constructor

                  The constructor for this variant.

                  -
                  variants

                  The variants in the Validation structure.

                  -
                  ExperimentalInherited

                  Transforming

                  bimap()

                  Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

                  -
                  map()

                  Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -
                  mapFailure()

                  Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -

                  Variants

                  Failure(value)

                  Constructs a Validation whose value represents a failure.

                  -
                  ExperimentalInherited
                  Success(value)

                  Constructs a Validation whose value represents a success.

                  -
                  ExperimentalInherited

                  Source Code

                  Failure(value) { 
                  -    return { value };
                  -  }
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.fold.html b/docs/api/en/folktale.data.validation.validation.fold.html deleted file mode 100644 index 1f6c5f4..0000000 --- a/docs/api/en/folktale.data.validation.validation.fold.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - fold - - - - - -

                  fold

                  Applies a function to each case of a Validation.

                  -

                  Signature

                  forall a, b, c:
                  -  (Validation a b).((a) => c, (b) => c) => c

                  Documentation

                  Applies a function to each case of a Validation.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -const upcase = (x) => x.toUpperCase();
                  -const double = (x) => x + x;
                  -
                  -Success('a').fold(upcase, double);
                  -// ==> 'aa'
                  -
                  -Failure('a').fold(upcase, double);
                  -// ==> 'A'
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function fold(failureTransformation, successTransformation) {
                  -      assertFunction('Validation.Failure#fold', failureTransformation);
                  -      assertFunction('Validation.Failure#fold', successTransformation);
                  -      return failureTransformation(this.value);
                  -    },
                  -
                  -    /*~*/
                  -    Success: function fold(failureTransformation, successTransformation) {
                  -      assertFunction('Validation.Success#fold', failureTransformation);
                  -      assertFunction('Validation.Success#fold', successTransformation);
                  -      return successTransformation(this.value);
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.get.html b/docs/api/en/folktale.data.validation.validation.get.html deleted file mode 100644 index 92d739a..0000000 --- a/docs/api/en/folktale.data.validation.validation.get.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - get - - - - - -

                  get

                  This method has been renamed to unsafeGet().

                  -
                  Deprecated since 2.0.0

                  We want to discourage the use of partial functions, and having short names -makes it easy for people to want to use them without thinking about the -problems.

                  -

                  For more details see https://github.com/origamitower/folktale/issues/42

                  -

                  Signature

                  get()
                  forall a, b: (Validation a b).() => b :: throws TypeError

                  Documentation

                  This method has been renamed to unsafeGet().

                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 276, column 26
                  'get'() {
                  -    warnDeprecation('`.get()` is deprecated, and has been renamed to `.unsafeGet()`.');
                  -    return this.unsafeGet();
                  -  }
                  Stability
                  deprecated
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.getorelse.html b/docs/api/en/folktale.data.validation.validation.getorelse.html deleted file mode 100644 index c94517a..0000000 --- a/docs/api/en/folktale.data.validation.validation.getorelse.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - getOrElse - - - - - -

                  getOrElse

                  Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

                  -

                  Signature

                  forall a, b: (Validation a b).(b) => b

                  Documentation

                  Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success('a').getOrElse('b');
                  -// ==> 'a'
                  -
                  -Failure('a').getOrElse('b');
                  -// ==> 'b'
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function getOrElse(_default) {
                  -      return _default;
                  -    },
                  -
                  -    /*~*/
                  -    Success: function getOrElse(_default) {
                  -      return this.value;
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.inspect.html b/docs/api/en/folktale.data.validation.validation.inspect.html deleted file mode 100644 index 40e0b12..0000000 --- a/docs/api/en/folktale.data.validation.validation.inspect.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - toString - - - - - -

                  toString

                  A textual representation of the Success variant.

                  -
                  This feature is experimental!

                  This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

                  Signature

                  toString()
                  () => String

                  Documentation

                  A textual representation of the Success variant.

                  -

                  Properties

                  Source Code

                  () => variantName
                  Stability
                  experimental
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  On This Page
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • @boris-marinov
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.map.html b/docs/api/en/folktale.data.validation.validation.map.html deleted file mode 100644 index f15c5e8..0000000 --- a/docs/api/en/folktale.data.validation.validation.map.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - map - - - - - -

                  map

                  Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -

                  Signature

                  forall a, b, c: (Validation a b).((b) => c) => Validation a c

                  Documentation

                  Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -const upcase = (a) => a.toUpperCase();
                  -
                  -Success('a').map(upcase);
                  -// ==> Success('A')
                  -
                  -Failure('a').map(upcase);
                  -// ==> Failure('a')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function map(transformation) {
                  -      assertFunction('Validation.Failure#map', transformation);
                  -      return this;
                  -    },
                  -
                  -    /*~*/
                  -    Success: function map(transformation) {
                  -      assertFunction('Validation.Success#map', transformation);
                  -      return Success(transformation(this.value));
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.mapfailure.html b/docs/api/en/folktale.data.validation.validation.mapfailure.html deleted file mode 100644 index c835006..0000000 --- a/docs/api/en/folktale.data.validation.validation.mapfailure.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - mapFailure - - - - - -

                  mapFailure

                  Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -

                  Signature

                  forall a, b, c:
                  -  (Validation a b).((a) => c) Validation c b

                  Documentation

                  Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -const upcase = (a) => a.toUpperCase();
                  -
                  -Success('a').mapFailure(upcase);
                  -// ==> Success('a')
                  -
                  -Failure('a').mapFailure(upcase);
                  -// ==> Failure('A')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function mapFailure(transformation) {
                  -      assertFunction('Validation.Failure#mapFailure', transformation);
                  -      return Failure(transformation(this.value));
                  -    },
                  -
                  -    /*~*/
                  -    Success: function mapFailure(transformation) {
                  -      assertFunction('Validation.Failure#mapFailure', transformation);
                  -      return this;
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.merge.html b/docs/api/en/folktale.data.validation.validation.merge.html deleted file mode 100644 index 4a8faee..0000000 --- a/docs/api/en/folktale.data.validation.validation.merge.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - merge - - - - - -

                  merge

                  Returns the value inside of the Validation structure, regardless of its state.

                  -

                  Signature

                  merge()
                  forall a, b: (Validation a b).() => a or b

                  Documentation

                  Returns the value inside of the Validation structure, regardless of its state.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success('a').merge();
                  -// ==> 'a'
                  -
                  -Failure('a').merge();
                  -// ==> 'a'
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 276, column 26
                  merge() {
                  -    return this.value;
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.of.html b/docs/api/en/folktale.data.validation.validation.of.html deleted file mode 100644 index 6a8e638..0000000 --- a/docs/api/en/folktale.data.validation.validation.of.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - of - - - - - -

                  of

                  Constructs a Validation holding a Success value.

                  -

                  Signature

                  of(value)
                  forall a, b: (b) => Validation a b

                  Documentation

                  Constructs a Validation holding a Success value.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -
                  -Validation.of(1);
                  -// ==> Validation.Success(1)
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 276, column 26
                  of(value) {
                  -    return Success(value);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.orelse.html b/docs/api/en/folktale.data.validation.validation.orelse.html deleted file mode 100644 index 82f94f8..0000000 --- a/docs/api/en/folktale.data.validation.validation.orelse.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - orElse - - - - - -

                  orElse

                  Allows recovering from Failure values with a handler function.

                  -

                  Signature

                  forall a, b, c:
                  -  (Validation a b).((a) => Validation c b) => Validation c b

                  Documentation

                  Allows recovering from Failure values with a handler function.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success('a').orElse(e => Success('b'));
                  -// ==> Success('a')
                  -
                  -Failure('a').orElse(e => Success('b'));
                  -// ==> Success('b')
                  -
                  -Failure('a').orElse(e => Failure('b'));
                  -// ==> Failure('b')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function orElse(handler) {
                  -      assertFunction('Validation.Failure#orElse', handler);
                  -      return handler(this.value);
                  -    },
                  -
                  -    /*~*/
                  -    Success: function orElse(handler) {
                  -      assertFunction('Validation.Success#orElse', handler);
                  -      return this;
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.swap.html b/docs/api/en/folktale.data.validation.validation.swap.html deleted file mode 100644 index e41f941..0000000 --- a/docs/api/en/folktale.data.validation.validation.swap.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - swap - - - - - -

                  swap

                  Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

                  -

                  Signature

                  forall a, b: (Validation a b).() => Validation b a

                  Documentation

                  Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -
                  -Success('a').swap();
                  -// ==> Failure('a')
                  -
                  -Failure('a').swap();
                  -// ==> Success('a')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function swap() {
                  -      return Success(this.value);
                  -    },
                  -
                  -    /*~*/
                  -    Success: function swap() {
                  -      return Failure(this.value);
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.tomaybe.html b/docs/api/en/folktale.data.validation.validation.tomaybe.html deleted file mode 100644 index ca98d99..0000000 --- a/docs/api/en/folktale.data.validation.validation.tomaybe.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - toMaybe - - - - - -

                  toMaybe

                  Transforms a Validation into a Maybe. Failure values are lost in the process.

                  -

                  Signature

                  toMaybe()
                  forall a, b: (Validation a b).() => Maybe b

                  Documentation

                  Transforms a Validation into a Maybe. Failure values are lost in the process.

                  -

                  Example:

                  -
                  const { Success, Failure } = require('folktale/data/validation');
                  -const Maybe = require('folktale/data/maybe');
                  -
                  -Success('a').toMaybe();
                  -// ==> Maybe.Just('a')
                  -
                  -Failure('a').toMaybe();
                  -// ==> Maybe.Nothing()
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 276, column 26
                  toMaybe() {
                  -    return require('folktale/data/conversions/validation-to-maybe')(this);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.toresult.html b/docs/api/en/folktale.data.validation.validation.toresult.html deleted file mode 100644 index 9d75dd9..0000000 --- a/docs/api/en/folktale.data.validation.validation.toresult.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - toResult - - - - - -

                  toResult

                  Transforms a Validation into a Reseult.

                  -

                  Signature

                  toResult()
                  forall a, b: (Validation a b).() => Result a b

                  Documentation

                  Transforms a Validation into a Reseult.

                  -

                  Validation's Failures are mapped into Result's Errors, and Validation's Successes are mapped into Result's Oks.

                  -

                  Example:

                  -
                  const { Success, Failure } = requiure('folktale/data/validation');
                  -const Result = require('folktale/data/result');
                  -
                  -Success('a').toResult();
                  -// ==> Result.Ok('a')
                  -
                  -Failure('a').toResult();
                  -// ==> Result.Error('a')
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 276, column 26
                  toResult() {
                  -    return require('folktale/data/conversions/validation-to-result')(this);
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.unsafeget.html b/docs/api/en/folktale.data.validation.validation.unsafeget.html deleted file mode 100644 index e51c76d..0000000 --- a/docs/api/en/folktale.data.validation.validation.unsafeget.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - unsafeGet - - - - - -

                  unsafeGet

                  Extracts the value from a Validation structure.

                  -

                  Signature

                  forall a, b: (Validation a b).() => b :: throws TypeError

                  Documentation

                  Extracts the value from a Validation structure.

                  -
                  -

                  WARNING
                  This method is partial, which means that it will only work for Success -structures, not for Failure structures. It's recommended to use .getOrElse() -or .matchWith() instead.

                  -
                  -

                  Example:

                  -
                  const { Failure, Success } = require('folktale/data/validation');
                  -
                  -Success('a').unsafeGet();
                  -// ==> 'a'
                  -
                  -
                  -try {
                  -  Failure('a').unsafeGet();
                  -  // TypeError: Can't extract the value of an Error
                  -} catch (e) {
                  -  e instanceof TypeError; // ==> true
                  -}
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 70, column 23
                  {
                  -    /*~*/
                  -    Failure: function unsafeGet() {
                  -      throw new TypeError(`Can't extract the value of a Failure.
                  -
                  -    Failure does not contain a normal value - it contains an error.
                  -    You might consider switching from Validation#get to Validation#getOrElse, or some other method
                  -    that is not partial.
                  -      `);
                  -    },
                  -
                  -    /*~*/
                  -    Success: function unsafeGet() {
                  -      return this.value;
                  -    }
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.data.validation.validation.value.html b/docs/api/en/folktale.data.validation.validation.value.html deleted file mode 100644 index 72f1ad9..0000000 --- a/docs/api/en/folktale.data.validation.validation.value.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - value - - - - - -

                  value

                  The value contained in an Success instance of the Validation structure.

                  -

                  Signature

                  get value()
                  forall a, b: get (Validation a b) => b

                  Documentation

                  The value contained in an Success instance of the Validation structure.

                  -

                  This is usually used to destructure the instance in a .matchWith call.

                  -

                  Example:

                  -
                  const Validation = require('folktale/data/validation');
                  -
                  -Validation.Success(1).matchWith({
                  -  Success: ({ value }) => value,    // equivalent to (x) => x.value
                  -  Failure: ({ value }) => 'nothing'
                  -});
                  -// ==> 1
                  -

                  Properties

                  Source Code

                  Defined in src/data/validation/validation.js at line 57, column 26
                  get value() {
                  -    throw new TypeError('`value` can’t be accessed in an abstract instance of Validation.Success');
                  -  }
                  Licence
                  MIT
                  Module
                  folktale/data/validation/validation
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/folktale.html b/docs/api/en/folktale.html deleted file mode 100644 index b715648..0000000 --- a/docs/api/en/folktale.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - module folktale - - - - - -

                  module folktale

                  Folktale is a standard library for functional programming in JavaScript.

                  -

                  Documentation

                  Folktale is a standard library for functional programming in JavaScript.

                  -

                  Properties

                  0. Getting started

                  Installing Folktale

                  Folktale is preferrably installed by npm, but this guide will walk you through installing Folktale in platforms other than Node.js.

                  -

                  1. API Reference

                  core

                  Provides essential functionality for functional programs.

                  -
                  data

                  Implements common functional data structures in JavaScript.

                  -

                  2. Support

                  Frequently Asked Questions

                  Answers to some common questions people have when using Folktale.

                  -
                  Reporting bugs

                  Found an error in Folktale? Think the documentation is missing or confusing? Not sure how to report these? Read on.

                  -
                  Requesting new features

                  Think Folktale should do something it doesn't yet? Read on.

                  -

                  3. Contributing

                  Contributing code

                  Read this if you want to fix a bug in Folktale or implement a new feature.

                  -
                  Improving Folktale's documentation

                  Found a typo in the documentation, or think that something is missing from it, and want to help fixing that? Read on.

                  -
                  Improving Folktale's tests

                  Folktale uses a mix of property-based and unit tests. Read this to understand how to add new tests, or update existing ones.

                  -

                  4. Annexes

                  Coding style

                  Describes the coding style used by the Folktale project.

                  -
                  Design principles behind Folktale

                  Describes the design principles behind Folktale.

                  -
                  Development tasks and tooling

                  Folktale uses GNU Make for development tooling. From -there you can compile the source code, run tests, perform cleanup routines, or -check your source code for style errors.

                  -
                  Git commit guidelines

                  Describes how Git commits are annotated.

                  -
                  Navigating the Folktale repository

                  What all the folders and files in the Folktale repository are for.

                  -
                  Navigating the issue tracker

                  Describes how the issue/feature tracker is organised.

                  -
                  Setting up a development environment

                  A step-by-step guide to set up a development environment for working on Folktale.

                  -
                  Type notation used in signatures

                  In order to concisely describe what to expect of a piece of functionality, Folktale uses its own type notation. This guide describes the notation used.

                  -

                  Source Code

                  Defined in src/index.js at line 14, column 0
                  {
                  -  core: require('./core'),
                  -  data: require('./data')
                  -}
                  Stability
                  stable
                  Licence
                  MIT
                  Module
                  folktale
                  Authors
                  Copyright
                  (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
                  Authors
                  • Quildreen Motta
                  Maintainers
                  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
                  - - - - \ No newline at end of file diff --git a/docs/api/en/guides.can-i-use-folktale-with-flow-or-typescript-.html b/docs/api/en/guides.can-i-use-folktale-with-flow-or-typescript-.html deleted file mode 100644 index 30e17d0..0000000 --- a/docs/api/en/guides.can-i-use-folktale-with-flow-or-typescript-.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Can I use Folktale with Flow or TypeScript? - - - - - -

                  Can I use Folktale with Flow or TypeScript?

                  Short answer: yes, but there are no type definitions for them currently, and some of the features in Folktale require more advanced type system concepts that they don't support.

                  -

                  Documentation

                  Short answer: yes, but there are no type definitions for them currently, and some of the features in Folktale require more advanced type system concepts that they don't support.

                  -

                  It is possible to use Folktale with Flow and TypeScript, however some of the features Folktale relies on can't be expressed in those type systems, and so they must be described with the any type. This is not as useful for static checking, and it might make using some of the features more annoying or more difficult.

                  -

                  Better support for some of the features that Folktale uses depends on the concept of Higher-Kinded Polymorphism (very roughly: types that generalise other types. Think of generics, but instead of generalising the x in List<x>, it generalises the List and the x in List<x>). Right now, the status of supporting HKP in Flow is "maybe at some point in the future", meanwhile TypeScript's status is "we like the idea, but it's a lot of effort and low priority. We're accepting PRs, though", with some of the community trying to work something out. So, maybe in the future, but definitely not right now.

                  -

                  That said, basic support for TypeScript is planned for the initial 2.0 release. Right now you can use it if you explicitly declare the module to have the any type (or rely on implicit any, but that's even less ideal). Not great, but works. Support for Flow might come after that, but no guarantees.

                  -
                  Notes
                  - -

                  Properties

                  Module
                  guides
                  On This Page
                  Authors
                  Authors
                  • @robotlolita
                  Maintainers
                    - - - - \ No newline at end of file diff --git a/docs/api/en/guides.coding-style.html b/docs/api/en/guides.coding-style.html deleted file mode 100644 index f14d417..0000000 --- a/docs/api/en/guides.coding-style.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Coding style - - - - - -

                    Coding style

                    Describes the coding style used by the Folktale project.

                    -

                    Documentation

                    Describes the coding style used by the Folktale project.

                    -
                    -
                    -

                    TODO
                    This section is a stub and needs to be improved.

                    -
                    -

                    The ESLint rules will catch most of the style issues, so you might just want to -run make lint on your code. That said, there are a few idioms that aren't -captured by ESLint rules:

                    -
                      -
                    • Prefer const for declaring names wherever possible. When a name or the -value it refers to is mutated in the scope, use let instead. In this -sense, we use const to indicate an immutable binding and value, and -let for everything else.

                      -
                    • -
                    • Prefer arrow functions whenever possible. Regular JavaScript functions have -many unnecessary properties for functional programming in general, such as -this, super and .prototype. So, if you're not writing a method, where -you'll want this, it should be an arrow function.

                      -
                    • -
                    • Use Lisp/Haskell-alignment for conditionals when using ternaries. For -example:

                      -
                      return argCount < arity   ?  curried(allArgs)
                      -:      argCount === arity ?  fn(...allArgs)
                      -:      /* otherwise */       unrollInvoke(fn, arity, allArgs);
                      -
                      -

                      The comment for the last else case is not optional, but can be shortened -to /* else */ for shorter conditions.

                      -
                    • -
                    -

                    Properties

                    Module
                    guides
                    On This Page
                    Authors
                    Authors
                    • @robotlolita
                    Maintainers
                      - - - - \ No newline at end of file diff --git a/docs/api/en/guides.contributing-code.html b/docs/api/en/guides.contributing-code.html deleted file mode 100644 index 973883d..0000000 --- a/docs/api/en/guides.contributing-code.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Contributing code - - - - - -

                      Contributing code

                      Read this if you want to fix a bug in Folktale or implement a new feature.

                      -

                      Documentation

                      Read this if you want to fix a bug in Folktale or implement a new feature.

                      -
                      -

                      Before making your changes, you'll have to set up a development environment. You might also be interested in understanding how the repository is organised and how Git commits are annotated.

                      -

                      Note that Folktale uses a common workflow where new development happens in topic branches, -and then a Pull Request is made in order to merge those branches back into the -master branch. GitHub has a -nice description of this workflow.

                      - -

                      All JavaScript files in the project should start with the following preamble:

                      -
                      //----------------------------------------------------------------------
                      -//
                      -// This source file is part of the Folktale project.
                      -//
                      -// Licensed under MIT. See LICENCE for full licence information.
                      -// See CONTRIBUTORS for the list of contributors to the project.
                      -//
                      -//----------------------------------------------------------------------
                      -
                      -

                      Note, again, that Folktale is licensed under MIT, and by contributing patches, -you agree to release your contribution under the MIT licence.

                      -

                      If you're making or have made a contribution to the project, please add yourself -to the CONTRIBUTORS file if you haven't done so yet.

                      -

                      Implementing your changes

                      -

                      Whether you're fixing a bug or adding a new feature, the process is roughly the same. You'll want to create a new branch for your feature. This allows you to -work on more than one feature at a time, if necessary. Remember that working on -a patch for a software project involves a lot of communication, and you might -need to review your code a few times.

                      -

                      Roughly the process follows these steps:

                      -
                        -
                      1. You make your changes, either by fixing existing code or adding new features, and commit them to the repository.
                      2. -
                      3. If adding a new feature, make sure to write test cases and add a minimal documentation.
                      4. -
                      5. Run make test-all to ensure that all tests pass. This will run your tests on both Node and a PhantomJS (WebKit) instance. Compiling everything may take a while…
                      6. -
                      7. Run make lint to ensure that your code conforms with the coding style used by Folktale.
                      8. -
                      9. Push your changes to your repository.
                      10. -
                      11. Create a Pull Request from your branch in your repo, to Folktale's master branch.
                      12. -
                      13. This starts a code review and discussion. You might be asked to make some changes to your code (at which point you'd just follow the steps 1~5 above).
                      14. -
                      15. We accept your Pull Request and merge it into the master branch, or reject it with a justification.
                      16. -
                      -

                      Documenting new features

                      -

                      Folktale uses Meta:Magical for attaching documentation to objects, which can be -queried at runtime. There's a -comprehensive text on documenting objects with Meta:Magical, -so this section will only focus on the basics to get you started.

                      -

                      In the source code, functions, methods, modules, and objects should be annotated with -Meta:Magical comments. -These comments should describe who authored that functionality, what is its stability, and its type. -When relevant, functions should also describe their complexity in Big O notation.

                      -

                      Here's an example of documentation for the core/lambda/compose function:

                      -
                      /*~
                      - * stability: stable
                      - * authors:
                      - *   - "@robotlolita"
                      - * type: |
                      - *   forall a, b, c: ((b) => c, (a) => b) => (a) => c
                      - */
                      -const compose = (f, g) => (value) => f(g(value))
                      -
                      -

                      A documentation comment is a block comment whose first line contain only the ~ -character. Subsequent lines use * as an indentation marker, meaning that all -content before that, and at most one space after that is ignored.

                      -

                      Once an entity has been marked to be documented, you can follow the documentation guide to write documentation for it.

                      -

                      Properties

                      Module
                      guides
                      Authors
                      Authors
                      • @robotlolita
                      Maintainers
                        - - - - \ No newline at end of file diff --git a/docs/api/en/guides.design-principles-behind-folktale.html b/docs/api/en/guides.design-principles-behind-folktale.html deleted file mode 100644 index 74127ad..0000000 --- a/docs/api/en/guides.design-principles-behind-folktale.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Design principles behind Folktale - - - - - -

                        Design principles behind Folktale

                        Describes the design principles behind Folktale.

                        -

                        Documentation

                        Describes the design principles behind Folktale.

                        -
                        -

                        The design of the Folktale library is guided by the following principles:

                        -
                          -
                        • Favour a heavier use of arrow functions over currying -— Curried functions can be composed in several ways. And this is a good -thing, because it means it's easier to create new functionality by combining -existing ones. However, in an untyped language, you have no way of -enforcing a correct composition of functions, so currying in JS tends to -lead to silent or late errors. Coupled with JavaScript's heavy use of -variadic functions, and the VM's unhelpful error reporting, these have the -potential for being very frustrating, especially for people new to FP.

                          -

                          ES2015 lessens a bit the burden of being more explicit with your -composition, since arrow functions have less visual overhead, and can -enforce some compositional constraints syntactically. They also side-step -the problems with JavaScript's variadic functions to an extent.

                          -
                        • -
                        • Provide separate free-method versions of functions -— JavaScript's syntax is limited, but some of the proposed additions to it -lead to programs that are easier to read. One of them is the -This-Binding syntax, which -allows using functions in infix position:

                          -

                          ```js -const _groupBy = require('folktale/core/iterator/group-by');

                          -

                          function groupBy(f) { - return _groupBy(this, f); -}

                          -
                        • -
                        -
                        [1, 2, 3, 4, 5]::groupBy(isOdd)
                        -// => _groupBy([1, 2, 3, 4, 5], isOdd)
                        -
                        -// Some combinators may be provided specifically to use as infix
                        -list.sort(compare::on(first))
                        -// => list.sort(on(compare, first))
                        -```
                        -
                          -
                        • Where possible, as long as laws aren't broken, reuse the language's native methods -— This makes it easier to combine Folktale with existing projects and -libraries, as they'd have similar expectations.

                          -
                        • -
                        • Monolithic package over several micro-libraries -— There are plenty of advantages of micro-libraries. They are more modular, -since they have to work with less expectations; they are easier to replace; -we can make a better use of semantic versioning; and they are easier to -understand.

                          -

                          But there are plenty of drawbacks to them as well:

                          -
                            -
                          • They're harder to use when you need to combine more than one -module. For example, if you want an Either module to be able to convert -its values to a Maybe structure, you need to provide the Either module -with the Maybe structure to use. This, while modular, adds some friction -for people to use these features, which goes against our aim to make -functional programming easier to newcomers.

                            -
                          • -
                          • They're harder to maintain. Keeping modules, tooling, and issues in -sync between different modules takes much more effort, and it's easy to -miss things. When all of the modules are related anyway, you'll have to -keep them in sync all the time.

                            -
                          • -
                          • They're less consistent. Because each module is independent, exposes -its own API, and evolves at its own pace, it's easy to get inconsistent -behaviour across them. This was the case with how methods worked in the -old versions of Maybe, Either, and Validation.

                            -
                          • -
                          -
                        • -
                        • Better support for interactive (REPL) development -— One of the long-term goals with Folktale is to have really good support -for interactive development in the REPL. The first step for that is to be -able to view documentation directly from the REPL, which is being done by -annotating objects with the -Meta:Magical library.

                          -

                          As newer features get added to Meta:Magical, like searching functions by -approximate type signature, Folktale and its users will benefit from them -without having to do anything.

                          -
                        • -
                        • Logically grouped, minimal modules -— Each module should be entirely self-contained, and only provide the -absolute minimum necessary for that particular functionality. Most of the -time this will mean one function = one module, but not always. See the -folktale/core/adt module, and the -Siren's Platform Design document -for examples.

                          -

                          There are two reasons behind this:

                          -
                            -
                          1. Extracting a minimal application from a large framework/environment -(tree-shaking) requires full type inference in JavaScript, because -modules are first class, and you need to know which properties of which -objects are accessed where. For historical data on this, see the -report on Foundations of Object-Oriented Languages -and Aegesen at al's work on -type inference for Self.

                            -
                          2. -
                          3. Because all modules are annotated, inline, for the Meta:Magical library, -even modules comprised of simple, one line functions end up being more -than 40 lines of code when you consider documentation.

                            -
                          4. -
                          -
                        • -
                        • Modules are grouped in an hierarchy of categories -— This is mostly to make using the libraries easier given the previous -point. Modules that are higher in the hierarchy should re-export all -features below it. This allows people to require a bag of things, like -require('folktale/data/result'), or a very specific functionality, when -they are concerned about the resulting size of the application (if they are -deploying to a Browser, for example), like -require('folktale/data/result/from-nullable').

                          -
                        • -
                        -

                        Properties

                        Module
                        guides
                        On This Page
                        Authors
                        Authors
                        • @robotlolita
                        Maintainers
                          - - - - \ No newline at end of file diff --git a/docs/api/en/guides.development-tasks-and-tooling.html b/docs/api/en/guides.development-tasks-and-tooling.html deleted file mode 100644 index acca0c1..0000000 --- a/docs/api/en/guides.development-tasks-and-tooling.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Development tasks and tooling - - - - - -

                          Development tasks and tooling

                          Folktale uses GNU Make for development tooling. From -there you can compile the source code, run tests, perform cleanup routines, or -check your source code for style errors.

                          -

                          Documentation

                          Folktale uses GNU Make for development tooling. From -there you can compile the source code, run tests, perform cleanup routines, or -check your source code for style errors.

                          -

                          Note: before you can do anything in Folktale you must initialise the documentation tools:

                          -
                          $ git submodule init
                          -$ git submmodule update
                          -$ make tools
                          -
                          -

                          Running make or make help will show you all of the available development -tasks.

                          -

                          Running make compile will compile the source code using Babel. -After this you can import the objects in the REPL and interact with them.

                          -

                          Running make compile-annotated will compile the source code with the special documentation -marks. You can either use make documentation to generate HTML docs from that, or -require('./documentation') in a Node REPL to read the docs from there.

                          -

                          Running make test will compile the project and run all of the tests. Running -make test-all will also test the examples in the documentation. You can run -tests in a PhantomJS (a headless WebKit browser) using make test-browser.

                          -

                          Running make lint will check all of the source code for style -inconsistencies. The coding style used by Folktale is described later in this -document.

                          -

                          Finally, running make clean will remove any compiled files from your working -directory, but will keep all other files intact. You can always run make -compile again to re-build the project.

                          -

                          Properties

                          Module
                          guides
                          On This Page
                          Authors
                          Authors
                          • @robotlolita
                          Maintainers
                            - - - - \ No newline at end of file diff --git a/docs/api/en/guides.do-folktale-structures-implement-fantasy-land-.html b/docs/api/en/guides.do-folktale-structures-implement-fantasy-land-.html deleted file mode 100644 index 28df584..0000000 --- a/docs/api/en/guides.do-folktale-structures-implement-fantasy-land-.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - Do Folktale structures implement Fantasy Land? - - - - - -

                            Do Folktale structures implement Fantasy Land?

                            Short answer: yes. Folktale 1 implements fantasy-land@1.x, and Folktale 2 implements fantasy-land@1.x up to fantasy-land@3.x, wherever possible.

                            -

                            Documentation

                            Short answer: yes. Folktale 1 implements fantasy-land@1.x, and Folktale 2 implements fantasy-land@1.x up to fantasy-land@3.x, wherever possible.

                            -

                            Refer to the table below for implemented algebras:

                            -

                            Folktale 1

                            -

                            Folktale 1 implements only the non-prefixed methods of Fantasy Land v0.x~1.x.

                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            MaybeEitherValidationTask
                            Setoid🚫
                            Semigroup✅¹
                            Monoid🚫²🚫²🚫²✅¹
                            Functor
                            Contravariant🚫🚫🚫🚫
                            Apply
                            Applicative✅3
                            Alt
                            Plus
                            Alternative
                            Foldable
                            Traversable
                            Chain🚫⁴
                            ChainRec🚫⁴
                            Monad🚫⁴
                            Extend🚫⁵🚫⁵🚫⁵🚫⁵
                            Comonad🚫⁵🚫⁵🚫⁵🚫⁵
                            Bifunctor🚫⁶
                            Profunctor🚫🚫🚫🚫
                            -

                            Folktale 2

                            -

                            Folktale 2 implements both unprefixed and prefixed methods, and thus supports Fantasy Land v0.x~3.x.

                            -
                            -

                            NOTE
                            The structures implement the old version of .ap (fn.ap(value)), and the new version of ."fantasy-land/ap" (value['fantasy-land/ap'](fn)). Fantasy Land actually made this breaking change without bumping the major version first. If some library expects the unprefixed method to implement the new argument order, things won't work nicely.

                            -
                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            MaybeResultValidationTaskFuture
                            Setoid🚫🚫
                            Semigroup🔜🔜
                            Monoid🚫²🚫²🚫²
                            Functor
                            Contravariant🚫🚫🚫🚫🚫
                            Apply
                            Applicative
                            Alt🔜🔜🔜🔜🔜
                            Plus🔜🔜🔜🔜🔜
                            Alternative🔜🔜🔜🔜🔜
                            Foldable
                            Traversable
                            Chain🚫⁴
                            ChainRec🔜🔜🚫⁴🔜🔜
                            Monad🚫⁴
                            Extend🚫⁵🚫⁵🚫⁵🚫⁵🚫⁵
                            Comonad🚫⁵🚫⁵🚫⁵🚫⁵🚫⁵
                            Bifunctor🚫⁶
                            Profunctor🚫🚫🚫🚫🚫
                            -
                            -

                            NOTES

                            -
                              -
                            • ✅: The algebra is implemented for this structure;
                            • -
                            • ❌: The algebra is not implemented for this structure;
                            • -
                            • 🚫: The algebra can't be implemented for this structure;
                            • -
                            • 🔜: The algebra will be implemented for this structure in the future.
                            • -
                            -
                            -
                              -
                            • ¹: The Task instance of Monoid is non-deterministic, and the equivalent of Promise.race.
                            • -
                            • ²: Implementing a generic Monoid would require return-type polymorphism. It's theoretically possible, but not practically possible (requires free monoids and late reifying). See https://eighty-twenty.org/2015/01/25/monads-in-dynamically-typed-languages for a detailed explanation.
                            • -
                            • ³: Resolves Tasks in parallel, so may be observably different than the Monad instance if the ordering of effects matters.
                            • -
                            • ⁴: See Why is there no .chain/Monad for Validation? in this document.
                            • -
                            • ⁵: It's not possible to implement these without being partial, so we choose to not implement it.
                            • -
                            • ⁶: One side of the Maybe is nullary, and Bifunctor requires two unary functions.
                            • -
                            -
                            -

                            Properties

                            Module
                            guides
                            On This Page
                            Authors
                            Authors
                            • @robotlolita
                            Maintainers
                              - - - - \ No newline at end of file diff --git a/docs/api/en/guides.frequently-asked-questions.html b/docs/api/en/guides.frequently-asked-questions.html deleted file mode 100644 index 10bd2db..0000000 --- a/docs/api/en/guides.frequently-asked-questions.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Frequently Asked Questions - - - - - -

                              Frequently Asked Questions

                              Answers to some common questions people have when using Folktale.

                              -

                              Documentation

                              Answers to some common questions people have when using Folktale.

                              -

                              Properties

                              Common mistakes

                              Why do I get an error saying "`.apply` is not a function"?

                              Short answer: Folktale unrolls application of curried functions, so if you pass more arguments than what a function takes, that function might try passing some of those arguments to its return value.

                              -
                              Why is there no `.chain` for Validation?

                              Short answer: the way Validation's .ap method works makes it impossible to implement the Monad interface (.chain). You might either want to use Either/Result, or rethink how you're approaching the problem.

                              -

                              Folktale and the JavaScript ecosystem

                              Can I use Folktale with Flow or TypeScript?

                              Short answer: yes, but there are no type definitions for them currently, and some of the features in Folktale require more advanced type system concepts that they don't support.

                              -
                              Do Folktale structures implement Fantasy Land?

                              Short answer: yes. Folktale 1 implements fantasy-land@1.x, and Folktale 2 implements fantasy-land@1.x up to fantasy-land@3.x, wherever possible.

                              -

                              Folktale's stability and organisation

                              How stable are the Folktale libraries?

                              Short answer: Folktale 1 packages (folktale/data.*) are the latest stable release. Folktale 2 (origamitower/folktale) is currently in alpha.

                              -
                              When will Folktale 2 be released?

                              A stable version of Folktale 2 should be released somewhere from April to May of 2017, although that will depend on me having free time. You can check what's blocking the release on the v2.0.0 milestone on GitHub.

                              -
                              Module
                              guides
                              Authors
                              Authors
                              • @robotlolita
                              Maintainers
                                - - - - \ No newline at end of file diff --git a/docs/api/en/guides.git-commit-guidelines.html b/docs/api/en/guides.git-commit-guidelines.html deleted file mode 100644 index 5cfa9c1..0000000 --- a/docs/api/en/guides.git-commit-guidelines.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Git commit guidelines - - - - - -

                                Git commit guidelines

                                Describes how Git commits are annotated.

                                -

                                Documentation

                                Describes how Git commits are annotated.

                                -
                                -

                                Folktale uses .gitlabels to -tag commits so humans can better understand the scope of changes, and tools -can help visualising changes.

                                -

                                Commits often follow this format:

                                -
                                (<tags>) <summary>
                                -
                                -<body>
                                -
                                -<footer>
                                -

                                Where:

                                -
                                  -
                                • tags: The .gitlabels tags defining the scope of changes. See the .gitlabels file for documentation;
                                • -
                                • summary: A very short description of the change.
                                • -
                                • body: A detailed description of the change.
                                • -
                                • footer: contains information about issue references and breaking changes.
                                • -
                                -

                                All text should be formatted using Markdown, and use the active, present -tense. It's "changes", rather than "change" or "changed".

                                -

                                For example, a commit that adds tests to the folktale/core/lambda module would -look like:

                                -
                                (test lambda) Adds tests for compose
                                -
                                -`compose` was the only function in the module that didn't have tests.
                                -This provides a few example based tests, and property-based tests for
                                -common mathematical laws expected of function composition, such as
                                -associativity.
                                -
                                -Fixes #12
                                -

                                Referencing issues

                                -

                                Issues may be referenced through the body of the commit, where relevant, by -providing (see #N), where N is the number of the issue. For example:

                                -
                                This is a first step in providing better documentation tools (see #91),
                                -but does not implement type searching and type summaries.
                                -

                                Issues should be closed when the commit fully fixes the problem in that -issue. This is done by listing these issues in the footer, using -GitHub's issue keywords. For example:

                                -
                                Fixes #12, fixes #43, and fixes #46
                                -

                                Breaking changes

                                -

                                All breaking changes should be detailed in the footer of the commit message. It -should contain BREAKING CHANGE: followed by a short summary of what was -broken, and a detailed justification of why it was broken, along with a -migration path from the old feature to the new one. For example:

                                -
                                BREAKING CHANGE: makes `data` return an object with constructors,
                                -instead of the old interface.
                                -
                                -This makes creating new algebraic data structures a simpler task,
                                -and aligns better with the aim of making Folktale a welcoming
                                -library to people new to functional programming.
                                -
                                -Where one used to write:
                                -
                                -    const List = data({
                                -      Nil: [],
                                -      Cons: ['value', 'rest']
                                -    });
                                -
                                -    const Nil = () => new List.Nil.constructor({});
                                -    const Cons = (value, rest) => new List.Cons.constructor({ value, rest })
                                -
                                -One would write:
                                -
                                -    const List = data({
                                -      Nil: [],
                                -      Cons: ['value', 'rest']
                                -    });
                                -
                                -    const { Nil, Cons } = List;
                                -

                                Properties

                                Module
                                guides
                                On This Page
                                Authors
                                Authors
                                • @robotlolita
                                Maintainers
                                  - - - - \ No newline at end of file diff --git a/docs/api/en/guides.how-stable-are-the-folktale-libraries-.html b/docs/api/en/guides.how-stable-are-the-folktale-libraries-.html deleted file mode 100644 index c5e96ea..0000000 --- a/docs/api/en/guides.how-stable-are-the-folktale-libraries-.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - How stable are the Folktale libraries? - - - - - -

                                  How stable are the Folktale libraries?

                                  Short answer: Folktale 1 packages (folktale/data.*) are the latest stable release. Folktale 2 (origamitower/folktale) is currently in alpha.

                                  -

                                  Documentation

                                  Short answer: Folktale 1 packages (folktale/data.*) are the latest stable release. Folktale 2 (origamitower/folktale) is currently in alpha.

                                  -

                                  The Folktale organisation on GitHub hosts the libraries referred to as Folktale 1. These are split into many independent packages:

                                  - -

                                  The packages above are the most recent stable releases of Folktale at this moment. The Folktale organisation also hosts many other experimental packages. Those are either unfinished, untested, or known to have implementation or design problems, and shouldn't be used in production.

                                  -

                                  In an effort to improve the quality and coherence of Folktale packages, a new, monolithic package is being developed. That's referred to as Folktale 2, and lives in the origamitower/folktale repository. It explains the design principles behind the new library and why it was moved to a monolithic repository/package.

                                  -

                                  At the moment, Folktale 2 is considered alpha, and should not be used in production. Aside from the lack of documentation, some of the APIs are still changing, and some features have not been implemented yet. API changes from Folktale 1 to 2 have also not been documented yet.

                                  -

                                  Properties

                                  Module
                                  guides
                                  On This Page
                                  Authors
                                  Authors
                                  • @robotlolita
                                  Maintainers
                                    - - - - \ No newline at end of file diff --git a/docs/api/en/guides.improving-folktale-s-documentation.html b/docs/api/en/guides.improving-folktale-s-documentation.html deleted file mode 100644 index 5ea4dc9..0000000 --- a/docs/api/en/guides.improving-folktale-s-documentation.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Improving Folktale's documentation - - - - - -

                                    Improving Folktale's documentation

                                    Found a typo in the documentation, or think that something is missing from it, and want to help fixing that? Read on.

                                    -

                                    Documentation

                                    Found a typo in the documentation, or think that something is missing from it, and want to help fixing that? Read on.

                                    -
                                    -

                                    Folktale uses a dialect of Markdown for documentation and some tools to process that. This dialect of Markdown lets one associate documentation with JavaScript objects, and then we can use that to show API documentation on the REPL or render it to HTML.

                                    -

                                    These Markdown files live in the docs/source/ directory, separated by a language identifier (currently only English, en/, is supported). You can edit these files in any text editor you like, but to test your changes you'll need to set up a development environment for Folktale.

                                    -

                                    To look at the HTML docs, run make documentation at the root of the repository, and open docs/api/en/folktale.html in your browser. To test the examples in the docs, run make test-documentation.

                                    - -

                                    Documenting a new entity

                                    -

                                    To document a new entity, you create a .md file inside the docs/source/<language> folder, ideally replicating a similar hierarchy to the one found in the source code folder. This file should use the special @annotate: <JS expression> line to describe which entity is being annotated. Inside that expression, the folktale variable points to the root of the Folktale library.

                                    -

                                    The @annotate line is followed by an YAML document that defines the metadata about that entity. The only required metadata right now is category, which allows us to group methods and functions in the API reference. Finally, a --- line separates the metadata from the actual documentation.

                                    -

                                    The documentation for an entity must contain at least a short summary of what the functionality is for, and an example of how to use it.

                                    -

                                    For example, if documenting the compose function (core/lambda/compose), the file would look like:

                                    -

                                    ```md

                                    -

                                    Properties

                                    Module
                                    guides
                                    On This Page
                                    Authors
                                    Authors
                                    • @robotlolita
                                    Maintainers
                                      - - - - \ No newline at end of file diff --git a/docs/api/en/guides.improving-folktale-s-tests.html b/docs/api/en/guides.improving-folktale-s-tests.html deleted file mode 100644 index c6f289e..0000000 --- a/docs/api/en/guides.improving-folktale-s-tests.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Improving Folktale's tests - - - - - -

                                      Improving Folktale's tests

                                      Folktale uses a mix of property-based and unit tests. Read this to understand how to add new tests, or update existing ones.

                                      -

                                      Documentation

                                      Folktale uses a mix of property-based and unit tests. Read this to understand how to add new tests, or update existing ones.

                                      -
                                      -

                                      Folktale uses Mocha and -JSVerify for tests. Property-based tests -are preferable, but sometimes example-based tests make more sense, Amanda -Laucher and Paul Snively have a very good -talk about when to use Property-based tests and when to use example-based tests, -which you can use as a basis to make this decision.

                                      -

                                      Tests go in the proper <category>.<subcategory>.js file in the test/specs-src/ folder -for the category of the functionality you're writing tests for. For example, -tests for the compose function of core/lambda would go in the -test/specs-src/core.lambda.js file. If the file already exists, you only need to add a new -test definition to it. Otherwise, you'll need to create a new file.

                                      -

                                      Here's an example of how one would write tests for the compose function, in a -core.lambda.js file:

                                      -
                                      // Import the jsverify library. This will be used to define the tests
                                      -const { property } = require('jsverify');
                                      -
                                      -// Import the category we're testing (core.lambda). By convention, the
                                      -// variable `_` is used to hold this object, since it has less visual
                                      -// clutter.
                                      -const _ = require('folktale').core.lambda;
                                      -
                                      -// Define the test case. Mocha adds the `describe` function to define
                                      -// a test suite. You should create a suite for the category, and a
                                      -// suite for the function being tested inside of that:
                                      -describe('Core.Lambda', () => {
                                      -  describe('compose', () => {
                                      -    // Finally, we define our test, using JSVerify's `property`
                                      -    property('Associativity', 'nat', (a) => {
                                      -      const f = (x) => x - 1;
                                      -      const g = (x) => x * 2;
                                      -      const h = (x) => x / 3;
                                      -
                                      -      return _.compose(f, _.compose(g, h))(a)
                                      -      ===    _.compose(_.compose(f, g), h)(a)
                                      -    })
                                      -  })
                                      -})
                                      -
                                      -

                                      With property based tests, JSVerify generates random data of the type described -in the property and feeds it into the function. When an error occurs, it tries -to find the smallest value that still reproduces the error and reports that to -you, so you can try to debug it.

                                      -

                                      Sometimes it makes more sense to write an example-based test than a -property-based one. For these, instead of the property function from JSVerify, -test cases are defined with the it function from Mocha, and assertions use -Node's native assert module:

                                      -
                                      const assert = require('assert');
                                      -const _ = require('folktale').core.lambda;
                                      -
                                      -describe('Core.Lambda', _ => {
                                      -  describe('compose', _ => {
                                      -    it('Invokes functions from right to left', _ => {
                                      -      const f = (x) => x - 1;
                                      -      const g = (x) => x * 2;
                                      -
                                      -      assert.equal(_.compose(f, g)(2), 3);
                                      -    })
                                      -  })
                                      -})
                                      -
                                      -

                                      To run tests, you can use make test from the root of the project.

                                      -

                                      Properties

                                      Module
                                      guides
                                      On This Page
                                      Authors
                                      Authors
                                      • @robotlolita
                                      Maintainers
                                        - - - - \ No newline at end of file diff --git a/docs/api/en/guides.installing-folktale.html b/docs/api/en/guides.installing-folktale.html deleted file mode 100644 index f50c852..0000000 --- a/docs/api/en/guides.installing-folktale.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - Installing Folktale - - - - - -

                                        Installing Folktale

                                        Folktale is preferrably installed by npm, but this guide will walk you through installing Folktale in platforms other than Node.js.

                                        -

                                        Documentation

                                        Folktale is preferrably installed by npm, but this guide will walk you through installing Folktale in platforms other than Node.js.

                                        -
                                        -

                                        The recommended way of getting Folktale is through npm. If you don't have Node installed yet, you should download a binary from the official website or use an installer like nvm.

                                        -
                                        -

                                        NOTE
                                        Folktale requires Node 6.x+ for its development tools, but you can use a prebuilt version of Folktale in Node 4.x+.

                                        -
                                        -

                                        To install Folktale using npm, run the following in your command line:

                                        -
                                        $ npm install folktale
                                        -

                                        Table of Contents

                                        - -

                                        Folktale in Node.js

                                        -

                                        Node.js has native support for the CommonJS module system, which Folktale uses, thus in order to use Folktale you just require it:

                                        -
                                        const folktale = require('folktale');
                                        -
                                        -folktale.core.lambda.identity(1); // ==> 1
                                        -
                                        -

                                        Folktale in Electron / nw.js

                                        -

                                        Like Node.js, Electron and nw.js have native support for the CommonJS module system, so you load Folktale using require:

                                        -
                                        const folktale = require('folktale');
                                        -
                                        -folktale.core.lambda.identity(1); // ==> 1
                                        -
                                        -

                                        Folktale in the Browser

                                        -

                                        Browsers don't have native support for CommonJS modules. We still recommend using a module system (like Browserify or WebPack) and bundling your modules to distribute your application. This allows you to only load the parts of Folktale that you use, reducing the amount of data you have to send to your users.

                                        -

                                        Using Browserify

                                        -

                                        First install Browserify from npm (you should have a package.json describing your application's dependencies):

                                        -
                                        $ npm install browserify --save-dev
                                        -

                                        Then install Folktale through npm as well:

                                        -
                                        $ npm install folktale --save
                                        -

                                        Ideally, require only the Folktale modules you'll be using. This helps keeping the overall size smaller. For example, if you're using only the Maybe and compose functions, don't load the library's entry-point, just those modules:

                                        -
                                        const Maybe = require('folktale/data/maybe');
                                        -const compose = require('folktale/core/lambda/compose');
                                        -
                                        -const inc = (x) => x + 1;
                                        -const double = (x) => x * 2;
                                        -
                                        -Maybe.Just(1).map(compose(inc, double));
                                        -// ==> Maybe.Just(4)
                                        -
                                        -

                                        To compile your application, run browserify on your entry-point module (you run this from the root of your project, where your package.json is located at):

                                        -
                                        $ ./node_modules/.bin/browserify index.js > my-app.js
                                        -

                                        Finally, load my-app.js in your webpage. This file will contain all of the modules you've required in your index.js file:

                                        -
                                        <!DOCTYPE html>
                                        -<html>
                                        -  <head>(...)</head>
                                        -  <body>
                                        -    (...)
                                        -    <script src="/path/to/my-app.js"></script>
                                        -  </body>
                                        -</html>
                                        -
                                        -

                                        For more information about Browserify, check Browserify's website.

                                        -

                                        Using WebPack

                                        -

                                        First install WebPack from npm (you should have a package.json describing your application's dependencies):

                                        -
                                        $ npm install webpack --save-dev
                                        -

                                        Then install Folktale through npm as well:

                                        -
                                        $ npm install folktale --save
                                        -

                                        Ideally, require only the Folktale modules you'll be using. This helps keeping the overall size smaller. For example, if you're using only the Maybe and compose functions, don't load the library's entry-point, just those modules:

                                        -
                                        const Maybe = require('folktale/data/maybe');
                                        -const compose = require('folktale/core/lambda/compose');
                                        -
                                        -const inc = (x) => x + 1;
                                        -const double = (x) => x * 2;
                                        -
                                        -Maybe.Just(1).map(compose(inc, double));
                                        -// ==> Maybe.Just(4)
                                        -
                                        -

                                        Create a webpack.config.js in your project's root directory, containing instructions for how WebPack should build your application:

                                        -
                                        module.exports = {
                                        -  entry: './index.js',
                                        -  output: {
                                        -    filename: 'my-app.js'
                                        -  }
                                        -};
                                        -
                                        -

                                        Finally, load my-app.js in your webpage. This file will contain all of the modules you've required in your index.js file:

                                        -
                                        <!DOCTYPE html>
                                        -<html>
                                        -  <head>(...)</head>
                                        -  <body>
                                        -    (...)
                                        -    <script src="/path/to/my-app.js"></script>
                                        -  </body>
                                        -</html>
                                        -
                                        -

                                        For more information about WebPack, check WebPack's website.

                                        -

                                        Using Folktale without a module system

                                        -

                                        While the recommended way of using Folktale is with a module system, it's possible to use it without one as well. The drawback of not using a module system is that your website will have to ship the entire Folktale library to your users, even if you don't use all of its features.

                                        -

                                        To use a prebuilt version, first, download one of the prebuilt releases on GitHub. Unpack the distribution file and add the dist/folktale.min.js or dist/folktale.js file to your website. Reference this file in your HTML like any other JavaScript file:

                                        -
                                        <!DOCTYPE html>
                                        -<html>
                                        -  <head>(...)</head>
                                        -  <body>
                                        -    (...)
                                        -    <script src="/path/to/folktale.min.js"></script>
                                        -  </body>
                                        -</html>
                                        -
                                        -

                                        In your JavaScript code, the Folktale library will be available through the global variable folktale, unless you're using a CommonJS or AMD module system in your webpage:

                                        -
                                        folktale.core.lambda.identity(1);
                                        -// ==> 1
                                        -
                                        -
                                        -

                                        NOTE: -If you're using a module system in your webpage (for example, AMD in Dojo or Require.js), then Folktale will be available through that module system under folktale.

                                        -
                                        -

                                        Properties

                                        - - - - \ No newline at end of file diff --git a/docs/api/en/guides.navigating-the-folktale-repository.html b/docs/api/en/guides.navigating-the-folktale-repository.html deleted file mode 100644 index 918916c..0000000 --- a/docs/api/en/guides.navigating-the-folktale-repository.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - Navigating the Folktale repository - - - - - -

                                        Navigating the Folktale repository

                                        What all the folders and files in the Folktale repository are for.

                                        -

                                        Documentation

                                        What all the folders and files in the Folktale repository are for.

                                        -
                                        -

                                        The Folktale repository is organised as follows:

                                        -
                                          -
                                        • /folktale — Root of the project.

                                          -

                                          Configuration files:

                                          -
                                            -
                                          • .babelrc - — Configurations for the Babel compiler.
                                          • -
                                          • .eslintrc.json - — Linting rules for ESLint.
                                          • -
                                          • package.json -— Meta-data for the npm package (version, description, dependencies, etc).
                                          • -
                                          • .travis.yml -— Configuration for running automated tests in the Travis CI server.
                                          • -
                                          • .eslintignore -— A set of glob patterns for files that shouldn't be linted.
                                          • -
                                          • .npmignore -— A set of glob patterns for files that shouldn't be included in npm's packages.
                                          • -
                                          • .gitignore -— A set of glob patterns for files that shouldn't be committed to the repository.
                                          • -
                                          -
                                        • -
                                        -
                                        Documentation files:
                                        -
                                        -  - `CODE_OF_CONDUCT.md`
                                        -    — Social rules that all people in the community are expected to follow.
                                        -  - `CONTRIBUTING.md`
                                        -    — This file. A guide for people who want to contribute to Folktale.
                                        -  - `README.md`
                                        -    — Tells people what Folktale is for, how to install it, how to begin using it, where to get support, and other important information.
                                        -  - `LICENCE`
                                        -    — The licence under which Folktale is released (MIT).
                                        -  - `CONTRIBUTORS`
                                        -    — A list of all people who have contributed to Folktale.
                                        -  - `CHANGELOG.md`
                                        -    — A chronological list of changes made to the project, grouped by versions.
                                        -  - `docs/source`
                                        -    — Special markdown/YAML documentation files, separated by language.
                                        -
                                        -
                                        -
                                        -Developer tooling:
                                        -
                                        -  - `Makefile`
                                        -    — Common development tasks.
                                        -  - `tools`
                                        -    — Custom tooling written for Folktale.
                                        -  - `metamagical/`
                                        -    — A set of tools to support documentation and tests.
                                        -
                                        -
                                        -Source files:
                                        -
                                        -  - `src/`
                                        -    — The implementation of Folktale libraries, in JavaScript.
                                        -  - `test/`
                                        -    — Unit tests for Folktale, using Mocha.
                                        -
                                        -
                                        -Auto-generated files:
                                        -
                                        -  - `index.js`, `core/`, `data/`, `helpers`
                                        -    — Generated from the source code in `src/` through `make compile`. These are the library's code that gets loaded by requiring the package.
                                        -
                                        -  - `annotated/`
                                        -    — Generated from the source code in `src/` through `make compile-annotated`. Contains special annotations for the documentation tooling.
                                        -
                                        -  - `dist/`
                                        -    — Generated with `make bundle`. Distribution files for browser environments, compiled with Browserify.
                                        -
                                        -  - `docs/build/`
                                        -    — Generated from documentation files in `docs/source/` through `make compile-documentation`. Used to generate documentation and test examples in the documentation.
                                        -
                                        -  - `docs/api/`
                                        -    — Static HTML documentation, generated through `make documentation`.
                                        -
                                        -  - `node_modules/`
                                        -    — Dependencies installed by npm.
                                        -
                                        -  - `test/helpers/` and `test/specs/`
                                        -    — Generated from their `*-src/` folder through `make compile-test`. These are the test files that get actually ran by the testing tool.
                                        -
                                        -  - `test/browser/browser-tests.js`
                                        -    — Generated from `test.js` through `make compile-test`. A bundle of the entire library and test files that can be loaded in a browser.
                                        -
                                        -  - `releases/`
                                        -    — Generated through `publish`. Contains distribution packages.
                                        -

                                        Source hierarchy

                                        -

                                        The source tree is organised as a hierarchy of objects. At each level you have -an index.js file that re-exports functions and objects of that level. This -allows people to import bags of features, or a particular feature separately.

                                        -
                                          -
                                        • core — Provides the baseline for all features in Folktale, by filling the -gaps of the functionality needed for the standard data structures. The -purpose of core is to just provide enough functionality to make other -categories possible. The focus is on better data structures and composing -data structures.

                                          -
                                            -
                                          • lambda — Common combinators for functions.
                                          • -
                                          • adt — Support for algebraic data types.
                                          • -
                                          • object — Support working with objects-as-records/dictionaries.
                                          • -
                                          • string — Common operations on strings.
                                          • -
                                          • comparison — Comparisons between built-in JS values.
                                          • -
                                          • equality — Equality between built-in JS values.
                                          • -
                                          • inspecting — Textual representations of built-in JS values.
                                          • -
                                          • contracts — First and higher-order run-time contracts.
                                          • -
                                          • iterables — Lazy sequences using JS's iterable protocol.
                                          • -
                                          -
                                        • -
                                        • data — Provides implementations of data structures that are common in -functional programming.

                                          -
                                            -
                                          • conversions — Functions to convert between data types.
                                          • -
                                          • maybe — A structure for modelling the presence or absence of a value.
                                          • -
                                          • result — A structure for modelling a tagged disjunction of two values.
                                          • -
                                          • validation — A structure similar to Result, but designed for validations and supporting error aggregation.
                                          • -
                                          • task — A structure for modelling a potentially asynchronous action.
                                          • -
                                          • future — A structure for modelling an eventual value. Used by task.
                                          • -
                                          -
                                        • -
                                        -

                                        Test hierarchy

                                        -

                                        Folktale uses Mocha for testing, which expects tests to go in the test/specs-src/ -folder. Right now all test files are placed directly in that folder.

                                        -

                                        Test files are named <category>.<subcategory>.js (e.g.: core.lambda.es6), -and provide tests for all functionality defined in that category. When compiled, -this generates <category>.<subcategory>.js files in the test/specs/ folder.

                                        -

                                        Build artefacts

                                        -

                                        Most of the source code is compiled through Babel before -running. This generates what we call "build artefacts" in the project's working -directory. While these files are ignored by Git (with .gitignore rules), they -might still show up in your text editor and be somewhat confusing.

                                        -

                                        When source code is compiled (from src/), the same structure you see under -src/ is replicated under the root of the project's working directory. So, for -example, after compiling you'd have an index.js at the root, then an -core/lambda/identity.js starting at the root, and so on, and so forth.

                                        -

                                        When test cases are compiled (from test/specs-src/ and test/helpers-src/), they -generate files with the same name in the test/specs/ (and test/helpers/) folder.

                                        -

                                        Documentation files, in docs/source/ are compiled to regular JavaScript files -that add special annotations to runtime objects. When compiled, the structure in -docs/source/ is replicated in docs/build/.

                                        -

                                        You can always remove these files by running make clean from the root of the -project.

                                        -

                                        Properties

                                        Module
                                        guides
                                        Authors
                                        Authors
                                        • @robotlolita
                                        Maintainers
                                          - - - - \ No newline at end of file diff --git a/docs/api/en/guides.navigating-the-issue-tracker.html b/docs/api/en/guides.navigating-the-issue-tracker.html deleted file mode 100644 index 8b906fd..0000000 --- a/docs/api/en/guides.navigating-the-issue-tracker.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Navigating the issue tracker - - - - - -

                                          Navigating the issue tracker

                                          Describes how the issue/feature tracker is organised.

                                          -

                                          Documentation

                                          Describes how the issue/feature tracker is organised.

                                          -
                                          -

                                          Ideas and bugs live in the Github Issue tracker, and can be -visualised as a Kanban board in Waffle.io. -If you're not sure where to start, there's a selection of good first -issues -which you may want to try.

                                          -

                                          All tasks are categorised in terms of the kind of work, its scope, its -effort, its status, and its priority.

                                          -

                                          Here's what the labels mean:

                                          -
                                            -
                                          • c:* — The category labels classify the scope of the issue.
                                          • -
                                          • e:* — The effort labels define how much effort resolving a particular -issue is likely to take.
                                          • -
                                          • p:* — The priority labels define how urgent resolving a particular -issue is.
                                          • -
                                          -

                                          Kind labels:

                                          -
                                            -
                                          • k:Enhancement — The task refers to something that improves the Folktale -library, such as adding new features or making existing features easier -to use.
                                          • -
                                          • k:Error — The task refers to a problem with the Folktale library. We -consider problems not only bugs, but things like missing documentation and -confusing behaviour.
                                          • -
                                          • k:Optimisation — The task doesn't change anything about the behaviour of -Folktale, but it improves the performance of some of its components.
                                          • -
                                          • k:Discussion — Discussions about features that don't fit any of the -kinds above.
                                          • -
                                          -

                                          Status labels:

                                          -
                                            -
                                          • s:Duplicate — The issue is already covered by a separate issue, and -should be discussed there.
                                          • -
                                          • s:Invalid — The issue is not a problem in Folktale.
                                          • -
                                          • s:Won't Fix — The issue does not fit Folktale's philosophy.
                                          • -
                                          -

                                          All triaged issues will at least contain a category label and a kind label.

                                          -

                                          Properties

                                          Module
                                          guides
                                          On This Page
                                          Authors
                                          Authors
                                          • @robotlolita
                                          Maintainers
                                            - - - - \ No newline at end of file diff --git a/docs/api/en/guides.reporting-bugs.html b/docs/api/en/guides.reporting-bugs.html deleted file mode 100644 index b5469e1..0000000 --- a/docs/api/en/guides.reporting-bugs.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - Reporting bugs - - - - - -

                                            Reporting bugs

                                            Found an error in Folktale? Think the documentation is missing or confusing? Not sure how to report these? Read on.

                                            -

                                            Documentation

                                            Found an error in Folktale? Think the documentation is missing or confusing? Not sure how to report these? Read on.

                                            -
                                            -

                                            Sometimes things don't work as well as they should, or we can't make them work -the way we want, and we get frustrated by that. Both of those are situations -were we encourage you to open an issue in the GitHub issue tracker so -we can help you.

                                            -

                                            Opening a ticket is primarily a way of starting a discussion on a particular -problem. In some cases (for example, if you're not sure what the behaviour of -something should be), you might consider sticking around the -Gitter channel and talking to people about it before opening an issue, -but don't feel like you need to. Both the Gitter channel and the issue tracker -are places for discussion.

                                            -

                                            Once you've decided to open an issue, please follow these guidelines to ensure -that the conversation goes as smoothly as possible, so we can help you faster:

                                            -
                                              -
                                            • Search the issue tracker to see if someone has already reported the problem -before. This helps keep the conversation in just one place, where possible, -and benefits more people.

                                              -
                                            • -
                                            • Try to create a minimal test cases that reproduces the problem. These make -it easier for you and for us to understand what's really happening, and -what's causing the problem.

                                              -
                                            • -
                                            • Try to provide as much information about the problem as possible, and be -prepared to follow up if we ask you for clarifications on certain parts of -it in order to understand the problem better.

                                              -
                                            • -
                                            -

                                            If you're not sure how to format your bug report, here's a template you can follow:

                                            -
                                            (A short description of the problem)
                                            -
                                            -### Steps to reproduce
                                            -
                                            -(Provide, where possible, a clear set of instructions to replicate the
                                            -problem. If you can, include a minimal test case that reproduces the problem and
                                            -that we can run)
                                            -
                                            -#### Expected behaviour
                                            -
                                            -(What you expected to happen)
                                            -
                                            -#### Observed behaviour
                                            -
                                            -(What happened instead)
                                            -
                                            -### Environment
                                            -
                                            -(Describe the environment where the problem happens. This usually includes:)
                                            -
                                            -  - OS
                                            -  - JavaScript VM
                                            -  - Folktale version
                                            -
                                            -### Additional information
                                            -
                                            -(Anything else you feel relevant to the issue)
                                            -
                                            -

                                            Here's an example that uses the template above:

                                            -
                                            `constant` throws `"0 is not a function"` error when used with `Array.map`.
                                            -
                                            -### Steps to reproduce
                                            -
                                            -    const constant = require('folktale/core/lambda/constant');
                                            -    [1, 2, 3].map(constant(0));
                                            -    // => Uncaught TypeError: 0 is not a function
                                            -
                                            -#### Expected behaviour
                                            -
                                            -I expected the code above to result in the array `[0, 0, 0]`.
                                            -
                                            -#### Observed behaviour
                                            -
                                            -The code throws a type error saying `0 is not a function`.
                                            -
                                            -### Environment
                                            -
                                            -  - Folktale 2.0.0
                                            -  - Node 4.2.4
                                            -
                                            -

                                            Of course, you're not required to follow this exact template. It's there for you -to use if you want to, but it doesn't fit all possible tickets. If you're -reporting an issue with the documentation, for example, your ticket should focus -on what you feel the problem with the documentation is. Maybe the phrasing is -hard to follow, maybe there are grammatical mistakes, maybe it assumes knowledge -of some concept that's not explained anywhere else, maybe it's outdated.

                                            -

                                            Below is an example of how one could go about reporting an issue with the -documentation:

                                            -
                                            The documentation for `Data.Maybe` assumes familiarity with concepts such as
                                            -`Monad` and `Functor` that are not explained anywhere. Maybe it's immediately
                                            -obvious to those people how and when they would choose to use this data
                                            -structure, but I still don't know why I would use it after reading the
                                            -documentation.
                                            -
                                            -I should note that I am a beginner in functional programming, and I think the
                                            -documentation right now could be more clear on its motivations. More concrete
                                            -examples would help.
                                            -
                                            -

                                            Properties

                                            Module
                                            guides
                                            On This Page
                                            Authors
                                            Authors
                                            • @robotlolita
                                            Maintainers
                                              - - - - \ No newline at end of file diff --git a/docs/api/en/guides.requesting-new-features.html b/docs/api/en/guides.requesting-new-features.html deleted file mode 100644 index 5f72613..0000000 --- a/docs/api/en/guides.requesting-new-features.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Requesting new features - - - - - -

                                              Requesting new features

                                              Think Folktale should do something it doesn't yet? Read on.

                                              -

                                              Documentation

                                              Think Folktale should do something it doesn't yet? Read on.

                                              -
                                              -

                                              Folktale doesn't do everything, so more often than not you'll find something -that you wish Folktale supported but that isn't implemented yet. Maybe the -thought has never crossed our minds. This is a great opportunity to -tell us about that feature you want.

                                              -

                                              Before you open an issue in the GitHub tracker, however, it's important to -consider whether the feature you're proposing really belongs in Folktale. Here -are a few guidelines for things that would be a good fit for Folktale:

                                              -
                                                -
                                              • The feature is an algebraic data structure, with well-defined -mathematical laws governing its behaviour. Folktale is a functional -library greatly inspired by Abstract Algebra and Category Theory, and it -avoids law-less functionality where possible in order to make abstractions -safer and more composable.

                                                -
                                              • -
                                              • The feature is an utility function that covers a recurrent -pattern. Sometimes the abstractions provided in Folktale are general, but -still require some boilerplate when doing common things with it. Utility -functions that avoid this boilerplate by providing the feature out of the -box are a great fit.

                                                -
                                              • -
                                              -

                                              If you're in doubt on whether the feature you have in mind fits Folktale or not, -open an issue anyway, that way we can start a discussion about it. You can also -ask in the Gitter channel.

                                              -

                                              When you open an issue, it's important to describe clearly what the missing -feature is, and why it is important to have this feature. Examples are a great -way to present the feature and show how it would look like when implemented.

                                              -

                                              If you're not sure about how to format it, you can follow this template:

                                              -
                                              (A short description of what the functionality is)
                                              -
                                              -    (An example showing how one would use the functionality)
                                              -
                                              -### Why?
                                              -
                                              -(Describe why the functionality is important to have in Folktale)
                                              -
                                              -### Additional resources
                                              -
                                              -(If there are any materials relevant to the suggestion — a paper, a talk on the
                                              -subject, etc. you can provide them here)
                                              -
                                              -

                                              Here's an example of a feature request using this template:

                                              -
                                              I would like to have a `.concat` method for `Data.Validation`.
                                              -
                                              -    const v1 = Validation.Failure(1);
                                              -    const v2 = Validation.Failure("error");
                                              -    v1.concat(v2)
                                              -    // => Validation.Failure([1, "error"])
                                              -
                                              -
                                              -### Why?
                                              -
                                              -Validations can already aggregate failures through the applicative instance, but
                                              -this requires lifting all failures into a semigroup (like Array), and
                                              -constructing a curried function with N arguments to handle the Success case. So,
                                              -while one can achieve the same as the example above by using `.ap`, it requires
                                              -much more effort.
                                              -
                                              -We often have to aggregate unrelated failures. Some of these failures might not
                                              -have been lifted into a semigroup yet. So we'd like a simpler function that only
                                              -provides the failure aggregation part.
                                              -
                                              -

                                              Properties

                                              Module
                                              guides
                                              On This Page
                                              Authors
                                              Authors
                                              • @robotlolita
                                              Maintainers
                                                - - - - \ No newline at end of file diff --git a/docs/api/en/guides.setting-up-a-development-environment.html b/docs/api/en/guides.setting-up-a-development-environment.html deleted file mode 100644 index 918cb30..0000000 --- a/docs/api/en/guides.setting-up-a-development-environment.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - Setting up a development environment - - - - - -

                                                Setting up a development environment

                                                A step-by-step guide to set up a development environment for working on Folktale.

                                                -

                                                Documentation

                                                A step-by-step guide to set up a development environment for working on Folktale.

                                                -
                                                -

                                                Configuring a development environment for Folktale is currently a little bit -more complicated than it should in some systems, but this guide should help -you achieve that anyway.

                                                -

                                                Git

                                                -

                                                First of all, you'll have to make sure you have Git -installed. Folktale uses Git repositories, and while while you can use things -like hg-git to interact with the repository from -Mercurial, we can't support that.

                                                -

                                                The Git website has a list of GUI clients for Git, if you're not comfortable -using it from the command line.

                                                -

                                                Node

                                                -

                                                Next you'll need to install Node.js. The website -provides binaries for all supported platforms. All newer versions of Node come -with npm as well, which you'll use to pull the dependencies of the project.

                                                -

                                                Note that Folktale requires at least Node 4.x, so if you have an older version -you'll need to upgrade.

                                                -

                                                Make

                                                -

                                                Folktale uses Make as its build system, and also relies on some common *NIX -tools, like find. Because of this, it might be harder to configure a -development environment for Windows.

                                                -

                                                Below are instructions to install Make on common systems:

                                                -
                                                -

                                                TODO
                                                Provide instructions for OS/X and *BSD systems.

                                                -
                                                -

                                                Debian/Ubuntu (Linux):

                                                -
                                                $ apt-get install build-essential
                                                -

                                                Arch (Linux):

                                                -
                                                $ pacman -S base-devel
                                                -

                                                Fedora / Enterprise Linux:

                                                -
                                                $ yum install "Development Tools"
                                                -

                                                Windows:

                                                -
                                                  -
                                                1. Download the latest version of GnuWin32. This should be something like GetGnuWin32-*.exe;
                                                2. -
                                                3. Execute the application you just downloaded. You have to accept the licence to proceed;
                                                4. -
                                                5. Select a folder to extract the components to;
                                                6. -
                                                7. Run download.bat from the folder you extracted the components to;
                                                8. -
                                                9. Finally, run install.bat from that folder.
                                                10. -
                                                -

                                                Cloning and initialising the repository

                                                -

                                                The first thing you'll want to do is -forking Folktale. This means -you get a clone of the entire project that you have rights to change as you -wish. Once you have forked Folktale, you can clone your fork:

                                                -
                                                $ git clone https://github.com/YOUR_GITHUB_USERNAME/folktale.git
                                                -
                                                -

                                                This will create a folktale folder containing all of the code in the -project. The first thing you need to do is move in that folder and install all -of the dependencies and development tools that Folktale uses:

                                                -
                                                $ cd folktale
                                                -$ npm install
                                                -# Some of the tools are in a git subrepo
                                                -$ git submodule init
                                                -$ git submodule update
                                                -$ make tools
                                                -
                                                -

                                                Properties

                                                Module
                                                guides
                                                Authors
                                                Authors
                                                • @robotlolita
                                                Maintainers
                                                  - - - - \ No newline at end of file diff --git a/docs/api/en/guides.type-notation-used-in-signatures.html b/docs/api/en/guides.type-notation-used-in-signatures.html deleted file mode 100644 index 0173a0f..0000000 --- a/docs/api/en/guides.type-notation-used-in-signatures.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - Type notation used in signatures - - - - - -

                                                  Type notation used in signatures

                                                  In order to concisely describe what to expect of a piece of functionality, Folktale uses its own type notation. This guide describes the notation used.

                                                  -

                                                  Documentation

                                                  In order to concisely describe what to expect of a piece of functionality, Folktale uses its own type notation. This guide describes the notation used.

                                                  -
                                                  -

                                                  JavaScript is a dynamically typed language, meaning that we generally have no way of adding type annotation to functionality, and there's also no way of checking them. Tools like TypeScript and Flow help by adding their own type system, so that information can be provided and checked, but ultimately they're not powerful enough to describe some of the features Folktale uses.

                                                  -

                                                  We still think that types, even when not checked, are a powerful tool for concisely describing what one can expect of a piece of functionality. It answer questions such as "what does this piece of functionality expect me to provide?", and "what can I get out of this piece of functionality?", but also things like "can I combine this and that piece of functionality?", "is there anything I have to watch out for when using this functionality?", and others.

                                                  -

                                                  Since those are all valuable questions to answer, every functionality in Folktale describes its "type", and this document describes that particular notation.

                                                  -

                                                  Type system overview

                                                  -

                                                  The system Folktale uses is a structural type system. That means that two types are considered compatible if they have the same structure (roughly, if two objects have the same properties, they're "compatible"). This closely models Object-Oriented and dynamic language idioms, but is also commonly used in Functional languages. Folktale uses some OO concepts and some FP concepts, so this kind of system fits.

                                                  -

                                                  The document uses the term x matches y to mean that the object or type y is compatible with the object or type x. So, if we say that "Boolean matches a JS primitive boolean", we're pretty much saying that values like true or false are compatible with the type Boolean.

                                                  -

                                                  In a type system, values may only occur where a compatible type is specified. That is, if we have a function like:

                                                  -
                                                  /*~ type: (Number, Number) => Number */
                                                  -function add(a, b) {
                                                  -  return a + b;
                                                  -}
                                                  -
                                                  -

                                                  Then the type annotation describes that both of its parameters must be compatible with a JavaScript number, and the value it returns will also be compatible with a number. So:

                                                  -
                                                  // OK:
                                                  -add(1, 2); // => 3  (all numbers)
                                                  -
                                                  -// Not OK:
                                                  -add(1, "2"); // "2" is not compatible with Number
                                                  -
                                                  -

                                                  Basic types

                                                  -

                                                  Primitive types

                                                  -

                                                  A primitive type is the most basic type in the system. Each of the following types is unique, and reflects JavaScript primitive values:

                                                  -
                                                    -
                                                  • Undefined — matches the value undefined
                                                  • -
                                                  • Null — matches the value null
                                                  • -
                                                  • Number — matches any primitive numeric value (e.g.: 1)
                                                  • -
                                                  • String — matches any primitive textual value (e.g.: "foo")
                                                  • -
                                                  • Boolean — matches any primitive boolean value (e.g.: true)
                                                  • -
                                                  -

                                                  The Any type

                                                  -

                                                  The Any type is a special type that all JavaScript values are compatible with.

                                                  -
                                                  type
                                                  -  Any
                                                  -
                                                  -// Matches the type: EVERYTHING
                                                  -1;
                                                  -'foo';
                                                  -null;
                                                  -{ a: 1 };
                                                  -...
                                                  -
                                                  -

                                                  Tuple types

                                                  -

                                                  A tuple type is a sequence of types with a fixed size. Think of it as an array that is always guaranteed to have the same number of elements, and in the same order. In order to describe a tuple type we use the , operator:

                                                  -
                                                  type
                                                  -  Number, String
                                                  -
                                                  -// Matches the type
                                                  -[1, "hello"];
                                                  -
                                                  -// Does not match the type
                                                  -[1];
                                                  -["hello", 1];
                                                  -
                                                  -

                                                  Record types

                                                  -

                                                  A record type is a collection of key/type pairs that is matched substructurally. That is, objects are considered compatible with the type if they contain at least those keys, and whose values are compatible with the type defined for it.

                                                  -

                                                  For example:

                                                  -
                                                  type
                                                  -  { x: Number, y: Number }
                                                  -
                                                  -// Matches the type
                                                  -{ x: 1, y: 2 };
                                                  -{ x: 1, y: 2, z: 3 };
                                                  -
                                                  -// Does not match the type
                                                  -{ x: '1', y: 2 }; // `x` is a String
                                                  -{ x: 1, z: 3 };   // missing `y`
                                                  -
                                                  -

                                                  Function types

                                                  -

                                                  A function type describes the input and output of a function, alongside with its effects (if any).

                                                  -

                                                  In the simplest form, the type of a function describes the types of its parameters, and the type of its return value:

                                                  -
                                                  // A function with no arguments
                                                  -type
                                                  -  () => Number
                                                  -
                                                  -// Matches the type
                                                  -() => 1;
                                                  -
                                                  -// Does not match the type
                                                  -(a) => 1;   // has one parameter
                                                  -() => '1';  // returns a string
                                                  -
                                                  -
                                                  -// A function with some arguments
                                                  -type
                                                  -  (Number, Number) => Number
                                                  -
                                                  -// Matches the type
                                                  -(a, b) => a + b;
                                                  -
                                                  -// Does not match the type
                                                  -(a, b, c) => a + b + c;  // has three parameters
                                                  -(a) => a;                // has one parameter
                                                  -(a, ...b) => a;          // has a variadic parameter
                                                  -(a, b) => a.toString();  // returns a string
                                                  -
                                                  -

                                                  Sometimes functions in JavaScript take an arbitrary number of arguments. These functions are called "variadic", and they are explicitly marked in the type as such with the ... operator:

                                                  -
                                                  type
                                                  -  (Number, ...String) => String
                                                  -
                                                  -// Matches the type
                                                  -(chars, ...texts) => texts.map(x => x.slice(0, chars)).join('');
                                                  -(chars, texts) => '';
                                                  -
                                                  -// Does not match the type
                                                  -(chars) => chars;        // has one parameter
                                                  -(chars, ...texts) => 1;  // returns a number
                                                  -
                                                  -

                                                  Sometimes JavaScript functions do something outside of just taking in and returning values, and it might be nice to capture those. These things are commonly called "effects", and to capture them we have what's called an "effects list", which describes the effects a function has. Examples of effects are things like throwing an error, or mutating an object.

                                                  -

                                                  For example:

                                                  -
                                                  type
                                                  -  (Number) => Number :: throws RangeError
                                                  -
                                                  -// Matches the type
                                                  -(n) => {
                                                  -  if (n < 1) {
                                                  -    throw new RangeError(`Expected a number >= 1, got ${n}`);
                                                  -  }
                                                  -  return 5 / n;
                                                  -};
                                                  -
                                                  -
                                                  -// Does not match the type
                                                  -(n) => {
                                                  -  if (n < 1) {
                                                  -    throw new TypeError(`Invalid value: ${n}`);
                                                  -  }
                                                  -  return 3;
                                                  -}; // throws a TypeError, not a RangeError
                                                  -
                                                  -
                                                  -(n) => 3; // does not throw
                                                  -
                                                  -

                                                  Effects are discussed in more details later in this document.

                                                  -

                                                  Finally, a function type may accept a special parameter, accessible as this inside of that function. This particular object-oriented feature is captured with the . operator:

                                                  -
                                                  type
                                                  -  ({ name: String }).() => { name: String }
                                                  -
                                                  -// Matches the type
                                                  -function () {
                                                  -  return { name: this.name.toUpperCase() };
                                                  -}
                                                  -
                                                  -function () {
                                                  -  this.name = this.name.toUpperCase();
                                                  -  return this;
                                                  -}
                                                  -
                                                  -// Does not match the type
                                                  -function (person) {
                                                  -  return { name: person.name.toUpperCase() };
                                                  -} // uses a positional parameter, not a this parameter
                                                  -
                                                  -function () {
                                                  -  this.name = this.name.toUpperCase();
                                                  -} // does not return an object with a 'name' field
                                                  -
                                                  -

                                                  Type combinations

                                                  -

                                                  Union types

                                                  -

                                                  An union type describes something that matches any of the described types. It uses the oroperator:

                                                  -
                                                  type
                                                  -  String or Null
                                                  -
                                                  -// Matches the type
                                                  -'foo';
                                                  -null;
                                                  -
                                                  -// Does not match the type
                                                  -1;
                                                  -false;
                                                  -undefined;
                                                  -
                                                  -

                                                  Intersection types

                                                  -

                                                  An intersection type describes something that has many different characteristics at the same time. A value still must possess all of these characteristics in order to be compatible with the type. Intersections use the andoperator.

                                                  -

                                                  Some types are nonsensical with intersections, for example String and Null describes a value that is, at the same time, null and a String. Such value does not exist in JavaScript.

                                                  -

                                                  On the other hand, intersection types are useful for describing function types where they may behave differently depending on the parameters given to them. For example:

                                                  -
                                                  type
                                                  -    (Number) => Number
                                                  -and (String) => String
                                                  -
                                                  -// Matches the type
                                                  -(value) => {
                                                  -  if (typeof value === 'number') {
                                                  -    return value + 1;
                                                  -  } else {
                                                  -    return value + '!';
                                                  -  }
                                                  -};
                                                  -
                                                  -(value) => value; // supports at least the two cases
                                                  -
                                                  -
                                                  -// Does not match the type
                                                  -(value) => value + 1;   // only supports (Number) => Number
                                                  -(value) => value + '!'; // only supports (String) => String
                                                  -
                                                  -

                                                  Type aliases

                                                  -

                                                  A type alias may be defined in two ways. First, any type may be given a name by the type keyword:

                                                  -
                                                  type Point2d = { x: Number, y: Number }
                                                  -
                                                  -

                                                  The name on the left side of the = and the type on the right side are exact the same, but naming more complex types helps with making some type expressions easier to understand, by reducing the amount of information one has to understand at once.

                                                  -

                                                  The other way of providing a type alias is with the : operator in a type expression:

                                                  -
                                                  // This:
                                                  -(a: Number, a) => a
                                                  -
                                                  -// Is the same as:
                                                  -(Number, Number) => Number
                                                  -
                                                  -

                                                  With record types, an alias is already created for each field, but you may provide an additional alias:

                                                  -
                                                  // This:
                                                  -{ x: (the_x: Number), y: x, z: the_x }
                                                  -
                                                  -// Is the same as:
                                                  -{ x: Number, y: Number, z: Number }
                                                  -
                                                  -

                                                  Type variables

                                                  -

                                                  Sometimes a functionality uses an arbitrary type, and we want to make sure that this arbitrary type is the same everywhere. For example, if we write:

                                                  -
                                                  type
                                                  -  (Any) => Any
                                                  -
                                                  -

                                                  Then (n) => n is compatible with it, but so is (n) => 1. There's no requirement that the type of the input be the exact same as the type of the output. In order to fix that, we can use type variables:

                                                  -
                                                  type
                                                  -  forall a: (a) => a
                                                  -
                                                  -// Matches the type
                                                  -(n) => n
                                                  -
                                                  -// Does not match the type
                                                  -(n) => n + n;  // `a` is not any known type, we can't use it
                                                  -(n) => 1;      // 1 is not compatible with abstract type `a`
                                                  -
                                                  -

                                                  Note that now we introduce a type variable a with forall. More variables can be introduced by separating them with commas. A type variable is an abstract type, so it only matches itself, and there's no way of constructing a value of such type, or operating on such type. The only possible operations are receiving such value as a parameter, and passing such value as an argument.

                                                  -

                                                  Parameterised types

                                                  -

                                                  Some types (like Array) contain other types, and ideally we should be able to specify which types they contain. This uses the type variables described early:

                                                  -
                                                  type Tuple a b = (a, b)
                                                  -
                                                  -[1, "foo"];     // Matches "Tuple Number String"
                                                  -["foo", "foo"]; // Matches "Tuple String String"
                                                  -
                                                  -

                                                  In order to use these types, we just juxtapose the types that will replace the variables to the type name. An array, for example, is a container of elements of type a, so:

                                                  -
                                                  type
                                                  -  Array Number
                                                  -
                                                  -// Matches the type
                                                  -[1, 2, 3];
                                                  -[1];
                                                  -[];
                                                  -
                                                  -// Does not match the type
                                                  -[1, '2', 3];  // Number or String
                                                  -['2'];        // String
                                                  -
                                                  -

                                                  Type constraints

                                                  -

                                                  A type constraint restricts an existing type in some way. Commonly this is used to specify some characteristics for abstract types (see the section on Type Parameters), so people know what they can do with those values.

                                                  -

                                                  Constraints are defined in the where clause. Currently, the only constraint supported by this notation is the A is B, which restricts A to objects that also implement the type described by B:

                                                  -
                                                  type Semigroup a = {
                                                  -  concat: (a).(a) => a
                                                  -}
                                                  -
                                                  -type
                                                  -  forall S, a: (S a).(S a) => S a
                                                  -  where S is Semigroup
                                                  -
                                                  -// Matches the type
                                                  -function concat(a, b) {
                                                  -  return a.concat(b);
                                                  -}
                                                  -
                                                  -

                                                  A summary of the types

                                                  -
                                                  // -- Primitives
                                                  -type Null         // matches null
                                                  -type Undefined    // matches undefined
                                                  -type String       // matches 'string'
                                                  -type Boolean      // matches true
                                                  -type Number       // matches 1
                                                  -
                                                  -type None = Null or Undefined
                                                  -type Void = Undefined
                                                  -
                                                  -
                                                  -// -- Built-ins
                                                  -type RegExp
                                                  -type Symbol
                                                  -type Date
                                                  -type Int8Array
                                                  -type Uint8Array
                                                  -type Uint8ClampedArray
                                                  -type Int16Array
                                                  -type Uint16Array
                                                  -type Int32Array
                                                  -type Uint32Array
                                                  -type Float32Array
                                                  -type Float64Array
                                                  -type ArrayBuffer
                                                  -type DataView
                                                  -type Proxy
                                                  -
                                                  -type Error
                                                  -type EvalError      <: Error
                                                  -type InternalError  <: Error
                                                  -type RangeError     <: Error
                                                  -type ReferenceError <: Error
                                                  -type SyntaxError    <: Error
                                                  -type TypeError      <: Error
                                                  -type URIError       <: Error
                                                  -
                                                  -type Function = (...Any) => Any
                                                  -
                                                  -
                                                  -// -- Parameterised types
                                                  -type Object values
                                                  -type Array elements
                                                  -type Map keys values
                                                  -type Set values
                                                  -type WeakMap keys values
                                                  -type WeakSet keys values
                                                  -type Promise value error
                                                  -type Generator value
                                                  -
                                                  -
                                                  -// -- Effects
                                                  -effect throws types
                                                  -effect mutates types
                                                  -effect io
                                                  -
                                                  -

                                                  Properties

                                                  - - - - \ No newline at end of file diff --git a/docs/api/en/guides.when-will-folktale-2-be-released-.html b/docs/api/en/guides.when-will-folktale-2-be-released-.html deleted file mode 100644 index 4a34c49..0000000 --- a/docs/api/en/guides.when-will-folktale-2-be-released-.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - When will Folktale 2 be released? - - - - - -

                                                  When will Folktale 2 be released?

                                                  A stable version of Folktale 2 should be released somewhere from April to May of 2017, although that will depend on me having free time. You can check what's blocking the release on the v2.0.0 milestone on GitHub.

                                                  -

                                                  Documentation

                                                  A stable version of Folktale 2 should be released somewhere from April to May of 2017, although that will depend on me having free time. You can check what's blocking the release on the v2.0.0 milestone on GitHub.

                                                  -

                                                  Properties

                                                  Module
                                                  guides
                                                  On This Page
                                                  Authors
                                                  Authors
                                                  • @robotlolita
                                                  Maintainers
                                                    - - - - \ No newline at end of file diff --git a/docs/api/en/guides.why-do-i-get-an-error-saying----apply--is-not-a-function--.html b/docs/api/en/guides.why-do-i-get-an-error-saying----apply--is-not-a-function--.html deleted file mode 100644 index 0600723..0000000 --- a/docs/api/en/guides.why-do-i-get-an-error-saying----apply--is-not-a-function--.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - Why do I get an error saying "`.apply` is not a function"? - - - - - -

                                                    Why do I get an error saying "`.apply` is not a function"?

                                                    Short answer: Folktale unrolls application of curried functions, so if you pass more arguments than what a function takes, that function might try passing some of those arguments to its return value.

                                                    -

                                                    Documentation

                                                    Short answer: Folktale unrolls application of curried functions, so if you pass more arguments than what a function takes, that function might try passing some of those arguments to its return value.

                                                    -

                                                    JavaScript makes heavy use of variadic functions (functions that may receive a varying number of arguments, rather than a fixed one). Meanwhile, functional programming makes heavy use of a technique called currying. These two are largely incompatible, as currying relies on functions taking exactly one argument, and returning either the result of the computation (all dependencies have been gathered), or a new curried function to gather more arguments.

                                                    -

                                                    Both Folktale 1 and Folktale 2 use currying in its functions. Due to the problems with variadic functions, currying is avoided by default in Folktale 2, but you may still run into them. The core of the issue lies within the effort Folktale makes to allow composing curried functions arbitrarily, through unrolling function application. This is done so curried functions may interact seamlessly with JavaScript's regular functions that may know nothing about currying:

                                                    -
                                                    // math3 takes exactly 3 arguments, 1 at a time
                                                    -const math3 = curry(3, (a, b, c) => a - b + c);
                                                    -
                                                    -math3(4)(2)(1); // ==> 3
                                                    -
                                                    -// flip knows nothing about currying (it passes more than one argument)
                                                    -const flip = (f) => (a, b) => f(b, a);
                                                    -
                                                    -flip(math3(4))(1, 2); // ==> math3(4)(2, 1)
                                                    -
                                                    -

                                                    Now, if Folktale forced curried functions to take exactly one argument at a time, then math3(4)(2, 1) would ignore the second argument, and thus instead of the expected result, 3, you'd get back a function that expects one more argument. This is awkward in JavaScript, so instead Folktale's curry creates functions that unroll their application. That is:

                                                    -
                                                        math3(4, 2, 1)
                                                    -=== math3(4, 2)(1) or math3(4)(2, 1)
                                                    -=== math3(4)(2)(1)
                                                    -
                                                    -

                                                    It takes those many arguments and applies them one by one, until they're all passed to the functions your curried one may return. The new docs have a more detailed description of how this works. This means that our flip(maths(4))(1, 2) works, even though flip was not written for curried functions. That's great.

                                                    -

                                                    But what happens when we provide more arguments than what a curried function can take? Well, it depends. If you're using Folktale 1's core.lambda/curry, then those additional arguments are passed down to the resulting function regardless:

                                                    -
                                                    flip(math3(4))(1, 2)
                                                    -// ==> math3(4)(2, 1)
                                                    -// ==> math3(4)(2)(1) 
                                                    -// ==> 3
                                                    -
                                                    -flip(math3(4, 2))(1, 3)
                                                    -// ==> math3(4, 2)(1, 3) 
                                                    -// ==> math3(4)(2)(1)(3) 
                                                    -// ==> 3(3) 
                                                    -// ==> TypeError: (3).apply(...) is not a function
                                                    -
                                                    -

                                                    That's… not great. This happens quite often in JavaScript because most functions are variadic, so JavaScript APIs just pass a bunch of arguments that your function can ignore by simply not declaring them in its signature. Array#map is a good example:

                                                    -
                                                    [1, 2, 3].map((element, index, array) => element + 1);
                                                    -// ==> [2, 3, 4]
                                                    -
                                                    -// This is also fine:
                                                    -[1, 2, 3].map((element) => element + 1);
                                                    -// ==> [2, 3, 4]
                                                    -
                                                    -

                                                    .map is still passing 3 arguments to the second function, so the number of arguments passed is still 3 even if the function declares no intention of accessing the other 2. Folktale 2 mitigates this a bit. The application is only unrolled if the resulting function has been marked as a Folktale curried function. This way:

                                                    -
                                                    flip(math3(4))(1, 2)
                                                    -// ==> math3(4)(2, 1)
                                                    -// ==> math3(4)(2)(1) 
                                                    -// ==> 3
                                                    -
                                                    -flip(math3(4, 2))(1, 3)
                                                    -// ==> math3(4, 2)(1, 3) 
                                                    -// ==> math3(4)(2)(1) ^-- ignored as 3 is not a Folktale curried fn
                                                    -// ==> 3
                                                    -
                                                    -

                                                    Properties

                                                    Module
                                                    guides
                                                    On This Page
                                                    Authors
                                                    Authors
                                                    • @robotlolita
                                                    Maintainers
                                                      - - - - \ No newline at end of file diff --git a/docs/api/en/guides.why-is-there-no---chain--for-validation-.html b/docs/api/en/guides.why-is-there-no---chain--for-validation-.html deleted file mode 100644 index 960cfe1..0000000 --- a/docs/api/en/guides.why-is-there-no---chain--for-validation-.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - Why is there no `.chain` for Validation? - - - - - -

                                                      Why is there no `.chain` for Validation?

                                                      Short answer: the way Validation's .ap method works makes it impossible to implement the Monad interface (.chain). You might either want to use Either/Result, or rethink how you're approaching the problem.

                                                      -

                                                      Documentation

                                                      Short answer: the way Validation's .ap method works makes it impossible to implement the Monad interface (.chain). You might either want to use Either/Result, or rethink how you're approaching the problem.

                                                      -

                                                      Validation and Either/Result are very similar types, but while Either/Result have .chain and .ap, Validation only has .ap. This confuses people expecting to use Validation to sequence things that may fail.

                                                      -
                                                        -
                                                      • Validation: A data structure for aggregating errors;
                                                      • -
                                                      • Result/Either: A data structure for representing results of computations and sequencing them;
                                                      • -
                                                      -

                                                      The new documentation explains these similarities and differences very concisely, and likens the Either/Result + .chain to JavaScript's exceptions and the ; operator. Either/Result, Future, and Task all have Monad implementations that could be understood in terms of ;. That is, a regular code like var x = doX(); doY() would be equivalent to doX().chain((x) => doY()) if using the Monad implementation of those data structures.

                                                      -

                                                      Validation is a bit different. It's not designed to sequence computations like that, but to aggregate failures. A common use case is validating a form submission or checking if a data structure matches a schema. In those cases you don't really check the first field, and then move to checking the next one only if the first one succeeds. The checks are largely independent, so you just check all of them separately, then combine them, so you can get all of the ones that have failed.

                                                      -

                                                      The way Validation combines these independent checks is through its Applicative implementation, or the .ap method. It works like this:

                                                      -
                                                      Success(x) ap Success(y) => Success(x(y))
                                                      -Failure(x) ap Success(y) => Failure(x)
                                                      -Success(x) ap Failure(y) => Failure(y)
                                                      -Failure(x) ap Failure(y) => Failure(x + y)
                                                      -

                                                      Out of these four cases, the last one is the interesting one. If we have two Failures, and we apply them together, we get a new Failure that is the combination of both of their values (we combine them through the .concat method!). That is, if we have the following code:

                                                      -
                                                      Failure('hello').ap(Failure(', ')).ap(Failure('world!'));
                                                      -
                                                      -

                                                      We get:

                                                      -
                                                      Failure('hello'.concat(', ').concat('world!'));
                                                      -
                                                      -

                                                      This is in line with the goal of combining all of the errors (as in the form validation example), but how exactly does this prevent Validation from having a .chain method? It's more that Validation can't implement Monad than it being unable to have a .chain method, but it so happens that in Fantasy Land, adding a .chain method when you have a .of method is considered an implementation of Monad. And if you implement Monad, turns out your methods have to satisfy some requirements (so people can write generic code that doesn't behave weirdly here and there). The requirement that matters here is this one:

                                                      -
                                                      V1.map(x => y => [x, y]).ap(V2) = V1.chain(x => V2.map(y => [x, y]));
                                                      -
                                                      -

                                                      So, if you implement Monad and Applicative, then the code on the left has to be equivalent (i.e.: do the same thing) as the code on the right. If we were to implement .chain for Validation, it would look like this:

                                                      -
                                                      Success(x) chain f => f(x)        -- `f` has to return a Validation
                                                      -Failure(x) chain f => Failure(x)
                                                      -

                                                      Quite simple, right? But remember our definition of .ap? Let's compare some results and see why these aren't equivalent:

                                                      -
                                                      Success('1').chain(x => Success('2').map(y => x + y))        // ==> Success('12')
                                                      -Success(x => y => x + y).ap(Success('1')).ap(Success('2'))   // ==> Success('12')
                                                      -
                                                      -Success('1').chain(x => Failure('2').map(y => x + y))        // ==> Failure('2')
                                                      -Success(x => y => x + y).ap(Success('1')).ap(Failure('2'))   // ==> Failure('2')
                                                      -
                                                      -Failure('1').chain(x => Success('2').map(y => x + y))        // ==> Failure('1')
                                                      -Success(x => y => x + y).ap(Failure('1')).ap(Success('2'))   // ==> Failure('1')
                                                      -
                                                      -Failure('1').chain(x => Failure('2').map(y => x + y))        // ==> Failure('1')
                                                      -Success(x => y => x + y).ap(Failure('1')).ap(Failure('2'))   // ==> Failure('12')
                                                      -
                                                      -

                                                      Oops. The last case doesn't behave quite the same. Since the .chain method can't execute the function to get the other Failure, the only thing it can do is return the Failure it's got. Meanwhile, .ap can compare both values and decide how to combine them. But this combining makes their behaviours incompatible, and thus one's got to decide whether they want the sequential part, or the combining part.

                                                      -

                                                      Since you're likely to need both in you application, Folktale divides that in Either/Result (the sequential part), and Validation (the combining part). Starting with Folktale 2, you can easily convert between the two with Result#toValidation() and Validation#toResult(). It's possible to write equivalent conversion functions in Folktale 1, but none is provided out of the box.

                                                      -

                                                      Properties

                                                      Module
                                                      guides
                                                      On This Page
                                                      Authors
                                                      Authors
                                                      • @robotlolita
                                                      Maintainers
                                                        - - - - \ No newline at end of file diff --git a/docs/api/en/prism.css b/docs/api/en/prism.css deleted file mode 100644 index d806ad7..0000000 --- a/docs/api/en/prism.css +++ /dev/null @@ -1,139 +0,0 @@ -/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+abap+actionscript+ada+apacheconf+apl+applescript+asciidoc+aspnet+autoit+autohotkey+bash+basic+batch+c+brainfuck+bro+bison+csharp+cpp+coffeescript+ruby+css-extras+d+dart+diff+docker+eiffel+elixir+erlang+fsharp+fortran+gherkin+git+glsl+go+graphql+groovy+haml+handlebars+haskell+haxe+http+icon+inform7+ini+j+jade+java+json+julia+keyman+kotlin+latex+less+livescript+lolcode+lua+makefile+markdown+matlab+mel+mizar+monkey+nasm+nginx+nim+nix+nsis+objectivec+ocaml+oz+parigp+parser+pascal+perl+php+php-extras+powershell+processing+prolog+properties+protobuf+puppet+pure+python+q+qore+r+jsx+rest+rip+roboconf+crystal+rust+sas+sass+scss+scala+scheme+smalltalk+smarty+sql+stylus+swift+tcl+textile+twig+typescript+verilog+vhdl+vim+wiki+xojo+yaml */ -/** - * prism.js default theme for JavaScript, CSS and HTML - * Based on dabblet (http://dabblet.com) - * @author Lea Verou - */ - -code[class*="language-"], -pre[class*="language-"] { - color: black; - background: none; - text-shadow: 0 1px white; - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - - -moz-tab-size: 4; - -o-tab-size: 4; - tab-size: 4; - - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} - -pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, -code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { - text-shadow: none; - background: #b3d4fc; -} - -pre[class*="language-"]::selection, pre[class*="language-"] ::selection, -code[class*="language-"]::selection, code[class*="language-"] ::selection { - text-shadow: none; - background: #b3d4fc; -} - -@media print { - code[class*="language-"], - pre[class*="language-"] { - text-shadow: none; - } -} - -/* Code blocks */ -pre[class*="language-"] { - padding: 1em; - margin: .5em 0; - overflow: auto; -} - -:not(pre) > code[class*="language-"], -pre[class*="language-"] { - background: #f5f2f0; -} - -/* Inline code */ -:not(pre) > code[class*="language-"] { - padding: .1em; - border-radius: .3em; - white-space: normal; -} - -.token.comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: slategray; -} - -.token.punctuation { - color: #999; -} - -.namespace { - opacity: .7; -} - -.token.property, -.token.tag, -.token.boolean, -.token.number, -.token.constant, -.token.symbol, -.token.deleted { - color: #905; -} - -.token.selector, -.token.attr-name, -.token.string, -.token.char, -.token.builtin, -.token.inserted { - color: #690; -} - -.token.operator, -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string { - color: #a67f59; - background: hsla(0, 0%, 100%, .5); -} - -.token.atrule, -.token.attr-value, -.token.keyword { - color: #07a; -} - -.token.function { - color: #DD4A68; -} - -.token.regex, -.token.important, -.token.variable { - color: #e90; -} - -.token.important, -.token.bold { - font-weight: bold; -} -.token.italic { - font-style: italic; -} - -.token.entity { - cursor: help; -} - diff --git a/docs/api/en/prism.js b/docs/api/en/prism.js deleted file mode 100644 index af241a8..0000000 --- a/docs/api/en/prism.js +++ /dev/null @@ -1,120 +0,0 @@ -/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+abap+actionscript+ada+apacheconf+apl+applescript+asciidoc+aspnet+autoit+autohotkey+bash+basic+batch+c+brainfuck+bro+bison+csharp+cpp+coffeescript+ruby+css-extras+d+dart+diff+docker+eiffel+elixir+erlang+fsharp+fortran+gherkin+git+glsl+go+graphql+groovy+haml+handlebars+haskell+haxe+http+icon+inform7+ini+j+jade+java+json+julia+keyman+kotlin+latex+less+livescript+lolcode+lua+makefile+markdown+matlab+mel+mizar+monkey+nasm+nginx+nim+nix+nsis+objectivec+ocaml+oz+parigp+parser+pascal+perl+php+php-extras+powershell+processing+prolog+properties+protobuf+puppet+pure+python+q+qore+r+jsx+rest+rip+roboconf+crystal+rust+sas+sass+scss+scala+scheme+smalltalk+smarty+sql+stylus+swift+tcl+textile+twig+typescript+verilog+vhdl+vim+wiki+xojo+yaml */ -var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(v instanceof a)){u.lastIndex=0;var b=u.exec(v),k=1;if(!b&&h&&m!=r.length-1){if(u.lastIndex=y,b=u.exec(e),!b)break;for(var w=b.index+(g?b[1].length:0),_=b.index+b[0].length,A=m,S=y,P=r.length;P>A&&_>S;++A)S+=(r[A].matchedStr||r[A]).length,w>=S&&(++m,y=S);if(r[m]instanceof a||r[A-1].greedy)continue;k=A-m,v=e.slice(y,S),b.index-=y}if(b){g&&(f=b[1].length);var w=b.index+f,b=b[0].slice(f),_=w+b.length,x=v.slice(0,w),O=v.slice(_),j=[m,k];x&&j.push(x);var N=new a(l,c?n.tokenize(b,c):b,d,b,h);j.push(N),O&&j.push(O),Array.prototype.splice.apply(r,j)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.matchedStr=a||null,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var i={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}n.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=(o?" ":"")+s+'="'+(i.attributes[s]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+(o?" "+o:"")+">"+i.content+""},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,i=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),i&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); -Prism.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup; -Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/()[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag)); -Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/}; -Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*\*?|\/|~|\^|%|\.{3}/}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/()[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript; -Prism.languages.abap={comment:/^\*.*/m,string:/(`|')(\\?.)*?\1/m,"string-template":{pattern:/(\||\})(\\?.)*?(?=\||\{)/,lookbehind:!0,alias:"string"},"eol-comment":{pattern:/(^|\s)".*/m,lookbehind:!0,alias:"comment"},keyword:{pattern:/(\s|\.|^)(?:SCIENTIFIC_WITH_LEADING_ZERO|SCALE_PRESERVING_SCIENTIFIC|RMC_COMMUNICATION_FAILURE|END-ENHANCEMENT-SECTION|MULTIPLY-CORRESPONDING|SUBTRACT-CORRESPONDING|VERIFICATION-MESSAGE|DIVIDE-CORRESPONDING|ENHANCEMENT-SECTION|CURRENCY_CONVERSION|RMC_SYSTEM_FAILURE|START-OF-SELECTION|MOVE-CORRESPONDING|RMC_INVALID_STATUS|CUSTOMER-FUNCTION|END-OF-DEFINITION|ENHANCEMENT-POINT|SYSTEM-EXCEPTIONS|ADD-CORRESPONDING|SCALE_PRESERVING|SELECTION-SCREEN|CURSOR-SELECTION|END-OF-SELECTION|LOAD-OF-PROGRAM|SCROLL-BOUNDARY|SELECTION-TABLE|EXCEPTION-TABLE|IMPLEMENTATIONS|PARAMETER-TABLE|RIGHT-JUSTIFIED|UNIT_CONVERSION|AUTHORITY-CHECK|LIST-PROCESSING|SIGN_AS_POSTFIX|COL_BACKGROUND|IMPLEMENTATION|INTERFACE-POOL|TRANSFORMATION|IDENTIFICATION|ENDENHANCEMENT|LINE-SELECTION|INITIALIZATION|LEFT-JUSTIFIED|SELECT-OPTIONS|SELECTION-SETS|COMMUNICATION|CORRESPONDING|DECIMAL_SHIFT|PRINT-CONTROL|VALUE-REQUEST|CHAIN-REQUEST|FUNCTION-POOL|FIELD-SYMBOLS|FUNCTIONALITY|INVERTED-DATE|SELECTION-SET|CLASS-METHODS|OUTPUT-LENGTH|CLASS-CODING|COL_NEGATIVE|ERRORMESSAGE|FIELD-GROUPS|HELP-REQUEST|NO-EXTENSION|NO-TOPOFPAGE|REDEFINITION|DISPLAY-MODE|ENDINTERFACE|EXIT-COMMAND|FIELD-SYMBOL|NO-SCROLLING|SHORTDUMP-ID|ACCESSPOLICY|CLASS-EVENTS|COL_POSITIVE|DECLARATIONS|ENHANCEMENTS|FILTER-TABLE|SWITCHSTATES|SYNTAX-CHECK|TRANSPORTING|ASYNCHRONOUS|SYNTAX-TRACE|TOKENIZATION|USER-COMMAND|WITH-HEADING|ABAP-SOURCE|BREAK-POINT|CHAIN-INPUT|COMPRESSION|FIXED-POINT|NEW-SECTION|NON-UNICODE|OCCURRENCES|RESPONSIBLE|SYSTEM-CALL|TRACE-TABLE|ABBREVIATED|CHAR-TO-HEX|END-OF-FILE|ENDFUNCTION|ENVIRONMENT|ASSOCIATION|COL_HEADING|EDITOR-CALL|END-OF-PAGE|ENGINEERING|IMPLEMENTED|INTENSIFIED|RADIOBUTTON|SYSTEM-EXIT|TOP-OF-PAGE|TRANSACTION|APPLICATION|CONCATENATE|DESTINATION|ENHANCEMENT|IMMEDIATELY|NO-GROUPING|PRECOMPILED|REPLACEMENT|TITLE-LINES|ACTIVATION|BYTE-ORDER|CLASS-POOL|CONNECTION|CONVERSION|DEFINITION|DEPARTMENT|EXPIRATION|INHERITING|MESSAGE-ID|NO-HEADING|PERFORMING|QUEUE-ONLY|RIGHTSPACE|SCIENTIFIC|STATUSINFO|STRUCTURES|SYNCPOINTS|WITH-TITLE|ATTRIBUTES|BOUNDARIES|CLASS-DATA|COL_NORMAL|DD\/MM\/YYYY|DESCENDING|INTERFACES|LINE-COUNT|MM\/DD\/YYYY|NON-UNIQUE|PRESERVING|SELECTIONS|STATEMENTS|SUBROUTINE|TRUNCATION|TYPE-POOLS|ARITHMETIC|BACKGROUND|ENDPROVIDE|EXCEPTIONS|IDENTIFIER|INDEX-LINE|OBLIGATORY|PARAMETERS|PERCENTAGE|PUSHBUTTON|RESOLUTION|COMPONENTS|DEALLOCATE|DISCONNECT|DUPLICATES|FIRST-LINE|HEAD-LINES|NO-DISPLAY|OCCURRENCE|RESPECTING|RETURNCODE|SUBMATCHES|TRACE-FILE|ASCENDING|BYPASSING|ENDMODULE|EXCEPTION|EXCLUDING|EXPORTING|INCREMENT|MATCHCODE|PARAMETER|PARTIALLY|PREFERRED|REFERENCE|REPLACING|RETURNING|SELECTION|SEPARATED|SPECIFIED|STATEMENT|TIMESTAMP|TYPE-POOL|ACCEPTING|APPENDAGE|ASSIGNING|COL_GROUP|COMPARING|CONSTANTS|DANGEROUS|IMPORTING|INSTANCES|LEFTSPACE|LOG-POINT|QUICKINFO|READ-ONLY|SCROLLING|SQLSCRIPT|STEP-LOOP|TOP-LINES|TRANSLATE|APPENDING|AUTHORITY|CHARACTER|COMPONENT|CONDITION|DIRECTORY|DUPLICATE|MESSAGING|RECEIVING|SUBSCREEN|ACCORDING|COL_TOTAL|END-LINES|ENDMETHOD|ENDSELECT|EXPANDING|EXTENSION|INCLUDING|INFOTYPES|INTERFACE|INTERVALS|LINE-SIZE|PF-STATUS|PROCEDURE|PROTECTED|REQUESTED|RESUMABLE|RIGHTPLUS|SAP-SPOOL|SECONDARY|STRUCTURE|SUBSTRING|TABLEVIEW|NUMOFCHAR|ADJACENT|ANALYSIS|ASSIGNED|BACKWARD|CHANNELS|CHECKBOX|CONTINUE|CRITICAL|DATAINFO|DD\/MM\/YY|DURATION|ENCODING|ENDCLASS|FUNCTION|LEFTPLUS|LINEFEED|MM\/DD\/YY|OVERFLOW|RECEIVED|SKIPPING|SORTABLE|STANDARD|SUBTRACT|SUPPRESS|TABSTRIP|TITLEBAR|TRUNCATE|UNASSIGN|WHENEVER|ANALYZER|COALESCE|COMMENTS|CONDENSE|DECIMALS|DEFERRED|ENDWHILE|EXPLICIT|KEYWORDS|MESSAGES|POSITION|PRIORITY|RECEIVER|RENAMING|TIMEZONE|TRAILING|ALLOCATE|CENTERED|CIRCULAR|CONTROLS|CURRENCY|DELETING|DESCRIBE|DISTANCE|ENDCATCH|EXPONENT|EXTENDED|GENERATE|IGNORING|INCLUDES|INTERNAL|MAJOR-ID|MODIFIER|NEW-LINE|OPTIONAL|PROPERTY|ROLLBACK|STARTING|SUPPLIED|ABSTRACT|CHANGING|CONTEXTS|CREATING|CUSTOMER|DATABASE|DAYLIGHT|DEFINING|DISTINCT|DIVISION|ENABLING|ENDCHAIN|ESCAPING|HARMLESS|IMPLICIT|INACTIVE|LANGUAGE|MINOR-ID|MULTIPLY|NEW-PAGE|NO-TITLE|POS_HIGH|SEPARATE|TEXTPOOL|TRANSFER|SELECTOR|DBMAXLEN|ITERATOR|SELECTOR|ARCHIVE|BIT-XOR|BYTE-CO|COLLECT|COMMENT|CURRENT|DEFAULT|DISPLAY|ENDFORM|EXTRACT|LEADING|LISTBOX|LOCATOR|MEMBERS|METHODS|NESTING|POS_LOW|PROCESS|PROVIDE|RAISING|RESERVE|SECONDS|SUMMARY|VISIBLE|BETWEEN|BIT-AND|BYTE-CS|CLEANUP|COMPUTE|CONTROL|CONVERT|DATASET|ENDCASE|FORWARD|HEADERS|HOTSPOT|INCLUDE|INVERSE|KEEPING|NO-ZERO|OBJECTS|OVERLAY|PADDING|PATTERN|PROGRAM|REFRESH|SECTION|SUMMING|TESTING|VERSION|WINDOWS|WITHOUT|BIT-NOT|BYTE-CA|BYTE-NA|CASTING|CONTEXT|COUNTRY|DYNAMIC|ENABLED|ENDLOOP|EXECUTE|FRIENDS|HANDLER|HEADING|INITIAL|\*-INPUT|LOGFILE|MAXIMUM|MINIMUM|NO-GAPS|NO-SIGN|PRAGMAS|PRIMARY|PRIVATE|REDUCED|REPLACE|REQUEST|RESULTS|UNICODE|WARNING|ALIASES|BYTE-CN|BYTE-NS|CALLING|COL_KEY|COLUMNS|CONNECT|ENDEXEC|ENTRIES|EXCLUDE|FILTERS|FURTHER|HELP-ID|LOGICAL|MAPPING|MESSAGE|NAMETAB|OPTIONS|PACKAGE|PERFORM|RECEIVE|STATICS|VARYING|BINDING|CHARLEN|GREATER|XSTRLEN|ACCEPT|APPEND|DETAIL|ELSEIF|ENDING|ENDTRY|FORMAT|FRAMES|GIVING|HASHED|HEADER|IMPORT|INSERT|MARGIN|MODULE|NATIVE|OBJECT|OFFSET|REMOTE|RESUME|SAVING|SIMPLE|SUBMIT|TABBED|TOKENS|UNIQUE|UNPACK|UPDATE|WINDOW|YELLOW|ACTUAL|ASPECT|CENTER|CURSOR|DELETE|DIALOG|DIVIDE|DURING|ERRORS|EVENTS|EXTEND|FILTER|HANDLE|HAVING|IGNORE|LITTLE|MEMORY|NO-GAP|OCCURS|OPTION|PERSON|PLACES|PUBLIC|REDUCE|REPORT|RESULT|SINGLE|SORTED|SWITCH|SYNTAX|TARGET|VALUES|WRITER|ASSERT|BLOCKS|BOUNDS|BUFFER|CHANGE|COLUMN|COMMIT|CONCAT|COPIES|CREATE|DDMMYY|DEFINE|ENDIAN|ESCAPE|EXPAND|KERNEL|LAYOUT|LEGACY|LEVELS|MMDDYY|NUMBER|OUTPUT|RANGES|READER|RETURN|SCREEN|SEARCH|SELECT|SHARED|SOURCE|STABLE|STATIC|SUBKEY|SUFFIX|TABLES|UNWIND|YYMMDD|ASSIGN|BACKUP|BEFORE|BINARY|BIT-OR|BLANKS|CLIENT|CODING|COMMON|DEMAND|DYNPRO|EXCEPT|EXISTS|EXPORT|FIELDS|GLOBAL|GROUPS|LENGTH|LOCALE|MEDIUM|METHOD|MODIFY|NESTED|OTHERS|REJECT|SCROLL|SUPPLY|SYMBOL|ENDFOR|STRLEN|ALIGN|BEGIN|BOUND|ENDAT|ENTRY|EVENT|FINAL|FLUSH|GRANT|INNER|SHORT|USING|WRITE|AFTER|BLACK|BLOCK|CLOCK|COLOR|COUNT|DUMMY|EMPTY|ENDDO|ENDON|GREEN|INDEX|INOUT|LEAVE|LEVEL|LINES|MODIF|ORDER|OUTER|RANGE|RESET|RETRY|RIGHT|SMART|SPLIT|STYLE|TABLE|THROW|UNDER|UNTIL|UPPER|UTF-8|WHERE|ALIAS|BLANK|CLEAR|CLOSE|EXACT|FETCH|FIRST|FOUND|GROUP|LLANG|LOCAL|OTHER|REGEX|SPOOL|TITLE|TYPES|VALID|WHILE|ALPHA|BOXED|CATCH|CHAIN|CHECK|CLASS|COVER|ENDIF|EQUIV|FIELD|FLOOR|FRAME|INPUT|LOWER|MATCH|NODES|PAGES|PRINT|RAISE|ROUND|SHIFT|SPACE|SPOTS|STAMP|STATE|TASKS|TIMES|TRMAC|ULINE|UNION|VALUE|WIDTH|EQUAL|LOG10|TRUNC|BLOB|CASE|CEIL|CLOB|COND|EXIT|FILE|GAPS|HOLD|INCL|INTO|KEEP|KEYS|LAST|LINE|LONG|LPAD|MAIL|MODE|OPEN|PINK|READ|ROWS|TEST|THEN|ZERO|AREA|BACK|BADI|BYTE|CAST|EDIT|EXEC|FAIL|FIND|FKEQ|FONT|FREE|GKEQ|HIDE|INIT|ITNO|LATE|LOOP|MAIN|MARK|MOVE|NEXT|NULL|RISK|ROLE|UNIT|WAIT|ZONE|BASE|CALL|CODE|DATA|DATE|FKGE|GKGE|HIGH|KIND|LEFT|LIST|MASK|MESH|NAME|NODE|PACK|PAGE|POOL|SEND|SIGN|SIZE|SOME|STOP|TASK|TEXT|TIME|USER|VARY|WITH|WORD|BLUE|CONV|COPY|DEEP|ELSE|FORM|FROM|HINT|ICON|JOIN|LIKE|LOAD|ONLY|PART|SCAN|SKIP|SORT|TYPE|UNIX|VIEW|WHEN|WORK|ACOS|ASIN|ATAN|COSH|EACH|FRAC|LESS|RTTI|SINH|SQRT|TANH|AVG|BIT|DIV|ISO|LET|OUT|PAD|SQL|ALL|CI_|CPI|END|LOB|LPI|MAX|MIN|NEW|OLE|RUN|SET|\?TO|YES|ABS|ADD|AND|BIG|FOR|HDB|JOB|LOW|NOT|SAP|TRY|VIA|XML|ANY|GET|IDS|KEY|MOD|OFF|PUT|RAW|RED|REF|SUM|TAB|XSD|CNT|COS|EXP|LOG|SIN|TAN|XOR|AT|CO|CP|DO|GT|ID|IF|NS|OR|BT|CA|CS|GE|NA|NB|EQ|IN|LT|NE|NO|OF|ON|PF|TO|AS|BY|CN|IS|LE|NP|UP|E|I|M|O|Z|C|X)\b/i,lookbehind:!0},number:/\b\d+\b/,operator:{pattern:/(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/,lookbehind:!0},"string-operator":{pattern:/(\s)&&?(?=\s)/,lookbehind:!0,alias:"keyword"},"token-operator":[{pattern:/(\w)(?:->?|=>|[~|{}])(?=\w)/,lookbehind:!0,alias:"punctuation"},{pattern:/[|{}]/,alias:"punctuation"}],punctuation:/[,.:()]/}; -Prism.languages.actionscript=Prism.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),Prism.languages.actionscript["class-name"].alias="function",Prism.languages.markup&&Prism.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/,lookbehind:!0,inside:{rest:Prism.languages.markup}}}); -Prism.languages.ada={comment:/--.*/,string:/"(?:""|[^"\r\f\n])*"/i,number:[{pattern:/\b[0-9](?:_?[0-9])*#[0-9A-F](?:_?[0-9A-F])*(?:\.[0-9A-F](?:_?[0-9A-F])*)?#(?:E[+-]?[0-9](?:_?[0-9])*)?/i},{pattern:/\b[0-9](?:_?[0-9])*(?:\.[0-9](?:_?[0-9])*)?(?:E[+-]?[0-9](?:_?[0-9])*)?\b/i}],"attr-name":/\b'\w+/i,keyword:/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|new|return|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,"boolean":/\b(?:true|false)\b/i,operator:/<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,punctuation:/\.\.?|[,;():]/,"char":/'.'/,variable:/\b[a-z](?:[_a-z\d])*\b/i}; -Prism.languages.apacheconf={comment:/#.*/,"directive-inline":{pattern:/^(\s*)\b(AcceptFilter|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding|AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch|Allow|AllowCONNECT|AllowEncodedSlashes|AllowMethods|AllowOverride|AllowOverrideList|Anonymous|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail|AsyncRequestWorkerFactor|AuthBasicAuthoritative|AuthBasicFake|AuthBasicProvider|AuthBasicUseDigestAlgorithm|AuthDBDUserPWQuery|AuthDBDUserRealmQuery|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm|AuthDigestDomain|AuthDigestNonceLifetime|AuthDigestProvider|AuthDigestQop|AuthDigestShmemSize|AuthFormAuthoritative|AuthFormBody|AuthFormDisableNoStore|AuthFormFakeBasicAuth|AuthFormLocation|AuthFormLoginRequiredLocation|AuthFormLoginSuccessLocation|AuthFormLogoutLocation|AuthFormMethod|AuthFormMimetype|AuthFormPassword|AuthFormProvider|AuthFormSitePassphrase|AuthFormSize|AuthFormUsername|AuthGroupFile|AuthLDAPAuthorizePrefix|AuthLDAPBindAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareAsUser|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPInitialBindAsUser|AuthLDAPInitialBindPattern|AuthLDAPMaxSubGroupDepth|AuthLDAPRemoteUserAttribute|AuthLDAPRemoteUserIsDN|AuthLDAPSearchAsUser|AuthLDAPSubGroupAttribute|AuthLDAPSubGroupClass|AuthLDAPUrl|AuthMerging|AuthName|AuthnCacheContext|AuthnCacheEnable|AuthnCacheProvideFor|AuthnCacheSOCache|AuthnCacheTimeout|AuthnzFcgiCheckAuthnProvider|AuthnzFcgiDefineProvider|AuthType|AuthUserFile|AuthzDBDLoginToReferer|AuthzDBDQuery|AuthzDBDRedirectQuery|AuthzDBMType|AuthzSendForbiddenOnFailure|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|CacheDefaultExpire|CacheDetailHeader|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheFile|CacheHeader|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheIgnoreQueryString|CacheIgnoreURLSessionIdentifiers|CacheKeyBaseURL|CacheLastModifiedFactor|CacheLock|CacheLockMaxAge|CacheLockPath|CacheMaxExpire|CacheMaxFileSize|CacheMinExpire|CacheMinFileSize|CacheNegotiatedDocs|CacheQuickHandler|CacheReadSize|CacheReadTime|CacheRoot|CacheSocache|CacheSocacheMaxSize|CacheSocacheMaxTime|CacheSocacheMinTime|CacheSocacheReadSize|CacheSocacheReadTime|CacheStaleOnError|CacheStoreExpired|CacheStoreNoStore|CacheStorePrivate|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateInflateLimitRequestBody|DeflateInflateRatioBurst|DeflateInflateRatioLimit|DeflateMemLevel|DeflateWindowSize|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|HeartbeatAddress|HeartbeatListen|HeartbeatMaxServers|HeartbeatStorage|HeartbeatStorage|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|IndexHeadInsert|IndexIgnore|IndexIgnoreReset|IndexOptions|IndexOrderDefault|IndexStyleSheet|InputSed|ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionPoolTTL|LDAPConnectionTimeout|LDAPLibraryDebug|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPReferralHopLimit|LDAPReferrals|LDAPRetries|LDAPRetryDelay|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTimeout|LDAPTrustedClientCert|LDAPTrustedGlobalCert|LDAPTrustedMode|LDAPVerifyServerCert|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|LuaHookAccessChecker|LuaHookAuthChecker|LuaHookCheckUserID|LuaHookFixups|LuaHookInsertFilter|LuaHookLog|LuaHookMapToStorage|LuaHookTranslateName|LuaHookTypeChecker|LuaInherit|LuaInputFilter|LuaMapHandler|LuaOutputFilter|LuaPackageCPath|LuaPackagePath|LuaQuickHandler|LuaRoot|LuaScope|MaxConnectionsPerChild|MaxKeepAliveRequests|MaxMemFree|MaxRangeOverlaps|MaxRangeReversals|MaxRanges|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|ProxyAddHeaders|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyExpressDBMFile|ProxyExpressDBMType|ProxyExpressEnable|ProxyFtpDirCharset|ProxyFtpEscapeWildcards|ProxyFtpListOnWildcard|ProxyHTMLBufSize|ProxyHTMLCharsetOut|ProxyHTMLDocType|ProxyHTMLEnable|ProxyHTMLEvents|ProxyHTMLExtended|ProxyHTMLFixups|ProxyHTMLInterp|ProxyHTMLLinks|ProxyHTMLMeta|ProxyHTMLStripComments|ProxyHTMLURLMap|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassInherit|ProxyPassInterpolateEnv|ProxyPassMatch|ProxyPassReverse|ProxyPassReverseCookieDomain|ProxyPassReverseCookiePath|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxySCGIInternalRedirect|ProxySCGISendfile|ProxySet|ProxySourceAddress|ProxyStatus|ProxyTimeout|ProxyVia|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIPHeader|RemoteIPInternalProxy|RemoteIPInternalProxyList|RemoteIPProxiesHeader|RemoteIPTrustedProxy|RemoteIPTrustedProxyList|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|RewriteBase|RewriteCond|RewriteEngine|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen|SeeRequestTail|SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|Session|SessionCookieName|SessionCookieName2|SessionCookieRemove|SessionCryptoCipher|SessionCryptoDriver|SessionCryptoPassphrase|SessionCryptoPassphraseFile|SessionDBDCookieName|SessionDBDCookieName2|SessionDBDCookieRemove|SessionDBDDeleteLabel|SessionDBDInsertLabel|SessionDBDPerUser|SessionDBDSelectLabel|SessionDBDUpdateLabel|SessionEnv|SessionExclude|SessionHeader|SessionInclude|SessionMaxAge|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath|SSLCADNRequestFile|SSLCADNRequestPath|SSLCARevocationCheck|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLCompression|SSLCryptoDevice|SSLEngine|SSLFIPS|SSLHonorCipherOrder|SSLInsecureRenegotiation|SSLOCSPDefaultResponder|SSLOCSPEnable|SSLOCSPOverrideResponder|SSLOCSPResponderTimeout|SSLOCSPResponseMaxAge|SSLOCSPResponseTimeSkew|SSLOCSPUseRequestNonce|SSLOpenSSLConfCmd|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationCheck|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCheckPeerCN|SSLProxyCheckPeerExpire|SSLProxyCheckPeerName|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateChainFile|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRenegBufferSize|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLSessionTicketKeyFile|SSLSRPUnknownUserSeed|SSLSRPVerifierFile|SSLStaplingCache|SSLStaplingErrorCacheTimeout|SSLStaplingFakeTryLater|SSLStaplingForceURL|SSLStaplingResponderTimeout|SSLStaplingResponseMaxAge|SSLStaplingResponseTimeSkew|SSLStaplingReturnResponderErrors|SSLStaplingStandardCacheTimeout|SSLStrictSNIVHostCheck|SSLUserName|SSLUseStapling|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/im,lookbehind:!0,alias:"property"},"directive-block":{pattern:/<\/?\b(AuthnProviderAlias|AuthzProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|RequireAll|RequireAny|RequireNone|VirtualHost)\b *.*>/i,inside:{"directive-block":{pattern:/^<\/?\w+/,inside:{punctuation:/^<\/?/},alias:"tag"},"directive-block-parameter":{pattern:/.*[^>]/,inside:{punctuation:/:/,string:{pattern:/("|').*\1/,inside:{variable:/(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/}}},alias:"attr-value"},punctuation:/>/},alias:"tag"},"directive-flags":{pattern:/\[(\w,?)+\]/,alias:"keyword"},string:{pattern:/("|').*\1/,inside:{variable:/(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/}},variable:/(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/,regex:/\^?.*\$|\^.*\$?/}; -Prism.languages.apl={comment:/(?:⍝|#[! ]).*$/m,string:/'(?:[^'\r\n]|'')*'/,number:/¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[\+¯]?\d+)?|¯|∞))?/i,statement:/:[A-Z][a-z][A-Za-z]*\b/,"system-function":{pattern:/⎕[A-Z]+/i,alias:"function"},constant:/[⍬⌾#⎕⍞]/,"function":/[-+×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,"monadic-operator":{pattern:/[\\\/⌿⍀¨⍨⌶&∥]/,alias:"operator"},"dyadic-operator":{pattern:/[.⍣⍠⍤∘⌸]/,alias:"operator"},assignment:{pattern:/←/,alias:"keyword"},punctuation:/[\[;\]()◇⋄]/,dfn:{pattern:/[{}⍺⍵⍶⍹∇⍫:]/,alias:"builtin"}}; -Prism.languages.applescript={comment:[/\(\*(?:\(\*[\w\W]*?\*\)|[\w\W])*?\*\)/,/--.+/,/#.+/],string:/"(?:\\?.)*?"/,number:/\b-?\d*\.?\d+([Ee]-?\d+)?\b/,operator:[/[&=≠≤≥*+\-\/÷^]|[<>]=?/,/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/],keyword:/\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,"class":{pattern:/\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/,alias:"builtin"},punctuation:/[{}():,¬«»《》]/}; -!function(a){var i={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\]\\]|\\.)*\]|[^\]\\]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}};a.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} +.+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:i,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{"function":/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:i.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:i,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|TM|R)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}},i.inside.interpreted.inside.rest={macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity},a.languages.asciidoc["passthrough-block"].inside.rest={macro:a.languages.asciidoc.macro},a.languages.asciidoc["literal-block"].inside.rest={callout:a.languages.asciidoc.callout},a.languages.asciidoc.table.inside.rest={"comment-block":a.languages.asciidoc["comment-block"],"passthrough-block":a.languages.asciidoc["passthrough-block"],"literal-block":a.languages.asciidoc["literal-block"],"other-block":a.languages.asciidoc["other-block"],"list-punctuation":a.languages.asciidoc["list-punctuation"],"indented-block":a.languages.asciidoc["indented-block"],comment:a.languages.asciidoc.comment,title:a.languages.asciidoc.title,"attribute-entry":a.languages.asciidoc["attribute-entry"],attributes:a.languages.asciidoc.attributes,hr:a.languages.asciidoc.hr,"page-break":a.languages.asciidoc["page-break"],admonition:a.languages.asciidoc.admonition,"list-label":a.languages.asciidoc["list-label"],callout:a.languages.asciidoc.callout,macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity,"line-continuation":a.languages.asciidoc["line-continuation"]},a.languages.asciidoc["other-block"].inside.rest={table:a.languages.asciidoc.table,"list-punctuation":a.languages.asciidoc["list-punctuation"],"indented-block":a.languages.asciidoc["indented-block"],comment:a.languages.asciidoc.comment,"attribute-entry":a.languages.asciidoc["attribute-entry"],attributes:a.languages.asciidoc.attributes,hr:a.languages.asciidoc.hr,"page-break":a.languages.asciidoc["page-break"],admonition:a.languages.asciidoc.admonition,"list-label":a.languages.asciidoc["list-label"],macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity,"line-continuation":a.languages.asciidoc["line-continuation"]},a.languages.asciidoc.title.inside.rest={macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity},a.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})}(Prism); -Prism.languages.aspnet=Prism.languages.extend("markup",{"page-directive tag":{pattern:/<%\s*@.*%>/i,inside:{"page-directive tag":/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,rest:Prism.languages.markup.tag.inside}},"directive tag":{pattern:/<%.*%>/i,inside:{"directive tag":/<%\s*?[$=%#:]{0,2}|%>/i,rest:Prism.languages.csharp}}}),Prism.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,Prism.languages.insertBefore("inside","punctuation",{"directive tag":Prism.languages.aspnet["directive tag"]},Prism.languages.aspnet.tag.inside["attr-value"]),Prism.languages.insertBefore("aspnet","comment",{"asp comment":/<%--[\w\W]*?--%>/}),Prism.languages.insertBefore("aspnet",Prism.languages.javascript?"script":"tag",{"asp script":{pattern:/()[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.csharp||{}}}); -Prism.languages.autoit={comment:[/;.*/,{pattern:/(^\s*)#(?:comments-start|cs)[\s\S]*?^\s*#(?:comments-end|ce)/m,lookbehind:!0}],url:{pattern:/(^\s*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,lookbehind:!0},string:{pattern:/(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,inside:{variable:/([%$@])\w+\1/}},directive:{pattern:/(^\s*)#\w+/m,lookbehind:!0,alias:"keyword"},"function":/\b\w+(?=\()/,variable:/[$@]\w+/,keyword:/\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,"boolean":/\b(?:True|False)\b/i,operator:/<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Or|Not)\b/i,punctuation:/[\[\]().,:]/}; -Prism.languages.autohotkey={comment:{pattern:/(^[^";\n]*("[^"\n]*?"[^"\n]*?)*)(;.*$|^\s*\/\*[\s\S]*\n\*\/)/m,lookbehind:!0},string:/"(([^"\n\r]|"")*)"/m,"function":/[^\(\); \t,\n\+\*\-=\?>:\\\/<&%\[\]]+?(?=\()/m,tag:/^[ \t]*[^\s:]+?(?=:(?:[^:]|$))/m,variable:/%\w+%/,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,operator:/\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/,punctuation:/[\{}[\]\(\):,]/,"boolean":/\b(true|false)\b/,selector:/\b(AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i,constant:/\b(a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\b/i,builtin:/\b(abs|acos|asc|asin|atan|ceil|chr|class|cos|dllcall|exp|fileexist|Fileopen|floor|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\b/i,symbol:/\b(alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i,important:/#\b(AllowSameLineComments|ClipboardTimeout|CommentFlag|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InstallKeybdHook|InstallMouseHook|KeyHistory|LTrim|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|WinActivateForce)\b/i,keyword:/\b(Abort|AboveNormal|Add|ahk_class|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Type|UnCheck|underline|Unicode|Unlock|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i}; -!function(e){var t={variable:[{pattern:/\$?\(\([\w\W]+?\)\)/,inside:{variable:[{pattern:/(^\$\(\([\w\W]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\([^)]+\)|`[^`]+`/,inside:{variable:/^\$\(|^`|\)$|`$/}},/\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i]};e.languages.bash={shebang:{pattern:/^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/,alias:"important"},comment:{pattern:/(^|[^"{\\])#.*/,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g,lookbehind:!0,greedy:!0,inside:t},{pattern:/(["'])(?:\\\\|\\?[^\\])*?\1/g,greedy:!0,inside:t}],variable:t.variable,"function":{pattern:/(^|\s|;|\||&)(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|npm|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|\s|;|\||&)/,lookbehind:!0},keyword:{pattern:/(^|\s|;|\||&)(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|\s|;|\||&)/,lookbehind:!0},"boolean":{pattern:/(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/,lookbehind:!0},operator:/&&?|\|\|?|==?|!=?|<<>|<=?|>=?|=~/,punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];]/};var a=t.variable[1].inside;a["function"]=e.languages.bash["function"],a.keyword=e.languages.bash.keyword,a.boolean=e.languages.bash.boolean,a.operator=e.languages.bash.operator,a.punctuation=e.languages.bash.punctuation}(Prism); -Prism.languages.basic={string:/"(?:""|[!#$%&'()*,\/:;<=>?^_ +\-.A-Z\d])*"/i,comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},number:/(?:\b|\B[.-])(?:\d+\.?\d*)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SHARED|SINGLE|SELECT CASE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,"function":/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}; -!function(e){var r=/%%?[~:\w]+%?|!\S+!/,t={pattern:/\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,alias:"attr-name",inside:{punctuation:/:/}},n=/"[^"]*"/,i=/(?:\b|-)\d+\b/;e.languages.batch={comment:[/^::.*/m,{pattern:/((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0}],label:{pattern:/^:.*/m,alias:"property"},command:[{pattern:/((?:^|[&(])[ \t]*)for(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* \S+ in \([^)]+\) do/im,lookbehind:!0,inside:{keyword:/^for\b|\b(?:in|do)\b/i,string:n,parameter:t,variable:r,number:i,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*)if(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|\S+)?(?:==| (?:equ|neq|lss|leq|gtr|geq) )(?:"[^"]*"|\S+))/im,lookbehind:!0,inside:{keyword:/^if\b|\b(?:not|cmdextversion|defined|errorlevel|exist)\b/i,string:n,parameter:t,variable:r,number:i,operator:/\^|==|\b(?:equ|neq|lss|leq|gtr|geq)\b/i}},{pattern:/((?:^|[&()])[ \t]*)else\b/im,lookbehind:!0,inside:{keyword:/^else\b/i}},{pattern:/((?:^|[&(])[ \t]*)set(?: ?\/[a-z](?:[ :](?:"[^"]*"|\S+))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^set\b/i,string:n,parameter:t,variable:[r,/\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/],number:i,operator:/[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*@?)\w+\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^\w+\b/i,string:n,parameter:t,label:{pattern:/(^\s*):\S+/m,lookbehind:!0,alias:"property"},variable:r,number:i,operator:/\^/}}],operator:/[&@]/,punctuation:/[()']/}}(Prism); -Prism.languages.c=Prism.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/}),delete Prism.languages.c["class-name"],delete Prism.languages.c["boolean"]; -Prism.languages.brainfuck={pointer:{pattern:/<|>/,alias:"keyword"},increment:{pattern:/\+/,alias:"inserted"},decrement:{pattern:/-/,alias:"deleted"},branching:{pattern:/\[|\]/,alias:"important"},operator:/[.,]/,comment:/\S+/}; -Prism.languages.bro={comment:{pattern:/(^|[^\\$])#.*/,lookbehind:!0,inside:{italic:/\b(TODO|FIXME|XXX)\b/}},string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"boolean":/\b(T|F)\b/,"function":{pattern:/(?:function|hook|event) [a-zA-Z0-9_]+(::[a-zA-Z0-9_]+)?/,inside:{keyword:/^(?:function|hook|event)/}},variable:{pattern:/(?:global|local) [a-zA-Z0-9_]+/i,inside:{keyword:/(?:global|local)/}},builtin:/(@(load(-(sigs|plugin))?|unload|prefixes|ifn?def|else|(end)?if|DIR|FILENAME))|(&?(redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,constant:{pattern:/const [a-zA-Z0-9_]+/i,inside:{keyword:/const/}},keyword:/\b(break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module|function)\b/,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,punctuation:/[{}[\];(),.:]/}; -Prism.languages.bison=Prism.languages.extend("c",{}),Prism.languages.insertBefore("bison","comment",{bison:{pattern:/^[\s\S]*?%%[\s\S]*?%%/,inside:{c:{pattern:/%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/,inside:{delimiter:{pattern:/^%?\{|%?\}$/,alias:"punctuation"},"bison-variable":{pattern:/[$@](?:<[^\s>]+>)?[\w$]+/,alias:"variable",inside:{punctuation:/<|>/}},rest:Prism.languages.c}},comment:Prism.languages.c.comment,string:Prism.languages.c.string,property:/\S+(?=:)/,keyword:/%\w+/,number:{pattern:/(^|[^@])\b(?:0x[\da-f]+|\d+)/i,lookbehind:!0},punctuation:/%[%?]|[|:;\[\]<>]/}}}); -Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+f?)\b/i}),Prism.languages.insertBefore("csharp","keyword",{"generic-method":{pattern:/[a-z0-9_]+\s*<[^>\r\n]+?>\s*(?=\()/i,alias:"function",inside:{keyword:Prism.languages.csharp.keyword,punctuation:/[<>(),.:]/}},preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}}); -Prism.languages.cpp=Prism.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),Prism.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}); -!function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\?[^\\])*?'/,greedy:!0},{pattern:/"(?:\\?[^\\])*?"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\?[\s\S])*?`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},rest:e.languages.javascript}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"]}(Prism); -!function(e){e.languages.ruby=e.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var n={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.util.clone(e.languages.ruby)}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:n}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:n}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:n}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:n}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:n}},{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:n}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:n}}]}(Prism); -Prism.languages.css.selector={pattern:/[^\{\}\s][^\{\}]*(?=\s*\{)/,inside:{"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+(?:\(.*\))?/,"class":/\.[-:\.\w]+/,id:/#[-:\.\w]+/,attribute:/\[[^\]]+\]/}},Prism.languages.insertBefore("css","function",{hexcode:/#[\da-f]{3,6}/i,entity:/\\[\da-f]{1,8}/i,number:/[\d%\.]+/}); -Prism.languages.d=Prism.languages.extend("clike",{string:[/\b[rx]"(\\.|[^\\"])*"[cwd]?/,/\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/,/\bq"([_a-zA-Z][_a-zA-Z\d]*)(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\1"/,/\bq"(.)[\s\S]*?\1"/,/'(?:\\'|\\?[^']+)'/,/(["`])(\\.|(?!\1)[^\\])*\1[cwd]?/],number:[/\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]*/i,{pattern:/((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]*/i,lookbehind:!0}],keyword:/\$|\b(?:abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|real|ref|return|scope|shared|short|static|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|__(?:(?:FILE|MODULE|LINE|FUNCTION|PRETTY_FUNCTION|DATE|EOF|TIME|TIMESTAMP|VENDOR|VERSION)__|gshared|traits|vector|parameters)|string|wstring|dstring|size_t|ptrdiff_t)\b/,operator:/\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/}),Prism.languages.d.comment=[/^\s*#!.+/,{pattern:/(^|[^\\])\/\+(?:\/\+[\w\W]*?\+\/|[\w\W])*?\+\//,lookbehind:!0}].concat(Prism.languages.d.comment),Prism.languages.insertBefore("d","comment",{"token-string":{pattern:/\bq\{(?:|\{[^}]*\}|[^}])*\}/,alias:"string"}}),Prism.languages.insertBefore("d","keyword",{property:/\B@\w*/}),Prism.languages.insertBefore("d","function",{register:{pattern:/\b(?:[ABCD][LHX]|E[ABCD]X|E?(?:BP|SP|DI|SI)|[ECSDGF]S|CR[0234]|DR[012367]|TR[3-7]|X?MM[0-7]|R[ABCD]X|[BS]PL|R[BS]P|[DS]IL|R[DS]I|R(?:[89]|1[0-5])[BWD]?|XMM(?:[89]|1[0-5])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/,alias:"variable"}}); -Prism.languages.dart=Prism.languages.extend("clike",{string:[/r?("""|''')[\s\S]*?\1/,/r?("|')(\\?.)*?\1/],keyword:[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/],operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),Prism.languages.insertBefore("dart","function",{metadata:{pattern:/@\w+/,alias:"symbol"}}); -Prism.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d+.*$/m],deleted:/^[-<].*$/m,inserted:/^[+>].*$/m,diff:{pattern:/^!(?!!).+$/m,alias:"important"}}; -Prism.languages.docker={keyword:{pattern:/(^\s*)(?:ONBUILD|FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|COPY|VOLUME|USER|WORKDIR|CMD|LABEL|ENTRYPOINT)(?=\s)/im,lookbehind:!0},string:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/,comment:/#.*/,punctuation:/---|\.\.\.|[:[\]{}\-,|>?]/}; -Prism.languages.eiffel={string:[/"([^[]*)\[[\s\S]+?\]\1"/,/"([^{]*)\{[\s\S]+?\}\1"/,/"(?:%\s+%|%"|.)*?"/],comment:/--.*/,"char":/'(?:%'|.)+?'/,keyword:/\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,"boolean":/\b(?:True|False)\b/i,number:[/\b0[xcb][\da-f](?:_*[\da-f])*\b/i,/(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/],punctuation:/:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,operator:/\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/}; -Prism.languages.elixir={comment:{pattern:/(^|[^#])#(?![{#]).*/m,lookbehind:!0},regex:/~[rR](?:("""|'''|[\/|"'])(?:\\.|(?!\1)[^\\])+\1|\((?:\\\)|[^)])+\)|\[(?:\\\]|[^\]])+\]|\{(?:\\\}|[^}])+\}|<(?:\\>|[^>])+>)[uismxfr]*/,string:[{pattern:/~[cCsSwW](?:("""|'''|[\/|"'])(?:\\.|(?!\1)[^\\])+\1|\((?:\\\)|[^)])+\)|\[(?:\\\]|[^\]])+\]|\{(?:\\\}|#\{[^}]+\}|[^}])+\}|<(?:\\>|[^>])+>)[csa]?/,inside:{}},{pattern:/("""|''')[\s\S]*?\1/,inside:{}},{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,inside:{}}],atom:{pattern:/(^|[^:]):\w+/,lookbehind:!0,alias:"symbol"},"attr-name":/\w+:(?!:)/,capture:{pattern:/(^|[^&])&(?:[^&\s\d()][^\s()]*|(?=\())/,lookbehind:!0,alias:"function"},argument:{pattern:/(^|[^&])&\d+/,lookbehind:!0,alias:"variable"},attribute:{pattern:/@[\S]+/,alias:"variable"},number:/\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,keyword:/\b(?:after|alias|and|case|catch|cond|def(?:callback|exception|impl|module|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|require|rescue|try|unless|use|when)\b/,"boolean":/\b(?:true|false|nil)\b/,operator:[/\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,{pattern:/([^<])<(?!<)/,lookbehind:!0},{pattern:/([^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,%\[\]{}()]/},Prism.languages.elixir.string.forEach(function(e){e.inside={interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:Prism.util.clone(Prism.languages.elixir)}}}}); -Prism.languages.erlang={comment:/%.+/,string:/"(?:\\?.)*?"/,"quoted-function":{pattern:/'(?:\\.|[^'\\])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^'\\])+'/,alias:"atom"},"boolean":/\b(?:true|false)\b/,keyword:/\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/,number:[/\$\\?./,/\d+#[a-z0-9]+/i,/(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/],"function":/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/}; -Prism.languages.fsharp=Prism.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*[\w\W]*?\*\)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],keyword:/\b(?:let|return|use|yield)(?:!\B|\b)|\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,string:/(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|("|')(?:\\\1|\\?(?!\1)[\s\S])*\1)B?/,number:[/\b-?0x[\da-fA-F]+(un|lf|LF)?\b/,/\b-?0b[01]+(y|uy)?\b/,/\b-?(\d*\.?\d+|\d+\.)([fFmM]|[eE][+-]?\d+)?\b/,/\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/]}),Prism.languages.insertBefore("fsharp","keyword",{preprocessor:{pattern:/^[^\r\n\S]*#.*/m,alias:"property",inside:{directive:{pattern:/(\s*#)\b(else|endif|if|light|line|nowarn)\b/,lookbehind:!0,alias:"keyword"}}}}); -Prism.languages.fortran={"quoted-number":{pattern:/[BOZ](['"])[A-F0-9]+\1/i,alias:"number"},string:{pattern:/(?:\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:\s*!.+(?:\r\n?|\n))?|(?!\1).)*(?:\1|&)/,inside:{comment:{pattern:/(&(?:\r\n?|\n)\s*)!.*/,lookbehind:!0}}},comment:/!.*/,"boolean":/\.(?:TRUE|FALSE)\.(?:_\w+)?/i,number:/(?:\b|[+-])(?:\d+(?:\.\d*)?|\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,keyword:[/\b(?:INTEGER|REAL|DOUBLE ?PRECISION|COMPLEX|CHARACTER|LOGICAL)\b/i,/\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,/\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,/\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEWHERE|ELSEIF|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i],operator:[/\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.(?:EQ|NE|LT|LE|GT|GE|NOT|AND|OR|EQV|NEQV)\.|\.[A-Z]+\./i,{pattern:/(^|(?!\().)\/(?!\))/,lookbehind:!0}],punctuation:/\(\/|\/\)|[(),;:&]/}; -Prism.languages.gherkin={pystring:{pattern:/("""|''')[\s\S]+?\1/,alias:"string"},comment:{pattern:/((^|\r?\n|\r)[ \t]*)#.*/,lookbehind:!0},tag:{pattern:/((^|\r?\n|\r)[ \t]*)@\S*/,lookbehind:!0},feature:{pattern:/((^|\r?\n|\r)[ \t]*)(Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):([^:]+(?:\r?\n|\r|$))*/,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]+/,lookbehind:!0},keyword:/[^:\r\n]+:/}},scenario:{pattern:/((^|\r?\n|\r)[ \t]*)(Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo\-ho\-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]*/,lookbehind:!0},keyword:/[^:\r\n]+:/}},"table-body":{pattern:/((?:\r?\n|\r)[ \t]*\|.+\|[^\r\n]*)+/,lookbehind:!0,inside:{outline:{pattern:/<[^>]+?>/,alias:"variable"},td:{pattern:/\s*[^\s|][^|]*/,alias:"string"},punctuation:/\|/}},"table-head":{pattern:/((?:\r?\n|\r)[ \t]*\|.+\|[^\r\n]*)/,inside:{th:{pattern:/\s*[^\s|][^|]*/,alias:"variable"},punctuation:/\|/}},atrule:{pattern:/((?:\r?\n|\r)[ \t]+)('ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t]+)/,lookbehind:!0},string:{pattern:/("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/,inside:{outline:{pattern:/<[^>]+?>/,alias:"variable"}}},outline:{pattern:/<[^>]+?>/,alias:"variable"}}; -Prism.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(\\?.)*?\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s(--|-)\w+/m}},coord:/^@@.*@@$/m,commit_sha1:/^commit \w{40}$/m}; -Prism.languages.glsl=Prism.languages.extend("clike",{comment:[/\/\*[\w\W]*?\*\//,/\/\/(?:\\(?:\r\n|[\s\S])|.)*/],number:/\b(?:0x[\da-f]+|(?:\.\d+|\d+\.?\d*)(?:e[+-]?\d+)?)[ulf]*\b/i,keyword:/\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/}),Prism.languages.insertBefore("glsl","comment",{preprocessor:{pattern:/(^[ \t]*)#(?:(?:define|undef|if|ifdef|ifndef|else|elif|endif|error|pragma|extension|version|line)\b)?/m,lookbehind:!0,alias:"builtin"}}); -Prism.languages.go=Prism.languages.extend("clike",{keyword:/\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,builtin:/\b(bool|byte|complex(64|128)|error|float(32|64)|rune|string|u?int(8|16|32|64|)|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(ln)?|real|recover)\b/,"boolean":/\b(_|iota|nil|true|false)\b/,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,number:/\b(-?(0x[a-f\d]+|(\d+\.?\d*|\.\d+)(e[-+]?\d+)?)i?)\b/i,string:/("|'|`)(\\?.|\r|\n)*?\1/}),delete Prism.languages.go["class-name"]; -Prism.languages.graphql={comment:/#.*/,string:{pattern:/"(?:\\.|[^\\"])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/,"boolean":/\b(?:true|false)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":/[a-z_]\w*(?=\s*:)/i,keyword:[{pattern:/(fragment\s+(?!on)[a-z_]\w*\s+|\.\.\.\s*)on\b/,lookbehind:!0},/\b(?:query|fragment|mutation)\b/],operator:/!|=|\.{3}/,punctuation:/[!(){}\[\]:=,]/}; -Prism.languages.groovy=Prism.languages.extend("clike",{keyword:/\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,string:[{pattern:/("""|''')[\W\w]*?\1|(\$\/)(\$\/\$|[\W\w])*?\/\$/,greedy:!0},{pattern:/("|'|\/)(?:\\?.)*?\1/,greedy:!0}],number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?[\d]+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.{1,2}(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),Prism.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),Prism.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(setup|given|when|then|and|cleanup|expect|where):/}),Prism.languages.insertBefore("groovy","function",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0}}),Prism.hooks.add("wrap",function(e){if("groovy"===e.language&&"string"===e.type){var t=e.content[0];if("'"!=t){var n=/([^\\])(\$(\{.*?\}|[\w\.]+))/;"$"===t&&(n=/([^\$])(\$(\{.*?\}|[\w\.]+))/),e.content=e.content.replace(/&/g,"&").replace(/</g,"<"),e.content=Prism.highlight(e.content,{expression:{pattern:n,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push("/"===t?"regex":"gstring")}}}); -!function(e){e.languages.haml={"multiline-comment":{pattern:/((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*((?:\r?\n|\r)\2[\t ]+.+)*/,lookbehind:!0,alias:"comment"},"multiline-code":[{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*((?:\r?\n|\r)\2[\t ]+.*,[\t ]*)*((?:\r?\n|\r)\2[\t ]+.+)/,lookbehind:!0,inside:{rest:e.languages.ruby}},{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*((?:\r?\n|\r)\2[\t ]+.*\|[\t ]*)*/,lookbehind:!0,inside:{rest:e.languages.ruby}}],filter:{pattern:/((?:^|\r?\n|\r)([\t ]*)):[\w-]+((?:\r?\n|\r)(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"}}},markup:{pattern:/((?:^|\r?\n|\r)[\t ]*)<.+/,lookbehind:!0,inside:{rest:e.languages.markup}},doctype:{pattern:/((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/,lookbehind:!0},tag:{pattern:/((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^}])+\}|\[[^\]]+\])*[\/<>]*/,lookbehind:!0,inside:{attributes:[{pattern:/(^|[^#])\{(?:\{[^}]+\}|[^}])+\}/,lookbehind:!0,inside:{rest:e.languages.ruby}},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*)(?:"(?:\\?.)*?"|[^)\s]+)/,lookbehind:!0},"attr-name":/[\w:-]+(?=\s*!?=|\s*[,)])/,punctuation:/[=(),]/}},{pattern:/\[[^\]]+\]/,inside:{rest:e.languages.ruby}}],punctuation:/[<>]/}},code:{pattern:/((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,lookbehind:!0,inside:{rest:e.languages.ruby}},interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:e.languages.ruby}},punctuation:{pattern:/((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/,lookbehind:!0}};for(var t="((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}((?:\\r?\\n|\\r)(?:\\2[\\t ]+.+|\\s*?(?=\\r?\\n|\\r)))+",r=["css",{filter:"coffee",language:"coffeescript"},"erb","javascript","less","markdown","ruby","scss","textile"],n={},a=0,i=r.length;i>a;a++){var l=r[a];l="string"==typeof l?{filter:l,language:l}:l,e.languages[l.language]&&(n["filter-"+l.filter]={pattern:RegExp(t.replace("{{filter_name}}",l.filter)),lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"},rest:e.languages[l.language]}})}e.languages.insertBefore("haml","filter",n)}(Prism); -!function(e){var a=/\{\{\{[\w\W]+?\}\}\}|\{\{[\w\W]+?\}\}/g;e.languages.handlebars=e.languages.extend("markup",{handlebars:{pattern:a,inside:{delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(\\?.)*?\1/,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/,"boolean":/\b(true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\w\W]+/}},punctuation:/[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~\s]+/}}}),e.languages.insertBefore("handlebars","tag",{"handlebars-comment":{pattern:/\{\{![\w\W]*?\}\}/,alias:["handlebars","comment"]}}),e.hooks.add("before-highlight",function(e){"handlebars"===e.language&&(e.tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(a,function(a){return e.tokenStack.push(a),"___HANDLEBARS"+e.tokenStack.length+"___"}))}),e.hooks.add("before-insert",function(e){"handlebars"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),e.hooks.add("after-highlight",function(a){if("handlebars"===a.language){for(var n,t=0;n=a.tokenStack[t];t++)a.highlightedCode=a.highlightedCode.replace("___HANDLEBARS"+(t+1)+"___",e.highlight(n,a.grammar,"handlebars").replace(/\$/g,"$$$$"));a.element.innerHTML=a.highlightedCode}})}(Prism); -Prism.languages.haskell={comment:{pattern:/(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\w\W]*?-})/m,lookbehind:!0},"char":/'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,string:{pattern:/"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/,greedy:!0},keyword:/\b(case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,import_statement:{pattern:/(\r?\n|\r|^)\s*import\s+(qualified\s+)?([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*(\s+as\s+([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*)?(\s+hiding\b)?/m,inside:{keyword:/\b(import|qualified|as|hiding)\b/}},builtin:/\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,number:/\b(\d+(\.\d+)?(e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`/,hvariable:/\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/,constant:/\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/,punctuation:/[{}[\];(),.:]/}; -Prism.languages.haxe=Prism.languages.extend("clike",{string:{pattern:/(["'])(?:(?!\1)[^\\]|\\[\s\S])*\1/,inside:{interpolation:{pattern:/(^|[^\\])\$(?:\w+|\{[^}]+\})/,lookbehind:!0,inside:{interpolation:{pattern:/^\$\w*/,alias:"variable"}}}}},keyword:/\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|from|for|function|if|implements|import|in|inline|interface|macro|new|null|override|public|private|return|static|super|switch|throw|to|try|typedef|using|var|while)(?!\.)\b/,operator:/\.{3}|\+\+?|-[->]?|[=!]=?|&&?|\|\|?|<[<=]?|>[>=]?|[*\/%~^]/}),Prism.languages.insertBefore("haxe","class-name",{regex:{pattern:/~\/(?:[^\/\\\r\n]|\\.)+\/[igmsu]*/}}),Prism.languages.insertBefore("haxe","keyword",{preprocessor:{pattern:/#\w+/,alias:"builtin"},metadata:{pattern:/@:?\w+/,alias:"symbol"},reification:{pattern:/\$(?:\w+|(?=\{))/,alias:"variable"}}),Prism.languages.haxe.string.inside.interpolation.inside.rest=Prism.util.clone(Prism.languages.haxe),delete Prism.languages.haxe["class-name"]; -Prism.languages.http={"request-line":{pattern:/^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b\shttps?:\/\/\S+\sHTTP\/[0-9.]+/m,inside:{property:/^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/,"attr-name":/:\w+/}},"response-status":{pattern:/^HTTP\/1.[01] [0-9]+.*/m,inside:{property:{pattern:/(^HTTP\/1.[01] )[0-9]+.*/i,lookbehind:!0}}},"header-name":{pattern:/^[\w-]+:(?=.)/m,alias:"keyword"}};var httpLanguages={"application/json":Prism.languages.javascript,"application/xml":Prism.languages.markup,"text/xml":Prism.languages.markup,"text/html":Prism.languages.markup};for(var contentType in httpLanguages)if(httpLanguages[contentType]){var options={};options[contentType]={pattern:new RegExp("(content-type:\\s*"+contentType+"[\\w\\W]*?)(?:\\r?\\n|\\r){2}[\\w\\W]*","i"),lookbehind:!0,inside:{rest:httpLanguages[contentType]}},Prism.languages.insertBefore("http","header-name",options)}; -Prism.languages.icon={comment:/#.*/,string:/(["'])(?:(?!\1)[^\\\r\n]|\\.|_(?:\r?\n|\r))*\1/,number:/\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,"builtin-keyword":{pattern:/&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,alias:"variable"},directive:{pattern:/\$\w+/,alias:"builtin"},keyword:/\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,"function":/(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,operator:/[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,punctuation:/[\[\](){},;]/}; -Prism.languages.inform7={string:{pattern:/"[^"]*"/,inside:{substitution:{pattern:/\[[^\]]+\]/,inside:{delimiter:{pattern:/\[|\]/,alias:"punctuation"}}}}},comment:/\[[^\]]+\]/,title:{pattern:/^[ \t]*(?:volume|book|part(?! of)|chapter|section|table)\b.+/im,alias:"important"},number:{pattern:/(^|[^-])(?:(?:\b|-)\d+(?:\.\d+)?(?:\^\d+)?\w*|\b(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve))\b(?!-)/i,lookbehind:!0},verb:{pattern:/(^|[^-])\b(?:applying to|are|attacking|answering|asking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:s|ing)?|consulting|contain(?:s|ing)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:ve|s|ving)|hold(?:s|ing)?|impl(?:y|ies)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:s|ing)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:s|ing)?|setting|showing|singing|sleeping|smelling|squeezing|switching|support(?:s|ing)?|swearing|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:s|ing)?|var(?:y|ies|ying)|waiting|waking|waving|wear(?:s|ing)?)\b(?!-)/i,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|unless|the story)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i,lookbehind:!0},property:{pattern:/(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: on| off)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,lookbehind:!0,alias:"symbol"},position:{pattern:/(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|[^-])\b(?:actions?|activit(?:y|ies)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i,lookbehind:!0,alias:"variable"},punctuation:/[.,:;(){}]/},Prism.languages.inform7.string.inside.substitution.inside.rest=Prism.util.clone(Prism.languages.inform7),Prism.languages.inform7.string.inside.substitution.inside.rest.text={pattern:/\S(?:\s*\S)*/,alias:"comment"}; -Prism.languages.ini={comment:/^[ \t]*;.*$/m,important:/\[.*?\]/,constant:/^[ \t]*[^\s=]+?(?=[ \t]*=)/m,"attr-value":{pattern:/=.*/,inside:{punctuation:/^[=]/}}}; -Prism.languages.j={comment:/\bNB\..*/,string:/'(?:''|[^'\r\n])*'/,keyword:/\b(?:(?:adverb|conjunction|CR|def|define|dyad|LF|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,verb:{pattern:/(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[\^?]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,alias:"keyword"},number:/\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_(?!\.))/,adverb:{pattern:/[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,alias:"builtin"},operator:/[=a][.:]|_\./,conjunction:{pattern:/&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,alias:"variable"},punctuation:/[()]/}; -!function(e){e.languages.jade={comment:{pattern:/(^([\t ]*))\/\/.*((?:\r?\n|\r)\2[\t ]+.+)*/m,lookbehind:!0},"multiline-script":{pattern:/(^([\t ]*)script\b.*\.[\t ]*)((?:\r?\n|\r(?!\n))(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0,inside:{rest:e.languages.javascript}},filter:{pattern:/(^([\t ]*)):.+((?:\r?\n|\r(?!\n))(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"}}},"multiline-plain-text":{pattern:/(^([\t ]*)[\w\-#.]+\.[\t ]*)((?:\r?\n|\r(?!\n))(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0},markup:{pattern:/(^[\t ]*)<.+/m,lookbehind:!0,inside:{rest:e.languages.markup}},doctype:{pattern:/((?:^|\n)[\t ]*)doctype(?: .+)?/,lookbehind:!0},"flow-control":{pattern:/(^[\t ]*)(?:if|unless|else|case|when|default|each|while)\b(?: .+)?/m,lookbehind:!0,inside:{each:{pattern:/^each .+? in\b/,inside:{keyword:/\b(?:each|in)\b/,punctuation:/,/}},branch:{pattern:/^(?:if|unless|else|case|when|default|while)\b/,alias:"keyword"},rest:e.languages.javascript}},keyword:{pattern:/(^[\t ]*)(?:block|extends|include|append|prepend)\b.+/m,lookbehind:!0},mixin:[{pattern:/(^[\t ]*)mixin .+/m,lookbehind:!0,inside:{keyword:/^mixin/,"function":/\w+(?=\s*\(|\s*$)/,punctuation:/[(),.]/}},{pattern:/(^[\t ]*)\+.+/m,lookbehind:!0,inside:{name:{pattern:/^\+\w+/,alias:"function"},rest:e.languages.javascript}}],script:{pattern:/(^[\t ]*script(?:(?:&[^(]+)?\([^)]+\))*[\t ]+).+/m,lookbehind:!0,inside:{rest:e.languages.javascript}},"plain-text":{pattern:/(^[\t ]*(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?[\t ]+).+/m,lookbehind:!0},tag:{pattern:/(^[\t ]*)(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?:?/m,lookbehind:!0,inside:{attributes:[{pattern:/&[^(]+\([^)]+\)/,inside:{rest:e.languages.javascript}},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*)(?:\{[^}]*\}|[^,)\r\n]+)/,lookbehind:!0,inside:{rest:e.languages.javascript}},"attr-name":/[\w-]+(?=\s*!?=|\s*[,)])/,punctuation:/[!=(),]+/}}],punctuation:/:/}},code:[{pattern:/(^[\t ]*(?:-|!?=)).+/m,lookbehind:!0,inside:{rest:e.languages.javascript}}],punctuation:/[.\-!=|]+/};for(var t="(^([\\t ]*)):{{filter_name}}((?:\\r?\\n|\\r(?!\\n))(?:\\2[\\t ]+.+|\\s*?(?=\\r?\\n|\\r)))+",n=[{filter:"atpl",language:"twig"},{filter:"coffee",language:"coffeescript"},"ejs","handlebars","hogan","less","livescript","markdown","mustache","plates",{filter:"sass",language:"scss"},"stylus","swig"],a={},i=0,r=n.length;r>i;i++){var s=n[i];s="string"==typeof s?{filter:s,language:s}:s,e.languages[s.language]&&(a["filter-"+s.filter]={pattern:RegExp(t.replace("{{filter_name}}",s.filter),"m"),lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"},rest:e.languages[s.language]}})}e.languages.insertBefore("jade","filter",a)}(Prism); -Prism.languages.java=Prism.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),Prism.languages.insertBefore("java","function",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0}}); -Prism.languages.json={property:/".*?"(?=\s*:)/gi,string:/"(?!:)(\\?[^"])*?"(?!:)/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,punctuation:/[{}[\]);,]/g,operator:/:/g,"boolean":/\b(true|false)\b/gi,"null":/\bnull\b/gi},Prism.languages.jsonp=Prism.languages.json; -Prism.languages.julia={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/,keyword:/\b(abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|let|local|macro|module|print|println|quote|return|try|type|typealias|using|while)\b/,"boolean":/\b(true|false)\b/,number:/\b-?(0[box])?(?:[\da-f]+\.?\d*|\.\d+)(?:[efp][+-]?\d+)?j?\b/i,operator:/\+=?|-=?|\*=?|\/[\/=]?|\\=?|\^=?|%=?|÷=?|!=?=?|&=?|\|[=>]?|\$=?|<(?:<=?|[=:])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥]/,punctuation:/[{}[\];(),.:]/}; -Prism.languages.keyman={comment:/\bc\s.*/i,"function":/\[\s*((CTRL|SHIFT|ALT|LCTRL|RCTRL|LALT|RALT|CAPS|NCAPS)\s+)*([TKU]_[a-z0-9_?]+|".+?"|'.+?')\s*\]/i,string:/("|')((?!\1).)*\1/,bold:[/&(baselayout|bitmap|capsononly|capsalwaysoff|shiftfreescaps|copyright|ethnologuecode|hotkey|includecodes|keyboardversion|kmw_embedcss|kmw_embedjs|kmw_helpfile|kmw_helptext|kmw_rtl|language|layer|layoutfile|message|mnemoniclayout|name|oldcharposmatching|platform|targets|version|visualkeyboard|windowslanguages)\b/i,/\b(bitmap|bitmaps|caps on only|caps always off|shift frees caps|copyright|hotkey|language|layout|message|name|version)\b/i],keyword:/\b(any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|return|reset|save|set|store|use)\b/i,atrule:/\b(ansi|begin|unicode|group|using keys|match|nomatch)\b/i,number:/\b(U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,operator:/[+>\\,()]/,tag:/\$(keyman|kmfl|weaver|keymanweb|keymanonly):/i}; -!function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|else|enum|final|finally|for|fun|get|if|import|in|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|out|override|package|private|protected|public|reified|return|sealed|set|super|tailrec|this|throw|to|try|val|var|when|where|while)\b/,lookbehind:!0},"function":[/\w+(?=\s*\()/,{pattern:/(\.)\w+(?=\s*\{)/,lookbehind:!0}],number:/\b(?:0[bx][\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"],n.languages.insertBefore("kotlin","string",{"raw-string":{pattern:/(["'])\1\1[\s\S]*?\1{3}/,alias:"string"}}),n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\w+@|@\w+/,alias:"symbol"}});var e=[{pattern:/\$\{[^}]+\}/,inside:{delimiter:{pattern:/^\$\{|\}$/,alias:"variable"},rest:n.util.clone(n.languages.kotlin)}},{pattern:/\$\w+/,alias:"variable"}];n.languages.kotlin.string.inside=n.languages.kotlin["raw-string"].inside={interpolation:e}}(Prism); -!function(a){var e=/\\([^a-z()[\]]|[a-z\*]+)/i,n={"equation-command":{pattern:e,alias:"regex"}};a.languages.latex={comment:/%.*/m,cdata:{pattern:/(\\begin\{((?:verbatim|lstlisting)\*?)\})([\w\W]*?)(?=\\end\{\2\})/,lookbehind:!0},equation:[{pattern:/\$(?:\\?[\w\W])*?\$|\\\((?:\\?[\w\W])*?\\\)|\\\[(?:\\?[\w\W])*?\\\]/,inside:n,alias:"string"},{pattern:/(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})([\w\W]*?)(?=\\end\{\2\})/,lookbehind:!0,inside:n,alias:"string"}],keyword:{pattern:/(\\(?:begin|end|ref|cite|label|usepackage|documentclass)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0},url:{pattern:/(\\url\{)[^}]+(?=\})/,lookbehind:!0},headline:{pattern:/(\\(?:part|chapter|section|subsection|frametitle|subsubsection|paragraph|subparagraph|subsubparagraph|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\}(?:\[[^\]]+\])?)/,lookbehind:!0,alias:"class-name"},"function":{pattern:e,alias:"selector"},punctuation:/[[\]{}&]/}}(Prism); -Prism.languages.less=Prism.languages.extend("css",{comment:[/\/\*[\w\W]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-]+?(?:\([^{}]+\)|[^(){};])*?(?=\s*\{)/i,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{};@])*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,punctuation:/[{}();:,]/,operator:/[+\-*\/]/}),Prism.languages.insertBefore("less","punctuation",{"function":Prism.languages.less.function}),Prism.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/,lookbehind:!0,alias:"function"}}); -Prism.languages.livescript={"interpolated-string":{pattern:/("""|")(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0,inside:{variable:{pattern:/(^|[^\\])#[a-z_](?:-?[a-z]|\d)*/m,lookbehind:!0},interpolation:{pattern:/(^|[^\\])#\{[^}]+\}/m,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^#\{|\}$/,alias:"variable"}}},string:/[\s\S]+/}},comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},{pattern:/<\[[\s\S]*?\]>/,greedy:!0},/\\[^\s,;\])}]+/],regex:[{pattern:/\/\/(\[.+?]|\\.|(?!\/\/)[^\\])+\/\/[gimyu]{0,5}/,greedy:!0,inside:{comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0}}},{pattern:/\/(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}/,greedy:!0}],keyword:{pattern:/(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m,lookbehind:!0},"keyword-operator":{pattern:/(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?:nt| not)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m,lookbehind:!0,alias:"operator"},"boolean":{pattern:/(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m,lookbehind:!0},argument:{pattern:/(^|(?!\.&\.)[^&])&(?!&)\d*/m,lookbehind:!0,alias:"variable"},number:/\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i,identifier:/[a-z_](?:-?[a-z]|\d)*/i,operator:[{pattern:/( )\.(?= )/,lookbehind:!0},/\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/],punctuation:/[(){}\[\]|.,:;`]/},Prism.languages.livescript["interpolated-string"].inside.interpolation.inside.rest=Prism.languages.livescript; -Prism.languages.lolcode={comment:[/\bOBTW\s+[\s\S]*?\s+TLDR\b/,/\bBTW.+/],string:{pattern:/"(?::.|[^"])*"/,inside:{variable:/:\{[^}]+\}/,symbol:[/:\([a-f\d]+\)/i,/:\[[^\]]+\]/,/:[)>o":]/]}},number:/(-|\b)\d*\.?\d+/,symbol:{pattern:/(^|\s)(?:A )?(?:YARN|NUMBR|NUMBAR|TROOF|BUKKIT|NOOB)(?=\s|,|$)/,lookbehind:!0,inside:{keyword:/A(?=\s)/}},label:{pattern:/((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,lookbehind:!0,alias:"string"},"function":{pattern:/((?:^|\s)(?:I IZ|HOW IZ I|IZ) )[a-zA-Z]\w*/,lookbehind:!0},keyword:[{pattern:/(^|\s)(?:O HAI IM|KTHX|HAI|KTHXBYE|I HAS A|ITZ(?: A)?|R|AN|MKAY|SMOOSH|MAEK|IS NOW(?: A)?|VISIBLE|GIMMEH|O RLY\?|YA RLY|NO WAI|OIC|MEBBE|WTF\?|OMG|OMGWTF|GTFO|IM IN YR|IM OUTTA YR|FOUND YR|YR|TIL|WILE|UPPIN|NERFIN|I IZ|HOW IZ I|IF U SAY SO|SRS|HAS A|LIEK(?: A)?|IZ)(?=\s|,|$)/,lookbehind:!0},/'Z(?=\s|,|$)/],"boolean":{pattern:/(^|\s)(?:WIN|FAIL)(?=\s|,|$)/,lookbehind:!0},variable:{pattern:/(^|\s)IT(?=\s|,|$)/,lookbehind:!0},operator:{pattern:/(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:SUM|DIFF|PRODUKT|QUOSHUNT|MOD|BIGGR|SMALLR|BOTH|EITHER|WON|ALL|ANY) OF)(?=\s|,|$)/,lookbehind:!0},punctuation:/\.{3}|…|,|!/}; -Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|\.?\d*(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,"function":/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}; -Prism.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|.)*/,lookbehind:!0},string:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,builtin:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,symbol:{pattern:/^[^:=\r\n]+(?=\s*:(?!=))/m,inside:{variable:/\$+(?:[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:[/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,{pattern:/(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,lookbehind:!0}],operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}; -Prism.languages.markdown=Prism.languages.extend("markup",{}),Prism.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},code:[{pattern:/^(?: {4}|\t).+/m,alias:"keyword"},{pattern:/``.+?``|`[^`\n]+`/,alias:"keyword"}],title:[{pattern:/\w+.*(?:\r?\n|\r)(?:==+|--+)/,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])([\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:/(^|[^\\])(\*\*|__)(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,lookbehind:!0,inside:{punctuation:/^\*\*|^__|\*\*$|__$/}},italic:{pattern:/(^|[^\\])([*_])(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,lookbehind:!0,inside:{punctuation:/^[*_]|[*_]$/}},url:{pattern:/!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[[^\]\n]*\])/,inside:{variable:{pattern:/(!?\[)[^\]]+(?=\]$)/,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),Prism.languages.markdown.bold.inside.url=Prism.util.clone(Prism.languages.markdown.url),Prism.languages.markdown.italic.inside.url=Prism.util.clone(Prism.languages.markdown.url),Prism.languages.markdown.bold.inside.italic=Prism.util.clone(Prism.languages.markdown.italic),Prism.languages.markdown.italic.inside.bold=Prism.util.clone(Prism.languages.markdown.bold); -Prism.languages.matlab={string:/\B'(?:''|[^'\n])*'/,comment:[/%\{[\s\S]*?\}%/,/%.+/],number:/\b-?(?:\d*\.?\d+(?:[eE][+-]?\d+)?(?:[ij])?|[ij])\b/,keyword:/\b(?:break|case|catch|continue|else|elseif|end|for|function|if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/,"function":/(?!\d)\w+(?=\s*\()/,operator:/\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,punctuation:/\.{3}|[.,;\[\](){}!]/}; -Prism.languages.mel={comment:/\/\/.*/,code:{pattern:/`(?:\\.|[^\\`\r\n])*`/,alias:"italic",inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"}}},string:/"(?:\\.|[^\\"\r\n])*"/,variable:/\$\w+/,number:/(?:\b|-)(?:0x[\da-fA-F]+|\d+\.?\d*)/,flag:{pattern:/-[^\d\W]\w*/,alias:"operator"},keyword:/\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/,"function":/\w+(?=\()|\b(?:about|abs|addAttr|addAttributeEditorNodeHelp|addDynamic|addNewShelfTab|addPP|addPanelCategory|addPrefixToName|advanceToNextDrivenKey|affectedNet|affects|aimConstraint|air|alias|aliasAttr|align|alignCtx|alignCurve|alignSurface|allViewFit|ambientLight|angle|angleBetween|animCone|animCurveEditor|animDisplay|animView|annotate|appendStringArray|applicationName|applyAttrPreset|applyTake|arcLenDimContext|arcLengthDimension|arclen|arrayMapper|art3dPaintCtx|artAttrCtx|artAttrPaintVertexCtx|artAttrSkinPaintCtx|artAttrTool|artBuildPaintMenu|artFluidAttrCtx|artPuttyCtx|artSelectCtx|artSetPaintCtx|artUserPaintCtx|assignCommand|assignInputDevice|assignViewportFactories|attachCurve|attachDeviceAttr|attachSurface|attrColorSliderGrp|attrCompatibility|attrControlGrp|attrEnumOptionMenu|attrEnumOptionMenuGrp|attrFieldGrp|attrFieldSliderGrp|attrNavigationControlGrp|attrPresetEditWin|attributeExists|attributeInfo|attributeMenu|attributeQuery|autoKeyframe|autoPlace|bakeClip|bakeFluidShading|bakePartialHistory|bakeResults|bakeSimulation|basename|basenameEx|batchRender|bessel|bevel|bevelPlus|binMembership|bindSkin|blend2|blendShape|blendShapeEditor|blendShapePanel|blendTwoAttr|blindDataType|boneLattice|boundary|boxDollyCtx|boxZoomCtx|bufferCurve|buildBookmarkMenu|buildKeyframeMenu|button|buttonManip|CBG|cacheFile|cacheFileCombine|cacheFileMerge|cacheFileTrack|camera|cameraView|canCreateManip|canvas|capitalizeString|catch|catchQuiet|ceil|changeSubdivComponentDisplayLevel|changeSubdivRegion|channelBox|character|characterMap|characterOutlineEditor|characterize|chdir|checkBox|checkBoxGrp|checkDefaultRenderGlobals|choice|circle|circularFillet|clamp|clear|clearCache|clip|clipEditor|clipEditorCurrentTimeCtx|clipSchedule|clipSchedulerOutliner|clipTrimBefore|closeCurve|closeSurface|cluster|cmdFileOutput|cmdScrollFieldExecuter|cmdScrollFieldReporter|cmdShell|coarsenSubdivSelectionList|collision|color|colorAtPoint|colorEditor|colorIndex|colorIndexSliderGrp|colorSliderButtonGrp|colorSliderGrp|columnLayout|commandEcho|commandLine|commandPort|compactHairSystem|componentEditor|compositingInterop|computePolysetVolume|condition|cone|confirmDialog|connectAttr|connectControl|connectDynamic|connectJoint|connectionInfo|constrain|constrainValue|constructionHistory|container|containsMultibyte|contextInfo|control|convertFromOldLayers|convertIffToPsd|convertLightmap|convertSolidTx|convertTessellation|convertUnit|copyArray|copyFlexor|copyKey|copySkinWeights|cos|cpButton|cpCache|cpClothSet|cpCollision|cpConstraint|cpConvClothToMesh|cpForces|cpGetSolverAttr|cpPanel|cpProperty|cpRigidCollisionFilter|cpSeam|cpSetEdit|cpSetSolverAttr|cpSolver|cpSolverTypes|cpTool|cpUpdateClothUVs|createDisplayLayer|createDrawCtx|createEditor|createLayeredPsdFile|createMotionField|createNewShelf|createNode|createRenderLayer|createSubdivRegion|cross|crossProduct|ctxAbort|ctxCompletion|ctxEditMode|ctxTraverse|currentCtx|currentTime|currentTimeCtx|currentUnit|curve|curveAddPtCtx|curveCVCtx|curveEPCtx|curveEditorCtx|curveIntersect|curveMoveEPCtx|curveOnSurface|curveSketchCtx|cutKey|cycleCheck|cylinder|dagPose|date|defaultLightListCheckBox|defaultNavigation|defineDataServer|defineVirtualDevice|deformer|deg_to_rad|delete|deleteAttr|deleteShadingGroupsAndMaterials|deleteShelfTab|deleteUI|deleteUnusedBrushes|delrandstr|detachCurve|detachDeviceAttr|detachSurface|deviceEditor|devicePanel|dgInfo|dgdirty|dgeval|dgtimer|dimWhen|directKeyCtx|directionalLight|dirmap|dirname|disable|disconnectAttr|disconnectJoint|diskCache|displacementToPoly|displayAffected|displayColor|displayCull|displayLevelOfDetail|displayPref|displayRGBColor|displaySmoothness|displayStats|displayString|displaySurface|distanceDimContext|distanceDimension|doBlur|dolly|dollyCtx|dopeSheetEditor|dot|dotProduct|doubleProfileBirailSurface|drag|dragAttrContext|draggerContext|dropoffLocator|duplicate|duplicateCurve|duplicateSurface|dynCache|dynControl|dynExport|dynExpression|dynGlobals|dynPaintEditor|dynParticleCtx|dynPref|dynRelEdPanel|dynRelEditor|dynamicLoad|editAttrLimits|editDisplayLayerGlobals|editDisplayLayerMembers|editRenderLayerAdjustment|editRenderLayerGlobals|editRenderLayerMembers|editor|editorTemplate|effector|emit|emitter|enableDevice|encodeString|endString|endsWith|env|equivalent|equivalentTol|erf|error|eval|evalDeferred|evalEcho|event|exactWorldBoundingBox|exclusiveLightCheckBox|exec|executeForEachObject|exists|exp|expression|expressionEditorListen|extendCurve|extendSurface|extrude|fcheck|fclose|feof|fflush|fgetline|fgetword|file|fileBrowserDialog|fileDialog|fileExtension|fileInfo|filetest|filletCurve|filter|filterCurve|filterExpand|filterStudioImport|findAllIntersections|findAnimCurves|findKeyframe|findMenuItem|findRelatedSkinCluster|finder|firstParentOf|fitBspline|flexor|floatEq|floatField|floatFieldGrp|floatScrollBar|floatSlider|floatSlider2|floatSliderButtonGrp|floatSliderGrp|floor|flow|fluidCacheInfo|fluidEmitter|fluidVoxelInfo|flushUndo|fmod|fontDialog|fopen|formLayout|format|fprint|frameLayout|fread|freeFormFillet|frewind|fromNativePath|fwrite|gamma|gauss|geometryConstraint|getApplicationVersionAsFloat|getAttr|getClassification|getDefaultBrush|getFileList|getFluidAttr|getInputDeviceRange|getMayaPanelTypes|getModifiers|getPanel|getParticleAttr|getPluginResource|getenv|getpid|glRender|glRenderEditor|globalStitch|gmatch|goal|gotoBindPose|grabColor|gradientControl|gradientControlNoAttr|graphDollyCtx|graphSelectContext|graphTrackCtx|gravity|grid|gridLayout|group|groupObjectsByName|HfAddAttractorToAS|HfAssignAS|HfBuildEqualMap|HfBuildFurFiles|HfBuildFurImages|HfCancelAFR|HfConnectASToHF|HfCreateAttractor|HfDeleteAS|HfEditAS|HfPerformCreateAS|HfRemoveAttractorFromAS|HfSelectAttached|HfSelectAttractors|HfUnAssignAS|hardenPointCurve|hardware|hardwareRenderPanel|headsUpDisplay|headsUpMessage|help|helpLine|hermite|hide|hilite|hitTest|hotBox|hotkey|hotkeyCheck|hsv_to_rgb|hudButton|hudSlider|hudSliderButton|hwReflectionMap|hwRender|hwRenderLoad|hyperGraph|hyperPanel|hyperShade|hypot|iconTextButton|iconTextCheckBox|iconTextRadioButton|iconTextRadioCollection|iconTextScrollList|iconTextStaticLabel|ikHandle|ikHandleCtx|ikHandleDisplayScale|ikSolver|ikSplineHandleCtx|ikSystem|ikSystemInfo|ikfkDisplayMethod|illustratorCurves|image|imfPlugins|inheritTransform|insertJoint|insertJointCtx|insertKeyCtx|insertKnotCurve|insertKnotSurface|instance|instanceable|instancer|intField|intFieldGrp|intScrollBar|intSlider|intSliderGrp|interToUI|internalVar|intersect|iprEngine|isAnimCurve|isConnected|isDirty|isParentOf|isSameObject|isTrue|isValidObjectName|isValidString|isValidUiName|isolateSelect|itemFilter|itemFilterAttr|itemFilterRender|itemFilterType|joint|jointCluster|jointCtx|jointDisplayScale|jointLattice|keyTangent|keyframe|keyframeOutliner|keyframeRegionCurrentTimeCtx|keyframeRegionDirectKeyCtx|keyframeRegionDollyCtx|keyframeRegionInsertKeyCtx|keyframeRegionMoveKeyCtx|keyframeRegionScaleKeyCtx|keyframeRegionSelectKeyCtx|keyframeRegionSetKeyCtx|keyframeRegionTrackCtx|keyframeStats|lassoContext|lattice|latticeDeformKeyCtx|launch|launchImageEditor|layerButton|layeredShaderPort|layeredTexturePort|layout|layoutDialog|lightList|lightListEditor|lightListPanel|lightlink|lineIntersection|linearPrecision|linstep|listAnimatable|listAttr|listCameras|listConnections|listDeviceAttachments|listHistory|listInputDeviceAxes|listInputDeviceButtons|listInputDevices|listMenuAnnotation|listNodeTypes|listPanelCategories|listRelatives|listSets|listTransforms|listUnselected|listerEditor|loadFluid|loadNewShelf|loadPlugin|loadPluginLanguageResources|loadPrefObjects|localizedPanelLabel|lockNode|loft|log|longNameOf|lookThru|ls|lsThroughFilter|lsType|lsUI|Mayatomr|mag|makeIdentity|makeLive|makePaintable|makeRoll|makeSingleSurface|makeTubeOn|makebot|manipMoveContext|manipMoveLimitsCtx|manipOptions|manipRotateContext|manipRotateLimitsCtx|manipScaleContext|manipScaleLimitsCtx|marker|match|max|memory|menu|menuBarLayout|menuEditor|menuItem|menuItemToShelf|menuSet|menuSetPref|messageLine|min|minimizeApp|mirrorJoint|modelCurrentTimeCtx|modelEditor|modelPanel|mouse|movIn|movOut|move|moveIKtoFK|moveKeyCtx|moveVertexAlongDirection|multiProfileBirailSurface|mute|nParticle|nameCommand|nameField|namespace|namespaceInfo|newPanelItems|newton|nodeCast|nodeIconButton|nodeOutliner|nodePreset|nodeType|noise|nonLinear|normalConstraint|normalize|nurbsBoolean|nurbsCopyUVSet|nurbsCube|nurbsEditUV|nurbsPlane|nurbsSelect|nurbsSquare|nurbsToPoly|nurbsToPolygonsPref|nurbsToSubdiv|nurbsToSubdivPref|nurbsUVSet|nurbsViewDirectionVector|objExists|objectCenter|objectLayer|objectType|objectTypeUI|obsoleteProc|oceanNurbsPreviewPlane|offsetCurve|offsetCurveOnSurface|offsetSurface|openGLExtension|openMayaPref|optionMenu|optionMenuGrp|optionVar|orbit|orbitCtx|orientConstraint|outlinerEditor|outlinerPanel|overrideModifier|paintEffectsDisplay|pairBlend|palettePort|paneLayout|panel|panelConfiguration|panelHistory|paramDimContext|paramDimension|paramLocator|parent|parentConstraint|particle|particleExists|particleInstancer|particleRenderInfo|partition|pasteKey|pathAnimation|pause|pclose|percent|performanceOptions|pfxstrokes|pickWalk|picture|pixelMove|planarSrf|plane|play|playbackOptions|playblast|plugAttr|plugNode|pluginInfo|pluginResourceUtil|pointConstraint|pointCurveConstraint|pointLight|pointMatrixMult|pointOnCurve|pointOnSurface|pointPosition|poleVectorConstraint|polyAppend|polyAppendFacetCtx|polyAppendVertex|polyAutoProjection|polyAverageNormal|polyAverageVertex|polyBevel|polyBlendColor|polyBlindData|polyBoolOp|polyBridgeEdge|polyCacheMonitor|polyCheck|polyChipOff|polyClipboard|polyCloseBorder|polyCollapseEdge|polyCollapseFacet|polyColorBlindData|polyColorDel|polyColorPerVertex|polyColorSet|polyCompare|polyCone|polyCopyUV|polyCrease|polyCreaseCtx|polyCreateFacet|polyCreateFacetCtx|polyCube|polyCut|polyCutCtx|polyCylinder|polyCylindricalProjection|polyDelEdge|polyDelFacet|polyDelVertex|polyDuplicateAndConnect|polyDuplicateEdge|polyEditUV|polyEditUVShell|polyEvaluate|polyExtrudeEdge|polyExtrudeFacet|polyExtrudeVertex|polyFlipEdge|polyFlipUV|polyForceUV|polyGeoSampler|polyHelix|polyInfo|polyInstallAction|polyLayoutUV|polyListComponentConversion|polyMapCut|polyMapDel|polyMapSew|polyMapSewMove|polyMergeEdge|polyMergeEdgeCtx|polyMergeFacet|polyMergeFacetCtx|polyMergeUV|polyMergeVertex|polyMirrorFace|polyMoveEdge|polyMoveFacet|polyMoveFacetUV|polyMoveUV|polyMoveVertex|polyNormal|polyNormalPerVertex|polyNormalizeUV|polyOptUvs|polyOptions|polyOutput|polyPipe|polyPlanarProjection|polyPlane|polyPlatonicSolid|polyPoke|polyPrimitive|polyPrism|polyProjection|polyPyramid|polyQuad|polyQueryBlindData|polyReduce|polySelect|polySelectConstraint|polySelectConstraintMonitor|polySelectCtx|polySelectEditCtx|polySeparate|polySetToFaceNormal|polySewEdge|polyShortestPathCtx|polySmooth|polySoftEdge|polySphere|polySphericalProjection|polySplit|polySplitCtx|polySplitEdge|polySplitRing|polySplitVertex|polyStraightenUVBorder|polySubdivideEdge|polySubdivideFacet|polyToSubdiv|polyTorus|polyTransfer|polyTriangulate|polyUVSet|polyUnite|polyWedgeFace|popen|popupMenu|pose|pow|preloadRefEd|print|progressBar|progressWindow|projFileViewer|projectCurve|projectTangent|projectionContext|projectionManip|promptDialog|propModCtx|propMove|psdChannelOutliner|psdEditTextureFile|psdExport|psdTextureFile|putenv|pwd|python|querySubdiv|quit|rad_to_deg|radial|radioButton|radioButtonGrp|radioCollection|radioMenuItemCollection|rampColorPort|rand|randomizeFollicles|randstate|rangeControl|readTake|rebuildCurve|rebuildSurface|recordAttr|recordDevice|redo|reference|referenceEdit|referenceQuery|refineSubdivSelectionList|refresh|refreshAE|registerPluginResource|rehash|reloadImage|removeJoint|removeMultiInstance|removePanelCategory|rename|renameAttr|renameSelectionList|renameUI|render|renderGlobalsNode|renderInfo|renderLayerButton|renderLayerParent|renderLayerPostProcess|renderLayerUnparent|renderManip|renderPartition|renderQualityNode|renderSettings|renderThumbnailUpdate|renderWindowEditor|renderWindowSelectContext|renderer|reorder|reorderDeformers|requires|reroot|resampleFluid|resetAE|resetPfxToPolyCamera|resetTool|resolutionNode|retarget|reverseCurve|reverseSurface|revolve|rgb_to_hsv|rigidBody|rigidSolver|roll|rollCtx|rootOf|rot|rotate|rotationInterpolation|roundConstantRadius|rowColumnLayout|rowLayout|runTimeCommand|runup|sampleImage|saveAllShelves|saveAttrPreset|saveFluid|saveImage|saveInitialState|saveMenu|savePrefObjects|savePrefs|saveShelf|saveToolSettings|scale|scaleBrushBrightness|scaleComponents|scaleConstraint|scaleKey|scaleKeyCtx|sceneEditor|sceneUIReplacement|scmh|scriptCtx|scriptEditorInfo|scriptJob|scriptNode|scriptTable|scriptToShelf|scriptedPanel|scriptedPanelType|scrollField|scrollLayout|sculpt|searchPathArray|seed|selLoadSettings|select|selectContext|selectCurveCV|selectKey|selectKeyCtx|selectKeyframeRegionCtx|selectMode|selectPref|selectPriority|selectType|selectedNodes|selectionConnection|separator|setAttr|setAttrEnumResource|setAttrMapping|setAttrNiceNameResource|setConstraintRestPosition|setDefaultShadingGroup|setDrivenKeyframe|setDynamic|setEditCtx|setEditor|setFluidAttr|setFocus|setInfinity|setInputDeviceMapping|setKeyCtx|setKeyPath|setKeyframe|setKeyframeBlendshapeTargetWts|setMenuMode|setNodeNiceNameResource|setNodeTypeFlag|setParent|setParticleAttr|setPfxToPolyCamera|setPluginResource|setProject|setStampDensity|setStartupMessage|setState|setToolTo|setUITemplate|setXformManip|sets|shadingConnection|shadingGeometryRelCtx|shadingLightRelCtx|shadingNetworkCompare|shadingNode|shapeCompare|shelfButton|shelfLayout|shelfTabLayout|shellField|shortNameOf|showHelp|showHidden|showManipCtx|showSelectionInTitle|showShadingGroupAttrEditor|showWindow|sign|simplify|sin|singleProfileBirailSurface|size|sizeBytes|skinCluster|skinPercent|smoothCurve|smoothTangentSurface|smoothstep|snap2to2|snapKey|snapMode|snapTogetherCtx|snapshot|soft|softMod|softModCtx|sort|sound|soundControl|source|spaceLocator|sphere|sphrand|spotLight|spotLightPreviewPort|spreadSheetEditor|spring|sqrt|squareSurface|srtContext|stackTrace|startString|startsWith|stitchAndExplodeShell|stitchSurface|stitchSurfacePoints|strcmp|stringArrayCatenate|stringArrayContains|stringArrayCount|stringArrayInsertAtIndex|stringArrayIntersector|stringArrayRemove|stringArrayRemoveAtIndex|stringArrayRemoveDuplicates|stringArrayRemoveExact|stringArrayToString|stringToStringArray|strip|stripPrefixFromName|stroke|subdAutoProjection|subdCleanTopology|subdCollapse|subdDuplicateAndConnect|subdEditUV|subdListComponentConversion|subdMapCut|subdMapSewMove|subdMatchTopology|subdMirror|subdToBlind|subdToPoly|subdTransferUVsToCache|subdiv|subdivCrease|subdivDisplaySmoothness|substitute|substituteAllString|substituteGeometry|substring|surface|surfaceSampler|surfaceShaderList|swatchDisplayPort|switchTable|symbolButton|symbolCheckBox|sysFile|system|tabLayout|tan|tangentConstraint|texLatticeDeformContext|texManipContext|texMoveContext|texMoveUVShellContext|texRotateContext|texScaleContext|texSelectContext|texSelectShortestPathCtx|texSmudgeUVContext|texWinToolCtx|text|textCurves|textField|textFieldButtonGrp|textFieldGrp|textManip|textScrollList|textToShelf|textureDisplacePlane|textureHairColor|texturePlacementContext|textureWindow|threadCount|threePointArcCtx|timeControl|timePort|timerX|toNativePath|toggle|toggleAxis|toggleWindowVisibility|tokenize|tokenizeList|tolerance|tolower|toolButton|toolCollection|toolDropped|toolHasOptions|toolPropertyWindow|torus|toupper|trace|track|trackCtx|transferAttributes|transformCompare|transformLimits|translator|trim|trunc|truncateFluidCache|truncateHairCache|tumble|tumbleCtx|turbulence|twoPointArcCtx|uiRes|uiTemplate|unassignInputDevice|undo|undoInfo|ungroup|uniform|unit|unloadPlugin|untangleUV|untitledFileName|untrim|upAxis|updateAE|userCtx|uvLink|uvSnapshot|validateShelfName|vectorize|view2dToolCtx|viewCamera|viewClipPlane|viewFit|viewHeadOn|viewLookAt|viewManip|viewPlace|viewSet|visor|volumeAxis|vortex|waitCursor|warning|webBrowser|webBrowserPrefs|whatIs|window|windowPref|wire|wireContext|workspace|wrinkle|wrinkleContext|writeTake|xbmLangPathList|xform)\b/,operator:[/\+[+=]?|-[-=]?|&&|\|\||[<>]=|[*\/!=]=?|[%^]/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,:;?\[\](){}]/},Prism.languages.mel.code.inside.rest=Prism.util.clone(Prism.languages.mel); -Prism.languages.mizar={comment:/::.+/,keyword:/@proof\b|\b(?:according|aggregate|all|and|antonym|are|as|associativity|assume|asymmetry|attr|be|begin|being|by|canceled|case|cases|clusters?|coherence|commutativity|compatibility|connectedness|consider|consistency|constructors|contradiction|correctness|def|deffunc|define|definitions?|defpred|do|does|equals|end|environ|ex|exactly|existence|for|from|func|given|hence|hereby|holds|idempotence|identity|iff?|implies|involutiveness|irreflexivity|is|it|let|means|mode|non|not|notations?|now|of|or|otherwise|over|per|pred|prefix|projectivity|proof|provided|qua|reconsider|redefine|reduce|reducibility|reflexivity|registrations?|requirements|reserve|sch|schemes?|section|selector|set|sethood|st|struct|such|suppose|symmetry|synonym|take|that|the|then|theorems?|thesis|thus|to|transitivity|uniqueness|vocabular(?:y|ies)|when|where|with|wrt)\b/,parameter:{pattern:/\$(?:10|\d)/,alias:"variable"},variable:/\w+(?=:)/,number:/(?:\b|-)\d+\b/,operator:/\.\.\.|->|&|\.?=/,punctuation:/\(#|#\)|[,:;\[\](){}]/}; -Prism.languages.monkey={string:/"[^"\r\n]*"/,comment:[/^#Rem\s+[\s\S]*?^#End/im,/'.+/],preprocessor:{pattern:/(^[ \t]*)#.+/m,lookbehind:!0,alias:"comment"},"function":/\w+(?=\()/,"type-char":{pattern:/(\w)[?%#$]/,lookbehind:!0,alias:"variable"},number:{pattern:/((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+((?!\.\.)\.\d*)?|\$[\da-f]+)/i,lookbehind:!0},keyword:/\b(?:Void|Strict|Public|Private|Property|Bool|Int|Float|String|Array|Object|Continue|Exit|Import|Extern|New|Self|Super|Try|Catch|Eachin|True|False|Extends|Abstract|Final|Select|Case|Default|Const|Local|Global|Field|Method|Function|Class|End|If|Then|Else|ElseIf|EndIf|While|Wend|Repeat|Until|Forever|For|To|Step|Next|Return|Module|Interface|Implements|Inline|Throw|Null)\b/i,operator:/\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,punctuation:/[.,:;()\[\]]/}; -Prism.languages.nasm={comment:/;.*$/m,string:/("|'|`)(\\?.)*?\1/m,label:{pattern:/(^\s*)[A-Za-z._?$][\w.?$@~#]*:/m,lookbehind:!0,alias:"function"},keyword:[/\[?BITS (16|32|64)\]?/m,{pattern:/(^\s*)section\s*[a-zA-Z\.]+:?/im,lookbehind:!0},/(?:extern|global)[^;\r\n]*/im,/(?:CPU|FLOAT|DEFAULT).*$/m],register:{pattern:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(bp|sp|si|di)|[cdefgs]s)\b/i,alias:"variable"},number:/(\b|-|(?=\$))(0[hx][\da-f]*\.?[\da-f]+(p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-\/%<>=&|$!]/}; -Prism.languages.nginx=Prism.languages.extend("clike",{comment:{pattern:/(^|[^"{\\])#.*/,lookbehind:!0},keyword:/\b(?:CONTENT_|DOCUMENT_|GATEWAY_|HTTP_|HTTPS|if_not_empty|PATH_|QUERY_|REDIRECT_|REMOTE_|REQUEST_|SCGI|SCRIPT_|SERVER_|http|server|events|location|include|accept_mutex|accept_mutex_delay|access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth|auth_basic|auth_basic_user_file|auth_http|auth_http_header|auth_http_timeout|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|debug_connection|debug_points|default_type|deny|devpoll_changes|devpoll_events|directio|directio_alignment|disable_symlinks|empty_gif|env|epoll_events|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_methods|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_purge|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_redirect_errors|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|google_perftools_profiles|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|imap_capabilities|imap_client_buffer|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|kqueue_changes|kqueue_events|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|lock_file|log_format|log_format_combined|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|multi_accept|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|pop3_auth|pop3_capabilities|port_in_redirect|post_action|postpone_output|protocol|proxy|proxy_buffer|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_methods|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_headers_hash_bucket_size|proxy_headers_hash_max_size|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_method|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_error_message|proxy_pass_header|proxy_pass_request_body|proxy_pass_request_headers|proxy_read_timeout|proxy_redirect|proxy_redirect_errors|proxy_send_lowat|proxy_send_timeout|proxy_set_body|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|proxy_timeout|proxy_upstream_fail_timeout|proxy_upstream_max_fails|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|rtsig_overflow_events|rtsig_overflow_test|rtsig_overflow_threshold|rtsig_signo|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|smtp_auth|smtp_capabilities|so_keepalive|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssi_value_length|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|starttls|stub_status|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timeout|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|use|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_connections|worker_cpu_affinity|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|worker_rlimit_sigpending|working_directory|xclient|xml_entities|xslt_entities|xslt_stylesheet|xslt_types)\b/i}),Prism.languages.insertBefore("nginx","keyword",{variable:/\$[a-z_]+/i}); -Prism.languages.nim={comment:/#.*/,string:/(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/,number:/\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,keyword:/\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,"function":{pattern:/(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,inside:{operator:/\*$/}},ignore:{pattern:/`[^`\r\n]+`/,inside:{punctuation:/`/}},operator:{pattern:/(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr|xor)\b)/m,lookbehind:!0},punctuation:/[({\[]\.|\.[)}\]]|[`(){}\[\],:]/}; -Prism.languages.nix={comment:/\/\*[\s\S]*?\*\/|#.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,inside:{interpolation:{pattern:/(^|(?:^|(?!'').)[^\\])\$\{(?:[^}]|\{[^}]*\})*}/,lookbehind:!0,inside:{antiquotation:{pattern:/^\$(?=\{)/,alias:"variable"}}}}},url:[/\b(?:[a-z]{3,7}:\/\/)[\w\-+%~\/.:#=?&]+/,{pattern:/([^\/])(?:[\w\-+%~.:#=?&]*(?!\/\/)[\w\-+%~\/.:#=?&])?(?!\/\/)\/[\w\-+%~\/.:#=?&]*/,lookbehind:!0}],antiquotation:{pattern:/\$(?=\{)/,alias:"variable"},number:/\b\d+\b/,keyword:/\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/,"function":/\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:url|Tarball)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/,"boolean":/\b(?:true|false)\b/,operator:/[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/,punctuation:/[{}()[\].,:;]/},Prism.languages.nix.string.inside.interpolation.inside.rest=Prism.util.clone(Prism.languages.nix); -Prism.languages.nsis={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|[#;].*)/,lookbehind:!0},string:/("|')(\\?.)*?\1/,keyword:/\b(Abort|Add(BrandingImage|Size)|AdvSplash|Allow(RootDirInstall|SkipFiles)|AutoCloseWindow|Banner|BG(Font|Gradient|Image)|BrandingText|BringToFront|Call(InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|Create(Directory|Font|ShortCut)|Delete(INISec|INIStr|RegKey|RegValue)?|Detail(Print|sButtonText)|Dialer|Dir(Text|Var|Verify)|EnableWindow|Enum(RegKey|RegValue)|Exch|Exec(Shell|Wait)?|ExpandEnvStrings|File(BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|WriteUTF16LE|Seek|Write|WriteByte|WriteWord)?|Find(Close|First|Next|Window)|FlushINI|Get(CurInstType|CurrentAddress|DlgItem|DLLVersion(Local)?|ErrorLevel|FileTime(Local)?|FullPathName|Function(Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|Install(ButtonText|Colors|Dir(RegKey)?)|InstProgressFlags|Inst(Type(GetText|SetText)?)|Int(CmpU?|Fmt|Op)|IsWindow|Lang(DLL|String)|License(BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(Set|Text)|Manifest(DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|Name|Nop|ns(Dialogs|Exec)|NSISdl|OutFile|Page(Callbacks)?|Pop|Push|Quit|Read(EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|Section(End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(AutoClose|BrandingImage|Compress|Compressor(DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(InstDetails|UninstDetails|Window)|Silent(Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(CmpS?|Cpy|Len)|SubCaption|System|Unicode|Uninstall(ButtonText|Caption|Icon|SubCaption|Text)|UninstPage|UnRegDLL|UserInfo|Var|VI(AddVersionKey|FileVersion|ProductVersion)|VPatch|WindowIcon|Write(INIStr|RegBin|RegDWORD|RegExpandStr|RegStr|Uninstaller)|XPStyle)\b/,property:/\b(admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user|ARCHIVE|FILE_(ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(CR|CU|DD|LM|PD|U)|HKEY_(CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)\b/,variable:/\$[({]?[-_\w]+[)}]?/i,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,operator:/--?|\+\+?|<=?|>=?|==?=?|&&?|\|?\||[?*\/~^%]/,punctuation:/[{}[\];(),.:]/,important:/!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversionsystem|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|searchparse|searchreplace|tempfile|undef|verbose|warning)\b/i}; -Prism.languages.objectivec=Prism.languages.extend("c",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,string:/("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}); -Prism.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[/"(?:\\.|[^\\\r\n"])*"/,/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i],number:/\b-?(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i,type:{pattern:/\B['`][a-z\d_]*/i,alias:"variable"},directive:{pattern:/\B#[a-z\d_]+/i,alias:"function"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|object|of|open|prefix|private|rec|then|sig|struct|to|try|type|val|value|virtual|where|while|with)\b/,"boolean":/\b(?:false|true)\b/,operator:/:=|[=<>@^|&+\-*\/$%!?~][!$%&\*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lxor|lsl|lsr|mod|nor|or)\b/,punctuation:/[(){}\[\]|_.,:;]/}; -Prism.languages.oz={comment:/\/\*[\s\S]*?\*\/|%.*/,string:/"(?:[^"\\]|\\[\s\S])*"/,atom:{pattern:/'(?:[^'\\]|\\.)*'/,alias:"builtin"},keyword:/[$_]|\[\]|\b(?:at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/,"function":[/[a-z][A-Za-z\d]*(?=\()/,{pattern:/(\{)[A-Z][A-Za-z\d]*/,lookbehind:!0}],number:/\b(?:0[bx][\da-f]+|\d+\.?\d*(?:e~?\d+)?\b)|&(?:[^\\]|\\(?:\d{3}|.))/i,variable:/\b[A-Z][A-Za-z\d]*|`(?:[^`\\]|\\.)+`/,"attr-name":/\w+(?=:)/,operator:/:(?:=|::?)|<[-:=]?|=(?:=|=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,punctuation:/[\[\](){}.:;?]/}; -Prism.languages.parigp={comment:/\/\*[\s\S]*?\*\/|\\\\.*/,string:/"(?:[^"\\]|\\.)*"/,keyword:function(){var r=["breakpoint","break","dbg_down","dbg_err","dbg_up","dbg_x","forcomposite","fordiv","forell","forpart","forprime","forstep","forsubgroup","forvec","for","iferr","if","local","my","next","return","until","while"];return r=r.map(function(r){return r.split("").join(" *")}).join("|"),RegExp("\\b(?:"+r+")\\b")}(),"function":/\w[\w ]*?(?= *\()/,number:{pattern:/((?:\. *\. *)?)(?:\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *[+-]? *\d(?: *\d)*)?/i,lookbehind:!0},operator:/\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?:(?: *<)?(?: *=)?| *>)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/,punctuation:/[\[\]{}().,:;|]/}; -Prism.languages.parser=Prism.languages.extend("markup",{keyword:{pattern:/(^|[^^])(?:\^(?:case|eval|for|if|switch|throw)\b|@(?:BASE|CLASS|GET(?:_DEFAULT)?|OPTIONS|SET_DEFAULT|USE)\b)/,lookbehind:!0},variable:{pattern:/(^|[^^])\B\$(?:\w+|(?=[.\{]))(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{punctuation:/\.|:+/}},"function":{pattern:/(^|[^^])\B[@^]\w+(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{keyword:{pattern:/(^@)(?:GET_|SET_)/,lookbehind:!0},punctuation:/\.|:+/}},escape:{pattern:/\^(?:[$^;@()\[\]{}"':]|#[a-f\d]*)/i,alias:"builtin"},punctuation:/[\[\](){};]/}),Prism.languages.insertBefore("parser","keyword",{"parser-comment":{pattern:/(\s)#.*/,lookbehind:!0,alias:"comment"},expression:{pattern:/(^|[^^])\((?:[^()]|\((?:[^()]|\((?:[^()])*\))*\))*\)/,lookbehind:!0,inside:{string:{pattern:/(^|[^^])(["'])(?:(?!\2)[^^]|\^[\s\S])*\2/,lookbehind:!0},keyword:Prism.languages.parser.keyword,variable:Prism.languages.parser.variable,"function":Prism.languages.parser.function,"boolean":/\b(?:true|false)\b/,number:/\b(?:0x[a-f\d]+|\d+\.?\d*(?:e[+-]?\d+)?)\b/i,escape:Prism.languages.parser.escape,operator:/[~+*\/\\%]|!(?:\|\|?|=)?|&&?|\|\|?|==|<[<=]?|>[>=]?|-[fd]?|\b(?:def|eq|ge|gt|in|is|le|lt|ne)\b/,punctuation:Prism.languages.parser.punctuation}}}),Prism.languages.insertBefore("inside","punctuation",{expression:Prism.languages.parser.expression,keyword:Prism.languages.parser.keyword,variable:Prism.languages.parser.variable,"function":Prism.languages.parser.function,escape:Prism.languages.parser.escape,"parser-punctuation":{pattern:Prism.languages.parser.punctuation,alias:"punctuation"}},Prism.languages.parser.tag.inside["attr-value"]); -Prism.languages.pascal={comment:[/\(\*[\s\S]+?\*\)/,/\{[\s\S]+?\}/,/\/\/.*/],string:/(?:'(?:''|[^'\r\n])*'|#[&$%]?[a-f\d]+)+|\^[a-z]/i,keyword:[{pattern:/(^|[^&])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:dispose|exit|false|new|true)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i,lookbehind:!0}],number:[/[+-]?(?:[&%]\d+|\$[a-f\d]+)/i,/([+-]|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?/i],operator:[/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/i,{pattern:/(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/,lookbehind:!0}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/}; -Prism.languages.perl={comment:[{pattern:/(^\s*)=\w+[\s\S]*?=cut.*/m,lookbehind:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0}],string:[/\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,/\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(?:[^\\]|\\[\s\S])*?\1/,/\b(?:q|qq|qx|qw)\s*\((?:[^()\\]|\\[\s\S])*\)/,/\b(?:q|qq|qx|qw)\s*\{(?:[^{}\\]|\\[\s\S])*\}/,/\b(?:q|qq|qx|qw)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/,/\b(?:q|qq|qx|qw)\s*<(?:[^<>\\]|\\[\s\S])*>/,/("|`)(?:[^\\]|\\[\s\S])*?\1/,/'(?:[^'\\\r\n]|\\.)*'/],regex:[/\b(?:m|qr)\s*([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[msixpodualngc]*/,/\b(?:m|qr)\s+([a-zA-Z0-9])(?:[^\\]|\\.)*?\1[msixpodualngc]*/,/\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/,/\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/,/\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/,/\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/,{pattern:/(^|[^-]\b)(?:s|tr|y)\s*([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\2(?:[^\\]|\\[\s\S])*?\2[msixpodualngcer]*/,lookbehind:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:[^\\]|\\[\s\S])*?\2(?:[^\\]|\\[\s\S])*?\2[msixpodualngcer]*/,lookbehind:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/,lookbehind:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/,lookbehind:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/,lookbehind:!0},{pattern:/(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/,lookbehind:!0},/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?((::)*'?(?!\d)[\w$]+)+(::)*/i,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*>|\b_\b/,alias:"symbol"},vstring:{pattern:/v\d+(\.\d+)*|\d+(\.\d+){2,}/,alias:"string"},"function":{pattern:/sub [a-z0-9_]+/i,inside:{keyword:/sub/}},keyword:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b-?(0x[\dA-Fa-f](_?[\dA-Fa-f])*|0b[01](_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor)\b/,punctuation:/[{}[\];(),:]/}; -Prism.languages.php=Prism.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),Prism.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),Prism.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),Prism.languages.markup&&(Prism.hooks.add("before-highlight",function(e){"php"===e.language&&(e.tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(a){return e.tokenStack.push(a),"{{{PHP"+e.tokenStack.length+"}}}"}))}),Prism.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),Prism.hooks.add("after-highlight",function(e){if("php"===e.language){for(var a,n=0;a=e.tokenStack[n];n++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(n+1)+"}}}",Prism.highlight(a,e.grammar,"php").replace(/\$/g,"$$$$"));e.element.innerHTML=e.highlightedCode}}),Prism.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'$1'))}),Prism.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:Prism.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})); -Prism.languages.insertBefore("php","variable",{"this":/\$this\b/,global:/\$(?:_(?:SERVER|GET|POST|FILES|REQUEST|SESSION|ENV|COOKIE)|GLOBALS|HTTP_RAW_POST_DATA|argc|argv|php_errormsg|http_response_header)/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/(static|self|parent)/,punctuation:/(::|\\)/}}}); -Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\w\W]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(`?[\w\W])*?"/,greedy:!0,inside:{"function":{pattern:/[^`]\$\(.*?\)/,inside:{}}}},{pattern:/'([^']|'')*'/,greedy:!0}],namespace:/\[[a-z][\w\W]*?\]/i,"boolean":/\$(true|false)\b/i,variable:/\$\w+\b/i,"function":[/\b(Add-(Computer|Content|History|Member|PSSnapin|Type)|Checkpoint-Computer|Clear-(Content|EventLog|History|Item|ItemProperty|Variable)|Compare-Object|Complete-Transaction|Connect-PSSession|ConvertFrom-(Csv|Json|StringData)|Convert-Path|ConvertTo-(Csv|Html|Json|Xml)|Copy-(Item|ItemProperty)|Debug-Process|Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Disconnect-PSSession|Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Enter-PSSession|Exit-PSSession|Export-(Alias|Clixml|Console|Csv|FormatData|ModuleMember|PSSession)|ForEach-Object|Format-(Custom|List|Table|Wide)|Get-(Alias|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Culture|Date|Event|EventLog|EventSubscriber|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|WmiObject)|Group-Object|Import-(Alias|Clixml|Csv|LocalizedData|Module|PSSession)|Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)|Join-Path|Limit-EventLog|Measure-(Command|Object)|Move-(Item|ItemProperty)|New-(Alias|Event|EventLog|Item|ItemProperty|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy)|Out-(Default|File|GridView|Host|Null|Printer|String)|Pop-Location|Push-Location|Read-Host|Receive-(Job|PSSession)|Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)|Remove-(Computer|Event|EventLog|Item|ItemProperty|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)|Rename-(Computer|Item|ItemProperty)|Reset-ComputerMachinePassword|Resolve-Path|Restart-(Computer|Service)|Restore-Computer|Resume-(Job|Service)|Save-Help|Select-(Object|String|Xml)|Send-MailMessage|Set-(Alias|Content|Date|Item|ItemProperty|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)|Show-(Command|ControlPanelItem|EventLog)|Sort-Object|Split-Path|Start-(Job|Process|Service|Sleep|Transaction)|Stop-(Computer|Job|Process|Service)|Suspend-(Job|Service)|Tee-Object|Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)|Trace-Command|Unblock-File|Undo-Transaction|Unregister-(Event|PSSessionConfiguration)|Update-(FormatData|Help|List|TypeData)|Use-Transaction|Wait-(Event|Job|Process)|Where-Object|Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning))\b/i,/\b(ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(\W?)(!|-(eq|ne|gt|ge|lt|le|sh[lr]|not|b?(and|x?or)|(Not)?(Like|Match|Contains|In)|Replace|Join|is(Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/},Prism.languages.powershell.string[0].inside.boolean=Prism.languages.powershell.boolean,Prism.languages.powershell.string[0].inside.variable=Prism.languages.powershell.variable,Prism.languages.powershell.string[0].inside.function.inside=Prism.util.clone(Prism.languages.powershell); -Prism.languages.processing=Prism.languages.extend("clike",{keyword:/\b(?:break|catch|case|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,operator:/<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/}),Prism.languages.insertBefore("processing","number",{constant:/\b(?!XML\b)[A-Z][A-Z\d_]+\b/,type:{pattern:/\b(?:boolean|byte|char|color|double|float|int|XML|[A-Z][A-Za-z\d_]*)\b/,alias:"variable"}}),Prism.languages.processing["function"].pattern=/[a-z0-9_]+(?=\s*\()/i,Prism.languages.processing["class-name"].alias="variable"; -Prism.languages.prolog={comment:[/%.+/,/\/\*[\s\S]*?\*\//],string:/(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,builtin:/\b(?:fx|fy|xf[xy]?|yfx?)\b/,variable:/\b[A-Z_]\w*/,"function":/\b[a-z]\w*(?:(?=\()|\/\d+)/,number:/\b\d+\.?\d*/,operator:/[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,punctuation:/[(){}\[\],]/}; -Prism.languages.properties={comment:/^[ \t]*[#!].*$/m,"attr-value":{pattern:/(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?: *[=:] *| ))(?:\\(?:\r\n|[\s\S])|.)+/m,lookbehind:!0},"attr-name":/^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?= *[ =:]| )/m,punctuation:/[=:]/}; -Prism.languages.protobuf=Prism.languages.extend("clike",{keyword:/\b(package|import|message|enum)\b/,builtin:/\b(required|repeated|optional|reserved)\b/,primitive:{pattern:/\b(double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\b/,alias:"symbol"}}); -!function(e){e.languages.puppet={heredoc:[{pattern:/(@\("([^"\r\n\/):]+)"(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r))*?[ \t]*\|?[ \t]*-?[ \t]*\2/,lookbehind:!0,alias:"string",inside:{punctuation:/(?=\S).*\S(?= *$)/}},{pattern:/(@\(([^"\r\n\/):]+)(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r))*?[ \t]*\|?[ \t]*-?[ \t]*\2/,lookbehind:!0,alias:"string",inside:{punctuation:/(?=\S).*\S(?= *$)/}},{pattern:/@\("?(?:[^"\r\n\/):]+)"?(?:\/[nrts$uL]*)?\)/,alias:"string",inside:{punctuation:{pattern:/(\().+?(?=\))/,lookbehind:!0}}}],"multiline-comment":{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0,alias:"comment"},regex:{pattern:/((?:\bnode\s+|[~=\(\[\{,]\s*|[=+]>\s*|^\s*))\/(?:[^\/\\]|\\[\s\S])+\/(?:[imx]+\b|\B)/,lookbehind:!0,inside:{"extended-regex":{pattern:/^\/(?:[^\/\\]|\\[\s\S])+\/[im]*x[im]*$/,inside:{comment:/#.*/}}}},comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:{pattern:/(["'])(?:\$\{(?:[^'"}]|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}|(?!\1)[^\\]|\\[\s\S])*\1/,inside:{"double-quoted":{pattern:/^"[\s\S]*"$/,inside:{}}}},variable:{pattern:/\$(?:::)?\w+(?:::\w+)*/,inside:{punctuation:/::/}},"attr-name":/(?:\w+|\*)(?=\s*=>)/,"function":[{pattern:/(\.)(?!\d)\w+/,lookbehind:!0},/\b(?:contain|debug|err|fail|include|info|notice|realize|require|tag|warning)\b|\b(?!\d)\w+(?=\()/],number:/\b(?:0x[a-f\d]+|\d+(?:\.\d+)?(?:e-?\d+)?)\b/i,"boolean":/\b(?:true|false)\b/,keyword:/\b(?:application|attr|case|class|consumes|default|define|else|elsif|function|if|import|inherits|node|private|produces|type|undef|unless)\b/,datatype:{pattern:/\b(?:Any|Array|Boolean|Callable|Catalogentry|Class|Collection|Data|Default|Enum|Float|Hash|Integer|NotUndef|Numeric|Optional|Pattern|Regexp|Resource|Runtime|Scalar|String|Struct|Tuple|Type|Undef|Variant)\b/,alias:"symbol"},operator:/=[=~>]?|![=~]?|<(?:<\|?|[=~|-])?|>[>=]?|->?|~>|\|>?>?|[*\/%+?]|\b(?:and|in|or)\b/,punctuation:/[\[\]{}().,;]|:+/};var n=[{pattern:/(^|[^\\])\$\{(?:[^'"{}]|\{[^}]*\}|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}/,lookbehind:!0,inside:{"short-variable":{pattern:/(^\$\{)(?!\w+\()(?:::)?\w+(?:::\w+)*/,lookbehind:!0,alias:"variable",inside:{punctuation:/::/}},delimiter:{pattern:/^\$/,alias:"variable"},rest:e.util.clone(e.languages.puppet)}},{pattern:/(^|[^\\])\$(?:::)?\w+(?:::\w+)*/,lookbehind:!0,alias:"variable",inside:{punctuation:/::/}}];e.languages.puppet.heredoc[0].inside.interpolation=n,e.languages.puppet.string.inside["double-quoted"].inside.interpolation=n}(Prism); -!function(e){e.languages.pure={"inline-lang":{pattern:/%<[\s\S]+?%>/,inside:{lang:{pattern:/(^%< *)-\*-.+?-\*-/,lookbehind:!0,alias:"comment"},delimiter:{pattern:/^%<.*|%>$/,alias:"punctuation"}}},comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0},/#!.+/],string:/"(?:\\.|[^"\\\r\n])*"/,number:{pattern:/((?:\.\.)?)(?:\b(?:inf|nan)\b|\b0x[\da-f]+|(?:\b(?:0b)?\d+(?:\.\d)?|\B\.\d)\d*(?:e[+-]?\d+)?L?)/i,lookbehind:!0},keyword:/\b(?:ans|break|bt|case|catch|cd|clear|const|def|del|dump|else|end|exit|extern|false|force|help|if|infix[lr]?|interface|let|ls|mem|namespace|nonfix|NULL|of|otherwise|outfix|override|postfix|prefix|private|public|pwd|quit|run|save|show|stats|then|throw|trace|true|type|underride|using|when|with)\b/,"function":/\b(?:abs|add_(?:(?:fundef|interface|macdef|typedef)(?:_at)?|addr|constdef|vardef)|all|any|applp?|arity|bigintp?|blob(?:_crc|_size|p)?|boolp?|byte_(?:matrix|pointer)|byte_c?string(?:_pointer)?|calloc|cat|catmap|ceil|char[ps]?|check_ptrtag|chr|clear_sentry|clearsym|closurep?|cmatrixp?|cols?|colcat(?:map)?|colmap|colrev|colvector(?:p|seq)?|complex(?:_float_(?:matrix|pointer)|_matrix(?:_view)?|_pointer|p)?|conj|cookedp?|cst|cstring(?:_(?:dup|list|vector))?|curry3?|cyclen?|del_(?:constdef|fundef|interface|macdef|typedef|vardef)|delete|diag(?:mat)?|dim|dmatrixp?|do|double(?:_matrix(?:_view)?|_pointer|p)?|dowith3?|drop|dropwhile|eval(?:cmd)?|exactp|filter|fix|fixity|flip|float(?:_matrix|_pointer)|floor|fold[lr]1?|frac|free|funp?|functionp?|gcd|get(?:_(?:byte|constdef|double|float|fundef|int(?:64)?|interface(?:_typedef)?|long|macdef|pointer|ptrtag|short|sentry|string|typedef|vardef))?|globsym|hash|head|id|im|imatrixp?|index|inexactp|infp|init|insert|int(?:_matrix(?:_view)?|_pointer|p)?|int64_(?:matrix|pointer)|integerp?|iteraten?|iterwhile|join|keys?|lambdap?|last(?:err(?:pos)?)?|lcd|list[2p]?|listmap|make_ptrtag|malloc|map|matcat|matrixp?|max|member|min|nanp|nargs|nmatrixp?|null|numberp?|ord|pack(?:ed)?|pointer(?:_cast|_tag|_type|p)?|pow|pred|ptrtag|put(?:_(?:byte|double|float|int(?:64)?|long|pointer|short|string))?|rationalp?|re|realp?|realloc|recordp?|redim|reduce(?:_with)?|refp?|repeatn?|reverse|rlistp?|round|rows?|rowcat(?:map)?|rowmap|rowrev|rowvector(?:p|seq)?|same|scan[lr]1?|sentry|sgn|short_(?:matrix|pointer)|slice|smatrixp?|sort|split|str|strcat|stream|stride|string(?:_(?:dup|list|vector)|p)?|subdiag(?:mat)?|submat|subseq2?|substr|succ|supdiag(?:mat)?|symbolp?|tail|take|takewhile|thunkp?|transpose|trunc|tuplep?|typep|ubyte|uint(?:64)?|ulong|uncurry3?|unref|unzip3?|update|ushort|vals?|varp?|vector(?:p|seq)?|void|zip3?|zipwith3?)\b/,special:{pattern:/\b__[a-z]+__\b/i,alias:"builtin"},operator:/(?=\b_|[^_])[!"#$%&'*+,\-.\/:<=>?@\\^_`|~\u00a1-\u00bf\u00d7-\u00f7\u20d0-\u2bff]+|\b(?:and|div|mod|not|or)\b/,punctuation:/[(){}\[\];,|]/};var t=["c",{lang:"c++",alias:"cpp"},"fortran","ats","dsp"],a="%< *-\\*- *{lang}\\d* *-\\*-[\\s\\S]+?%>";t.forEach(function(t){var r=t;if("string"!=typeof t&&(r=t.alias,t=t.lang),e.languages[r]){var i={};i["inline-lang-"+r]={pattern:RegExp(a.replace("{lang}",t.replace(/([.+*?\/\\(){}\[\]])/g,"\\$1")),"i"),inside:e.util.clone(e.languages.pure["inline-lang"].inside)},i["inline-lang-"+r].inside.rest=e.util.clone(e.languages[r]),e.languages.insertBefore("pure","inline-lang",i)}}),e.languages.c&&(e.languages.pure["inline-lang"].inside.rest=e.util.clone(e.languages.c))}(Prism); -Prism.languages.python={"triple-quoted-string":{pattern:/"""[\s\S]+?"""|'''[\s\S]+?'''/,alias:"string"},comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:{pattern:/("|')(?:\\\\|\\?[^\\\r\n])*?\1/,greedy:!0},"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/}; -Prism.languages.q={string:/"(?:\\.|[^"\\\r\n])*"/,comment:[{pattern:/([\t )\]}])\/.*/,lookbehind:!0},{pattern:/(^|\r?\n|\r)\/[\t ]*(?:(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?(?:\\(?=[\t ]*(?:\r?\n|\r))|$)|\S.*)/,lookbehind:!0},/^\\[\t ]*(?:\r?\n|\r)[\s\S]+/m,/^#!.+/m],symbol:/`(?::\S+|[\w.]*)/,datetime:{pattern:/0N[mdzuvt]|0W[dtz]|\d{4}\.\d\d(?:m|\.\d\d(?:T(?:\d\d(?::\d\d(?::\d\d(?:[.:]\d\d\d)?)?)?)?)?[dz]?)|\d\d:\d\d(?::\d\d(?:[.:]\d\d\d)?)?[uvt]?/,alias:"number"},number:/\b-?(?![01]:)(?:0[wn]|0W[hj]?|0N[hje]?|0x[\da-fA-F]+|\d+\.?\d*(?:e[+-]?\d+)?[hjfeb]?)/,keyword:/\\\w+\b|\b(?:abs|acos|aj0?|all|and|any|asc|asin|asof|atan|attr|avgs?|binr?|by|ceiling|cols|cor|cos|count|cov|cross|csv|cut|delete|deltas|desc|dev|differ|distinct|div|do|dsave|ej|enlist|eval|except|exec|exit|exp|fby|fills|first|fkeys|flip|floor|from|get|getenv|group|gtime|hclose|hcount|hdel|hopen|hsym|iasc|identity|idesc|if|ij|in|insert|inter|inv|keys?|last|like|list|ljf?|load|log|lower|lsq|ltime|ltrim|mavg|maxs?|mcount|md5|mdev|med|meta|mins?|mmax|mmin|mmu|mod|msum|neg|next|not|null|or|over|parse|peach|pj|plist|prds?|prev|prior|rand|rank|ratios|raze|read0|read1|reciprocal|reval|reverse|rload|rotate|rsave|rtrim|save|scan|scov|sdev|select|set|setenv|show|signum|sin|sqrt|ssr?|string|sublist|sums?|sv|svar|system|tables|tan|til|trim|txf|type|uj|ungroup|union|update|upper|upsert|value|var|views?|vs|wavg|where|while|within|wj1?|wsum|ww|xasc|xbar|xcols?|xdesc|xexp|xgroup|xkey|xlog|xprev|xrank)\b/,adverb:{pattern:/['\/\\]:?|\beach\b/,alias:"function"},verb:{pattern:/(?:\B\.\B|\b[01]:|<[=>]?|>=?|[:+\-*%,!?_~=|$&#@^]):?/,alias:"operator"},punctuation:/[(){}\[\];.]/}; -Prism.languages.qore=Prism.languages.extend("clike",{comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|(?:\/\/|#).*)/,lookbehind:!0},string:/("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\])*\1/,variable:/\$(?!\d)\w+\b/,keyword:/\b(?:abstract|any|assert|binary|bool|boolean|break|byte|case|catch|char|class|code|const|continue|data|default|do|double|else|enum|extends|final|finally|float|for|goto|hash|if|implements|import|inherits|instanceof|int|interface|long|my|native|new|nothing|null|object|our|own|private|reference|rethrow|return|short|soft(?:int|float|number|bool|string|date|list)|static|strictfp|string|sub|super|switch|synchronized|this|throw|throws|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01]+|0x[\da-f]*\.?[\da-fp\-]+|\d*\.?\d+e?\d*[df]|\d*\.?\d+)\b/i,"boolean":/\b(?:true|false)\b/i,operator:{pattern:/(^|[^\.])(?:\+[+=]?|-[-=]?|[!=](?:==?|~)?|>>?=?|<(?:=>?|<=?)?|&[&=]?|\|[|=]?|[*\/%^]=?|[~?])/,lookbehind:!0},"function":/\$?\b(?!\d)\w+(?=\()/}); -Prism.languages.r={comment:/#.*/,string:/(['"])(?:\\?.)*?\1/,"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},"boolean":/\b(?:TRUE|FALSE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:NaN|Inf)\b/,/\b(?:0x[\dA-Fa-f]+(?:\.\d*)?|\d*\.?\d+)(?:[EePp][+-]?\d+)?[iL]?\b/],keyword:/\b(?:if|else|repeat|while|function|for|in|next|break|NULL|NA|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}; -!function(a){var e=a.util.clone(a.languages.javascript);a.languages.jsx=a.languages.extend("markup",e),a.languages.jsx.tag.pattern=/<\/?[\w\.:-]+\s*(?:\s+[\w\.:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+|(\{[\w\W]*?\})))?\s*)*\/?>/i,a.languages.jsx.tag.inside["attr-value"].pattern=/=[^\{](?:('|")[\w\W]*?(\1)|[^\s>]+)/i;var s=a.util.clone(a.languages.jsx);delete s.punctuation,s=a.languages.insertBefore("jsx","operator",{punctuation:/=(?={)|[{}[\];(),.:]/},{jsx:s}),a.languages.insertBefore("inside","attr-value",{script:{pattern:/=(\{(?:\{[^}]*\}|[^}])+\})/i,inside:s,alias:"language-javascript"}},a.languages.jsx.tag)}(Prism); -Prism.languages.rest={table:[{pattern:/(\s*)(?:\+[=-]+)+\+(?:\r?\n|\r)(?:\1(?:[+|].+)+[+|](?:\r?\n|\r))+\1(?:\+[=-]+)+\+/,lookbehind:!0,inside:{punctuation:/\||(?:\+[=-]+)+\+/}},{pattern:/(\s*)(?:=+ +)+=+((?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1(?:=+ +)+=+(?=(?:\r?\n|\r){2}|\s*$)/,lookbehind:!0,inside:{punctuation:/[=-]+/}}],"substitution-def":{pattern:/(^\s*\.\. )\|(?:[^|\s](?:[^|]*[^|\s])?)\| [^:]+::/m,lookbehind:!0,inside:{substitution:{pattern:/^\|(?:[^|\s]|[^|\s][^|]*[^|\s])\|/,alias:"attr-value",inside:{punctuation:/^\||\|$/}},directive:{pattern:/( +)[^:]+::/,lookbehind:!0,alias:"function",inside:{punctuation:/::$/}}}},"link-target":[{pattern:/(^\s*\.\. )\[[^\]]+\]/m,lookbehind:!0,alias:"string",inside:{punctuation:/^\[|\]$/}},{pattern:/(^\s*\.\. )_(?:`[^`]+`|(?:[^:\\]|\\.)+):/m,lookbehind:!0,alias:"string",inside:{punctuation:/^_|:$/}}],directive:{pattern:/(^\s*\.\. )[^:]+::/m,lookbehind:!0,alias:"function",inside:{punctuation:/::$/}},comment:{pattern:/(^\s*\.\.)(?:(?: .+)?(?:(?:\r?\n|\r).+)+| .+)(?=(?:\r?\n|\r){2}|$)/m,lookbehind:!0},title:[{pattern:/^(([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+)(?:\r?\n|\r).+(?:\r?\n|\r)\1$/m,inside:{punctuation:/^[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+|[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,important:/.+/}},{pattern:/(^|(?:\r?\n|\r){2}).+(?:\r?\n|\r)([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+(?=\r?\n|\r|$)/,lookbehind:!0,inside:{punctuation:/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,important:/.+/}}],hr:{pattern:/((?:\r?\n|\r){2})([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2{3,}(?=(?:\r?\n|\r){2})/,lookbehind:!0,alias:"punctuation"},field:{pattern:/(^\s*):[^:\r\n]+:(?= )/m,lookbehind:!0,alias:"attr-name"},"command-line-option":{pattern:/(^\s*)(?:[+-][a-z\d]|(?:\-\-|\/)[a-z\d-]+)(?:[ =](?:[a-z][a-z\d_-]*|<[^<>]+>))?(?:, (?:[+-][a-z\d]|(?:\-\-|\/)[a-z\d-]+)(?:[ =](?:[a-z][a-z\d_-]*|<[^<>]+>))?)*(?=(?:\r?\n|\r)? {2,}\S)/im,lookbehind:!0,alias:"symbol"},"literal-block":{pattern:/::(?:\r?\n|\r){2}([ \t]+).+(?:(?:\r?\n|\r)\1.+)*/,inside:{"literal-block-punctuation":{pattern:/^::/,alias:"punctuation"}}},"quoted-literal-block":{pattern:/::(?:\r?\n|\r){2}([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]).*(?:(?:\r?\n|\r)\1.*)*/,inside:{"literal-block-punctuation":{pattern:/^(?:::|([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\1*)/m,alias:"punctuation"}}},"list-bullet":{pattern:/(^\s*)(?:[*+\-•‣⁃]|\(?(?:\d+|[a-z]|[ivxdclm]+)\)|(?:\d+|[a-z]|[ivxdclm]+)\.)(?= )/im,lookbehind:!0,alias:"punctuation"},"doctest-block":{pattern:/(^\s*)>>> .+(?:(?:\r?\n|\r).+)*/m,lookbehind:!0,inside:{punctuation:/^>>>/}},inline:[{pattern:/(^|[\s\-:\/'"<(\[{])(?::[^:]+:`.*?`|`.*?`:[^:]+:|(\*\*?|``?|\|)(?!\s).*?[^\s]\2(?=[\s\-.,:;!?\\\/'")\]}]|$))/m,lookbehind:!0,inside:{bold:{pattern:/(^\*\*).+(?=\*\*$)/,lookbehind:!0},italic:{pattern:/(^\*).+(?=\*$)/,lookbehind:!0},"inline-literal":{pattern:/(^``).+(?=``$)/,lookbehind:!0,alias:"symbol"},role:{pattern:/^:[^:]+:|:[^:]+:$/,alias:"function",inside:{punctuation:/^:|:$/}},"interpreted-text":{pattern:/(^`).+(?=`$)/,lookbehind:!0,alias:"attr-value"},substitution:{pattern:/(^\|).+(?=\|$)/,lookbehind:!0,alias:"attr-value"},punctuation:/\*\*?|``?|\|/}}],link:[{pattern:/\[[^\]]+\]_(?=[\s\-.,:;!?\\\/'")\]}]|$)/,alias:"string",inside:{punctuation:/^\[|\]_$/}},{pattern:/(?:\b[a-z\d](?:[_.:+]?[a-z\d]+)*_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,alias:"string",inside:{punctuation:/^_?`|`$|`?_?_$/}}],punctuation:{pattern:/(^\s*)(?:\|(?= |$)|(?:---?|—|\.\.|__)(?= )|\.\.$)/m,lookbehind:!0}}; -Prism.languages.rip={comment:/#.*/,keyword:/(?:=>|->)|\b(?:class|if|else|switch|case|return|exit|try|catch|finally|raise)\b/,builtin:/@|\bSystem\b/,"boolean":/\b(?:true|false)\b/,date:/\b\d{4}-\d{2}-\d{2}\b/,time:/\b\d{2}:\d{2}:\d{2}\b/,datetime:/\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/,character:/\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/(?=\s*($|[\r\n,.;})]))/,lookbehind:!0},symbol:/:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,string:/("|')(\\?.)*?\1/,number:/[+-]?(?:(?:\d+\.\d+)|(?:\d+))/,punctuation:/(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/,reference:/[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/}; -Prism.languages.roboconf={comment:/#.*/,keyword:{pattern:/(^|\s)(?:(?:facet|instance of)(?=[ \t]+[\w-]+[ \t]*\{)|(?:external|import)\b)/,lookbehind:!0},component:{pattern:/[\w-]+(?=[ \t]*\{)/,alias:"variable"},property:/[\w.-]+(?=[ \t]*:)/,value:{pattern:/(=[ \t]*)[^,;]+/,lookbehind:!0,alias:"attr-value"},optional:{pattern:/\(optional\)/,alias:"builtin"},wildcard:{pattern:/(\.)\*/,lookbehind:!0,alias:"operator"},punctuation:/[{},.;:=]/}; -!function(e){e.languages.crystal=e.languages.extend("ruby",{keyword:[/\b(?:abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|self|sizeof|struct|super|then|type|typeof|union|unless|until|when|while|with|yield|__DIR__|__FILE__|__LINE__)\b/,{pattern:/(\.\s*)(?:is_a|responds_to)\?/,lookbehind:!0}],number:/\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[0-9a-fA-F_]*[0-9a-fA-F]|(?:[0-9](?:[0-9_]*[0-9])?)(?:\.[0-9_]*[0-9])?(?:[eE][+-]?[0-9_]*[0-9])?)(?:_(?:[uif](?:8|16|32|64))?)?\b/});var t=e.util.clone(e.languages.crystal);e.languages.insertBefore("crystal","string",{attribute:{pattern:/@\[.+?\]/,alias:"attr-name",inside:{delimiter:{pattern:/^@\[|\]$/,alias:"tag"},rest:t}},expansion:[{pattern:/\{\{.+?\}\}/,inside:{delimiter:{pattern:/^\{\{|\}\}$/,alias:"tag"},rest:t}},{pattern:/\{%.+?%\}/,inside:{delimiter:{pattern:/^\{%|%\}$/,alias:"tag"},rest:t}}]})}(Prism); -Prism.languages.rust={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:[/b?r(#*)"(?:\\?.)*?"\1/,/b?("|')(?:\\?.)*?\1/],keyword:/\b(?:abstract|alignof|as|be|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|offsetof|once|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/,attribute:{pattern:/#!?\[.+?\]/,alias:"attr-name"},"function":[/[a-z0-9_]+(?=\s*\()/i,/[a-z0-9_]+!(?=\s*\(|\[)/i],"macro-rules":{pattern:/[a-z0-9_]+!/i,alias:"function"},number:/\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64)?|f32|f64))?\b/,"closure-params":{pattern:/\|[^|]*\|(?=\s*[{-])/,inside:{punctuation:/[\|:,]/,operator:/[&*]/}},punctuation:/[{}[\];(),:]|\.+|->/,operator:/[-+*\/%!^=]=?|@|&[&=]?|\|[|=]?|<>?=?/}; -Prism.languages.sas={datalines:{pattern:/^\s*(?:(?:data)?lines|cards);[\s\S]+?(?:\r?\n|\r);/im,alias:"string",inside:{keyword:{pattern:/^(\s*)(?:(?:data)?lines|cards)/i,lookbehind:!0},punctuation:/;/}},comment:[{pattern:/(^\s*|;\s*)\*.*;/m,lookbehind:!0},/\/\*[\s\S]+?\*\//],datetime:{pattern:/'[^']+'(?:dt?|t)\b/i,alias:"number"},string:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,keyword:/\b(?:data|else|format|if|input|proc\s\w+|quit|run|then)\b/i,number:/(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,operator:/\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,punctuation:/[$%@.(){}\[\];,\\]/}; -!function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t]+.+)*/m,lookbehind:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete e.languages.sass.atrule;var a=/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i,t=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|or|not)\b/,{pattern:/(\s+)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,inside:{punctuation:/:/,variable:a,operator:t}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s]+.*)/m,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:a,operator:t,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,delete e.languages.sass.selector,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/([ \t]*)\S(?:,?[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,?[^,\r\n]+)*)*/,lookbehind:!0}})}(Prism); -Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)*url(?=\()/i,selector:{pattern:/(?=\S)[^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-_\w]+/,variable:/\$[-_\w]+|#\{\$[-_\w]+\}/}}}),Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)/i,{pattern:/( +)(?:from|through)(?= )/,lookbehind:!0}]}),Prism.languages.scss.property={pattern:/(?:[\w-]|\$[-_\w]+|#\{\$[-_\w]+\})+(?=\s*:)/i,inside:{variable:/\$[-_\w]+|#\{\$[-_\w]+\}/}},Prism.languages.insertBefore("scss","important",{variable:/\$[-_\w]+|#\{\$[-_\w]+\}/}),Prism.languages.insertBefore("scss","function",{placeholder:{pattern:/%[-_\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},"boolean":/\b(?:true|false)\b/,"null":/\bnull\b/,operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),Prism.languages.scss.atrule.inside.rest=Prism.util.clone(Prism.languages.scss); -Prism.languages.scala=Prism.languages.extend("java",{keyword:/<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,string:[{pattern:/"""[\W\w]*?"""/,greedy:!0},{pattern:/("|')(?:\\\\|\\?[^\\\r\n])*?\1/,greedy:!0}],builtin:/\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,number:/\b(?:0x[\da-f]*\.?[\da-f]+|\d*\.?\d+e?\d*[dfl]?)\b/i,symbol:/'[^\d\s\\]\w*/}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala["function"]; -Prism.languages.scheme={comment:/;.*/,string:/"(?:[^"\\\r\n]|\\.)*?"|'[^('\s]*/,keyword:{pattern:/(\()(?:define(?:-syntax|-library|-values)?|(?:case-)?lambda|let(?:\*|rec)?(?:-values)?|else|if|cond|begin|delay(?:-force)?|parameterize|guard|set!|(?:quasi-)?quote|syntax-rules)/,lookbehind:!0},builtin:{pattern:/(\()(?:(?:cons|car|cdr|list|call-with-current-continuation|call\/cc|append|abs|apply|eval)\b|null\?|pair\?|boolean\?|eof-object\?|char\?|procedure\?|number\?|port\?|string\?|vector\?|symbol\?|bytevector\?)/,lookbehind:!0},number:{pattern:/(\s|\))[-+]?[0-9]*\.?[0-9]+(?:\s*[-+]\s*[0-9]*\.?[0-9]+i)?\b/,lookbehind:!0},"boolean":/#[tf]/,operator:{pattern:/(\()(?:[-+*%\/]|[<>]=?|=>?)/,lookbehind:!0},"function":{pattern:/(\()[^\s()]*(?=\s)/,lookbehind:!0},punctuation:/[()]/}; -Prism.languages.smalltalk={comment:/"(?:""|[^"])+"/,string:/'(?:''|[^'])+'/,symbol:/#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,"block-arguments":{pattern:/(\[\s*):[^\[|]*?\|/,lookbehind:!0,inside:{variable:/:[\da-z]+/i,punctuation:/\|/}},"temporary-variables":{pattern:/\|[^|]+\|/,inside:{variable:/[\da-z]+/i,punctuation:/\|/}},keyword:/\b(?:nil|true|false|self|super|new)\b/,character:{pattern:/\$./,alias:"string"},number:[/\d+r-?[\dA-Z]+(?:\.[\dA-Z]+)?(?:e-?\d+)?/,/(?:\B-|\b)\d+(?:\.\d+)?(?:e-?\d+)?/],operator:/[<=]=?|:=|~[~=]|\/\/?|\\\\|>[>=]?|[!^+\-*&|,@]/,punctuation:/[.;:?\[\](){}]/}; -!function(e){var t=/\{\*[\w\W]+?\*\}|\{[\w\W]+?\}/g,a="{literal}",n="{/literal}",o=!1;e.languages.smarty=e.languages.extend("markup",{smarty:{pattern:t,inside:{delimiter:{pattern:/^\{|\}$/i,alias:"punctuation"},string:/(["'])(?:\\?.)*?\1/,number:/\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee][-+]?\d+)?)\b/,variable:[/\$(?!\d)\w+/,/#(?!\d)\w+#/,{pattern:/(\.|->)(?!\d)\w+/,lookbehind:!0},{pattern:/(\[)(?!\d)\w+(?=\])/,lookbehind:!0}],"function":[{pattern:/(\|\s*)@?(?!\d)\w+/,lookbehind:!0},/^\/?(?!\d)\w+/,/(?!\d)\w+(?=\()/],"attr-name":{pattern:/\w+\s*=\s*(?:(?!\d)\w+)?/,inside:{variable:{pattern:/(=\s*)(?!\d)\w+/,lookbehind:!0},operator:/=/}},punctuation:[/[\[\]().,:`]|\->/],operator:[/[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/,/\bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/,/\b(?:eq|neq?|gt|lt|gt?e|lt?e|not|mod|or|and)\b/],keyword:/\b(?:false|off|on|no|true|yes)\b/}}}),e.languages.insertBefore("smarty","tag",{"smarty-comment":{pattern:/\{\*[\w\W]*?\*\}/,alias:["smarty","comment"]}}),e.hooks.add("before-highlight",function(e){"smarty"===e.language&&(e.tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(t,function(t){return t===n&&(o=!1),o?t:(t===a&&(o=!0),e.tokenStack.push(t),"___SMARTY"+e.tokenStack.length+"___")}))}),e.hooks.add("before-insert",function(e){"smarty"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),e.hooks.add("after-highlight",function(t){if("smarty"===t.language){for(var a,n=0;a=t.tokenStack[n];n++)t.highlightedCode=t.highlightedCode.replace("___SMARTY"+(n+1)+"___",e.highlight(a,t.grammar,"smarty").replace(/\$/g,"$$$$"));t.element.innerHTML=t.highlightedCode}})}(Prism); -Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},string:{pattern:/(^|[^@\\])("|')(?:\\?[\s\S])*?\2/,lookbehind:!0},variable:/@[\w.$]+|@("|'|`)(?:\\?[\s\S])+?\1/,"function":/\b(?:COUNT|SUM|AVG|MIN|MAX|FIRST|LAST|UCASE|LCASE|MID|LEN|ROUND|NOW|FORMAT)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR VARYING|CHARACTER (?:SET|VARYING)|CHARSET|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|DATA(?:BASES?)?|DATE(?:TIME)?|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITER(?:S)?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE(?: PRECISION)?|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE KEY|ELSE|ENABLE|ENCLOSED BY|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPE(?:D BY)?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTO|INVOKER|ISOLATION LEVEL|JOIN|KEYS?|KILL|LANGUAGE SQL|LAST|LEFT|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MODIFIES SQL DATA|MODIFY|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL(?: CHAR VARYING| CHARACTER(?: VARYING)?| VARCHAR)?|NATURAL|NCHAR(?: VARCHAR)?|NEXT|NO(?: SQL|CHECK|CYCLE)?|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READ(?:S SQL DATA|TEXT)?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEATABLE|REPLICATION|REQUIRE|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE MODE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|START(?:ING BY)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED BY|TEXT(?:SIZE)?|THEN|TIMESTAMP|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNPIVOT|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?)\b/i,"boolean":/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b-?(?:0x)?\d*\.?[\da-f]+\b/,operator:/[-+*\/=%^~]|&&?|\|?\||!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}; -!function(n){var t={url:/url\((["']?).*?\1\)/i,string:/("|')(?:[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/,interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:if|else|for|return|unless)(?=\s+|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,number:/\b\d+(?:\.\d+)?%?/,"boolean":/\b(?:true|false)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.+|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],punctuation:/[{}()\[\];:,]/};t.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:n.util.clone(t)},t.func={pattern:/[\w-]+\([^)]*\).*/,inside:{"function":/^[^(]+/,rest:n.util.clone(t)}},n.languages.stylus={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0},"atrule-declaration":{pattern:/(^\s*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:t}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:(?:\{[^}]*\}|.+)|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:t}},statement:{pattern:/(^[ \t]*)(?:if|else|for|return|unless)[ \t]+.+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:t}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)[^{\r\n]*(?:;|[^{\r\n,](?=$)(?!(\r?\n|\r)(?:\{|\2[ \t]+)))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:t.interpolation}},rest:t}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t]+)))/m,lookbehind:!0,inside:{interpolation:t.interpolation,punctuation:/[{},]/}},func:t.func,string:t.string,interpolation:t.interpolation,punctuation:/[{}()\[\];:.]/}}(Prism); -Prism.languages.swift=Prism.languages.extend("clike",{string:{pattern:/("|')(\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/\\\((?:[^()]|\([^)]+\))+\)/,inside:{delimiter:{pattern:/^\\\(|\)$/,alias:"variable"}}}}},keyword:/\b(as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic(?:Type)?|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|Protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__(?:COLUMN__|FILE__|FUNCTION__|LINE__))\b/,number:/\b([\d_]+(\.[\de_]+)?|0x[a-f0-9_]+(\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,constant:/\b(nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,atrule:/@\b(IB(?:Outlet|Designable|Action|Inspectable)|class_protocol|exported|noreturn|NS(?:Copying|Managed)|objc|UIApplicationMain|auto_closure)\b/,builtin:/\b([A-Z]\S+|abs|advance|alignof(?:Value)?|assert|contains|count(?:Elements)?|debugPrint(?:ln)?|distance|drop(?:First|Last)|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lexicographicalCompare|map|max(?:Element)?|min(?:Element)?|numericCast|overlaps|partition|print(?:ln)?|reduce|reflect|reverse|sizeof(?:Value)?|sort(?:ed)?|split|startsWith|stride(?:of(?:Value)?)?|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|with(?:ExtendedLifetime|Unsafe(?:MutablePointers?|Pointers?)|VaList))\b/}),Prism.languages.swift.string.inside.interpolation.inside.rest=Prism.util.clone(Prism.languages.swift); -Prism.languages.tcl={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/,variable:[{pattern:/(\$)(?:::)?(?:[a-zA-Z0-9]+::)*[a-zA-Z0-9_]+/,lookbehind:!0},{pattern:/(\$){[^}]+}/,lookbehind:!0},{pattern:/(^\s*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*[a-zA-Z0-9_]+/m,lookbehind:!0}],"function":{pattern:/(^\s*proc[ \t]+)[^\s]+/m,lookbehind:!0},builtin:[{pattern:/(^\s*)(?:proc|return|class|error|eval|exit|for|foreach|if|switch|while|break|continue)\b/m,lookbehind:!0},/\b(elseif|else)\b/],scope:{pattern:/(^\s*)(global|upvar|variable)\b/m,lookbehind:!0,alias:"constant"},keyword:{pattern:/(^\s*|\[)(after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|Safe_Base|scan|seek|set|socket|source|split|string|subst|Tcl|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|wordBreak(?:After|Before)|test|vars)|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait)\b/m,lookbehind:!0},operator:/!=?|\*\*?|==|&&?|\|\|?|<[=<]?|>[=>]?|[-+~\/%?^]|\b(?:eq|ne|in|ni)\b/,punctuation:/[{}()\[\]]/}; -!function(e){var i="(?:\\([^|)]+\\)|\\[[^\\]]+\\]|\\{[^}]+\\})+",n={css:{pattern:/\{[^}]+\}/,inside:{rest:e.languages.css}},"class-id":{pattern:/(\()[^)]+(?=\))/,lookbehind:!0,alias:"attr-value"},lang:{pattern:/(\[)[^\]]+(?=\])/,lookbehind:!0,alias:"attr-value"},punctuation:/[\\\/]\d+|\S/};e.languages.textile=e.languages.extend("markup",{phrase:{pattern:/(^|\r|\n)\S[\s\S]*?(?=$|\r?\n\r?\n|\r\r)/,lookbehind:!0,inside:{"block-tag":{pattern:RegExp("^[a-z]\\w*(?:"+i+"|[<>=()])*\\."),inside:{modifier:{pattern:RegExp("(^[a-z]\\w*)(?:"+i+"|[<>=()])+(?=\\.)"),lookbehind:!0,inside:e.util.clone(n)},tag:/^[a-z]\w*/,punctuation:/\.$/}},list:{pattern:RegExp("^[*#]+(?:"+i+")?\\s+.+","m"),inside:{modifier:{pattern:RegExp("(^[*#]+)"+i),lookbehind:!0,inside:e.util.clone(n)},punctuation:/^[*#]+/}},table:{pattern:RegExp("^(?:(?:"+i+"|[<>=()^~])+\\.\\s*)?(?:\\|(?:(?:"+i+"|[<>=()^~_]|[\\\\/]\\d+)+\\.)?[^|]*)+\\|","m"),inside:{modifier:{pattern:RegExp("(^|\\|(?:\\r?\\n|\\r)?)(?:"+i+"|[<>=()^~_]|[\\\\/]\\d+)+(?=\\.)"),lookbehind:!0,inside:e.util.clone(n)},punctuation:/\||^\./}},inline:{pattern:RegExp("(\\*\\*|__|\\?\\?|[*_%@+\\-^~])(?:"+i+")?.+?\\1"),inside:{bold:{pattern:RegExp("((^\\*\\*?)(?:"+i+")?).+?(?=\\2)"),lookbehind:!0},italic:{pattern:RegExp("((^__?)(?:"+i+")?).+?(?=\\2)"),lookbehind:!0},cite:{pattern:RegExp("(^\\?\\?(?:"+i+")?).+?(?=\\?\\?)"),lookbehind:!0,alias:"string"},code:{pattern:RegExp("(^@(?:"+i+")?).+?(?=@)"),lookbehind:!0,alias:"keyword"},inserted:{pattern:RegExp("(^\\+(?:"+i+")?).+?(?=\\+)"),lookbehind:!0},deleted:{pattern:RegExp("(^-(?:"+i+")?).+?(?=-)"),lookbehind:!0},span:{pattern:RegExp("(^%(?:"+i+")?).+?(?=%)"),lookbehind:!0},modifier:{pattern:RegExp("(^\\*\\*|__|\\?\\?|[*_%@+\\-^~])"+i),lookbehind:!0,inside:e.util.clone(n)},punctuation:/[*_%?@+\-^~]+/}},"link-ref":{pattern:/^\[[^\]]+\]\S+$/m,inside:{string:{pattern:/(\[)[^\]]+(?=\])/,lookbehind:!0},url:{pattern:/(\])\S+$/,lookbehind:!0},punctuation:/[\[\]]/}},link:{pattern:RegExp('"(?:'+i+')?[^"]+":.+?(?=[^\\w/]?(?:\\s|$))'),inside:{text:{pattern:RegExp('(^"(?:'+i+')?)[^"]+(?=")'),lookbehind:!0},modifier:{pattern:RegExp('(^")'+i),lookbehind:!0,inside:e.util.clone(n)},url:{pattern:/(:).+/,lookbehind:!0},punctuation:/[":]/}},image:{pattern:RegExp("!(?:"+i+"|[<>=()])*[^!\\s()]+(?:\\([^)]+\\))?!(?::.+?(?=[^\\w/]?(?:\\s|$)))?"),inside:{source:{pattern:RegExp("(^!(?:"+i+"|[<>=()])*)[^!\\s()]+(?:\\([^)]+\\))?(?=!)"),lookbehind:!0,alias:"url"},modifier:{pattern:RegExp("(^!)(?:"+i+"|[<>=()])+"),lookbehind:!0,inside:e.util.clone(n)},url:{pattern:/(:).+/,lookbehind:!0},punctuation:/[!:]/}},footnote:{pattern:/\b\[\d+\]/,alias:"comment",inside:{punctuation:/\[|\]/}},acronym:{pattern:/\b[A-Z\d]+\([^)]+\)/,inside:{comment:{pattern:/(\()[^)]+(?=\))/,lookbehind:!0},punctuation:/[()]/}},mark:{pattern:/\b\((TM|R|C)\)/,alias:"comment",inside:{punctuation:/[()]/}}}}});var t={inline:e.util.clone(e.languages.textile.phrase.inside.inline),link:e.util.clone(e.languages.textile.phrase.inside.link),image:e.util.clone(e.languages.textile.phrase.inside.image),footnote:e.util.clone(e.languages.textile.phrase.inside.footnote),acronym:e.util.clone(e.languages.textile.phrase.inside.acronym),mark:e.util.clone(e.languages.textile.phrase.inside.mark)};e.languages.textile.tag.pattern=/<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,e.languages.textile.phrase.inside.inline.inside.bold.inside=t,e.languages.textile.phrase.inside.inline.inside.italic.inside=t,e.languages.textile.phrase.inside.inline.inside.inserted.inside=t,e.languages.textile.phrase.inside.inline.inside.deleted.inside=t,e.languages.textile.phrase.inside.inline.inside.span.inside=t,e.languages.textile.phrase.inside.table.inside.inline=t.inline,e.languages.textile.phrase.inside.table.inside.link=t.link,e.languages.textile.phrase.inside.table.inside.image=t.image,e.languages.textile.phrase.inside.table.inside.footnote=t.footnote,e.languages.textile.phrase.inside.table.inside.acronym=t.acronym,e.languages.textile.phrase.inside.table.inside.mark=t.mark}(Prism); -Prism.languages.twig={comment:/\{#[\s\S]*?#\}/,tag:{pattern:/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/,inside:{ld:{pattern:/^(?:\{\{\-?|\{%\-?\s*\w+)/,inside:{punctuation:/^(?:\{\{|\{%)\-?/,keyword:/\w+/}},rd:{pattern:/\-?(?:%\}|\}\})$/,inside:{punctuation:/.*/}},string:{pattern:/("|')(?:\\?.)*?\1/,inside:{punctuation:/^['"]|['"]$/}},keyword:/\b(?:even|if|odd)\b/,"boolean":/\b(?:true|false|null)\b/,number:/\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+([Ee][-+]?\d+)?)\b/,operator:[{pattern:/(\s)(?:and|b\-and|b\-xor|b\-or|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,lookbehind:!0},/[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/],property:/\b[a-zA-Z_][a-zA-Z0-9_]*\b/,punctuation:/[()\[\]{}:.,]/}},other:{pattern:/\S(?:[\s\S]*\S)?/,inside:Prism.languages.markup}}; -Prism.languages.typescript=Prism.languages.extend("javascript",{keyword:/\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield|module|declare|constructor|string|Function|any|number|boolean|Array|enum)\b/}); -Prism.languages.verilog={comment:/\/\/.*|\/\*[\w\W]*?\*\//,string:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,property:/\B\$\w+\b/,constant:/\B`\w+\b/,"function":/[a-z\d_]+(?=\()/i,keyword:/\b(?:alias|and|assert|assign|assume|automatic|before|begin|bind|bins|binsof|bit|break|buf|bufif0|bufif1|byte|class|case|casex|casez|cell|chandle|clocking|cmos|config|const|constraint|context|continue|cover|covergroup|coverpoint|cross|deassign|default|defparam|design|disable|dist|do|edge|else|end|endcase|endclass|endclocking|endconfig|endfunction|endgenerate|endgroup|endinterface|endmodule|endpackage|endprimitive|endprogram|endproperty|endspecify|endsequence|endtable|endtask|enum|event|expect|export|extends|extern|final|first_match|for|force|foreach|forever|fork|forkjoin|function|generate|genvar|highz0|highz1|if|iff|ifnone|ignore_bins|illegal_bins|import|incdir|include|initial|inout|input|inside|instance|int|integer|interface|intersect|join|join_any|join_none|large|liblist|library|local|localparam|logic|longint|macromodule|matches|medium|modport|module|nand|negedge|new|nmos|nor|noshowcancelled|not|notif0|notif1|null|or|output|package|packed|parameter|pmos|posedge|primitive|priority|program|property|protected|pull0|pull1|pulldown|pullup|pulsestyle_onevent|pulsestyle_ondetect|pure|rand|randc|randcase|randsequence|rcmos|real|realtime|ref|reg|release|repeat|return|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|sequence|shortint|shortreal|showcancelled|signed|small|solve|specify|specparam|static|string|strong0|strong1|struct|super|supply0|supply1|table|tagged|task|this|throughout|time|timeprecision|timeunit|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|type|typedef|union|unique|unsigned|use|uwire|var|vectored|virtual|void|wait|wait_order|wand|weak0|weak1|while|wildcard|wire|with|within|wor|xnor|xor)\b/,important:/\b(?:always_latch|always_comb|always_ff|always)\b ?@?/,number:/\B##?\d+|(?:\b\d+)?'[odbh] ?[\da-fzx_?]+|\b\d*[._]?\d+(?:e[-+]?\d+)?/i,operator:/[-+{}^~%*\/?=!<>&|]+/,punctuation:/[[\];(),.:]/}; -Prism.languages.vhdl={comment:/--.+/,"vhdl-vectors":{pattern:/\b[oxb]"[\da-f_]+"|"[01uxzwlh-]+"/i,alias:"number"},"quoted-function":{pattern:/"\S+?"(?=\()/,alias:"function"},string:/"(?:[^\\\r\n]|\\?(?:\r\n|[\s\S]))*?"/,constant:/\b(?:use|library)\b/i,keyword:/\b(?:'active|'ascending|'base|'delayed|'driving|'driving_value|'event|'high|'image|'instance_name|'last_active|'last_event|'last_value|'left|'leftof|'length|'low|'path_name|'pos|'pred|'quiet|'range|'reverse_range|'right|'rightof|'simple_name|'stable|'succ|'transaction|'val|'value|access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with)\b/i,"boolean":/\b(?:true|false)\b/i,"function":/[a-z0-9_]+(?=\()/i,number:/'[01uxzwlh-]'|\b(?:\d+#[\da-f_.]+#|\d[\d_.]*)(?:e[-+]?\d+)?/i,operator:/[<>]=?|:=|[-+*\/&=]|\b(?:abs|not|mod|rem|sll|srl|sla|sra|rol|ror|and|or|nand|xnor|xor|nor)\b/i,punctuation:/[{}[\];(),.:]/}; -Prism.languages.vim={string:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\r\n]|'')*'/,comment:/".*/,"function":/\w+(?=\()/,keyword:/\b(?:ab|abbreviate|abc|abclear|abo|aboveleft|al|all|arga|argadd|argd|argdelete|argdo|arge|argedit|argg|argglobal|argl|arglocal|ar|args|argu|argument|as|ascii|bad|badd|ba|ball|bd|bdelete|be|bel|belowright|bf|bfirst|bl|blast|bm|bmodified|bn|bnext|bN|bNext|bo|botright|bp|bprevious|brea|break|breaka|breakadd|breakd|breakdel|breakl|breaklist|br|brewind|bro|browse|bufdo|b|buffer|buffers|bun|bunload|bw|bwipeout|ca|cabbrev|cabc|cabclear|caddb|caddbuffer|cad|caddexpr|caddf|caddfile|cal|call|cat|catch|cb|cbuffer|cc|ccl|cclose|cd|ce|center|cex|cexpr|cf|cfile|cfir|cfirst|cgetb|cgetbuffer|cgete|cgetexpr|cg|cgetfile|c|change|changes|chd|chdir|che|checkpath|checkt|checktime|cla|clast|cl|clist|clo|close|cmapc|cmapclear|cnew|cnewer|cn|cnext|cN|cNext|cnf|cnfile|cNfcNfile|cnorea|cnoreabbrev|col|colder|colo|colorscheme|comc|comclear|comp|compiler|conf|confirm|con|continue|cope|copen|co|copy|cpf|cpfile|cp|cprevious|cq|cquit|cr|crewind|cuna|cunabbrev|cu|cunmap|cw|cwindow|debugg|debuggreedy|delc|delcommand|d|delete|delf|delfunction|delm|delmarks|diffg|diffget|diffoff|diffpatch|diffpu|diffput|diffsplit|diffthis|diffu|diffupdate|dig|digraphs|di|display|dj|djump|dl|dlist|dr|drop|ds|dsearch|dsp|dsplit|earlier|echoe|echoerr|echom|echomsg|echon|e|edit|el|else|elsei|elseif|em|emenu|endfo|endfor|endf|endfunction|endfun|en|endif|endt|endtry|endw|endwhile|ene|enew|ex|exi|exit|exu|exusage|f|file|files|filetype|fina|finally|fin|find|fini|finish|fir|first|fix|fixdel|fo|fold|foldc|foldclose|folddoc|folddoclosed|foldd|folddoopen|foldo|foldopen|for|fu|fun|function|go|goto|gr|grep|grepa|grepadd|ha|hardcopy|h|help|helpf|helpfind|helpg|helpgrep|helpt|helptags|hid|hide|his|history|ia|iabbrev|iabc|iabclear|if|ij|ijump|il|ilist|imapc|imapclear|in|inorea|inoreabbrev|isearch|isp|isplit|iuna|iunabbrev|iu|iunmap|j|join|ju|jumps|k|keepalt|keepj|keepjumps|kee|keepmarks|laddb|laddbuffer|lad|laddexpr|laddf|laddfile|lan|language|la|last|later|lb|lbuffer|lc|lcd|lch|lchdir|lcl|lclose|let|left|lefta|leftabove|lex|lexpr|lf|lfile|lfir|lfirst|lgetb|lgetbuffer|lgete|lgetexpr|lg|lgetfile|lgr|lgrep|lgrepa|lgrepadd|lh|lhelpgrep|l|list|ll|lla|llast|lli|llist|lmak|lmake|lm|lmap|lmapc|lmapclear|lnew|lnewer|lne|lnext|lN|lNext|lnf|lnfile|lNf|lNfile|ln|lnoremap|lo|loadview|loc|lockmarks|lockv|lockvar|lol|lolder|lop|lopen|lpf|lpfile|lp|lprevious|lr|lrewind|ls|lt|ltag|lu|lunmap|lv|lvimgrep|lvimgrepa|lvimgrepadd|lw|lwindow|mak|make|ma|mark|marks|mat|match|menut|menutranslate|mk|mkexrc|mks|mksession|mksp|mkspell|mkvie|mkview|mkv|mkvimrc|mod|mode|m|move|mzf|mzfile|mz|mzscheme|nbkey|new|n|next|N|Next|nmapc|nmapclear|noh|nohlsearch|norea|noreabbrev|nu|number|nun|nunmap|omapc|omapclear|on|only|o|open|opt|options|ou|ounmap|pc|pclose|ped|pedit|pe|perl|perld|perldo|po|pop|popu|popu|popup|pp|ppop|pre|preserve|prev|previous|p|print|P|Print|profd|profdel|prof|profile|promptf|promptfind|promptr|promptrepl|ps|psearch|pta|ptag|ptf|ptfirst|ptj|ptjump|ptl|ptlast|ptn|ptnext|ptN|ptNext|ptp|ptprevious|ptr|ptrewind|pts|ptselect|pu|put|pw|pwd|pyf|pyfile|py|python|qa|qall|q|quit|quita|quitall|r|read|rec|recover|redi|redir|red|redo|redr|redraw|redraws|redrawstatus|reg|registers|res|resize|ret|retab|retu|return|rew|rewind|ri|right|rightb|rightbelow|rub|ruby|rubyd|rubydo|rubyf|rubyfile|ru|runtime|rv|rviminfo|sal|sall|san|sandbox|sa|sargument|sav|saveas|sba|sball|sbf|sbfirst|sbl|sblast|sbm|sbmodified|sbn|sbnext|sbN|sbNext|sbp|sbprevious|sbr|sbrewind|sb|sbuffer|scripte|scriptencoding|scrip|scriptnames|se|set|setf|setfiletype|setg|setglobal|setl|setlocal|sf|sfind|sfir|sfirst|sh|shell|sign|sil|silent|sim|simalt|sla|slast|sl|sleep|sm|smagic|sm|smap|smapc|smapclear|sme|smenu|sn|snext|sN|sNext|sni|sniff|sno|snomagic|snor|snoremap|snoreme|snoremenu|sor|sort|so|source|spelld|spelldump|spe|spellgood|spelli|spellinfo|spellr|spellrepall|spellu|spellundo|spellw|spellwrong|sp|split|spr|sprevious|sre|srewind|sta|stag|startg|startgreplace|star|startinsert|startr|startreplace|stj|stjump|st|stop|stopi|stopinsert|sts|stselect|sun|sunhide|sunm|sunmap|sus|suspend|sv|sview|syncbind|t|tab|tabc|tabclose|tabd|tabdo|tabe|tabedit|tabf|tabfind|tabfir|tabfirst|tabl|tablast|tabm|tabmove|tabnew|tabn|tabnext|tabN|tabNext|tabo|tabonly|tabp|tabprevious|tabr|tabrewind|tabs|ta|tag|tags|tc|tcl|tcld|tcldo|tclf|tclfile|te|tearoff|tf|tfirst|th|throw|tj|tjump|tl|tlast|tm|tm|tmenu|tn|tnext|tN|tNext|to|topleft|tp|tprevious|tr|trewind|try|ts|tselect|tu|tu|tunmenu|una|unabbreviate|u|undo|undoj|undojoin|undol|undolist|unh|unhide|unlet|unlo|unlockvar|unm|unmap|up|update|verb|verbose|ve|version|vert|vertical|vie|view|vim|vimgrep|vimgrepa|vimgrepadd|vi|visual|viu|viusage|vmapc|vmapclear|vne|vnew|vs|vsplit|vu|vunmap|wa|wall|wh|while|winc|wincmd|windo|winp|winpos|win|winsize|wn|wnext|wN|wNext|wp|wprevious|wq|wqa|wqall|w|write|ws|wsverb|wv|wviminfo|X|xa|xall|x|xit|xm|xmap|xmapc|xmapclear|xme|xmenu|XMLent|XMLns|xn|xnoremap|xnoreme|xnoremenu|xu|xunmap|y|yank)\b/,builtin:/\b(?:autocmd|acd|ai|akm|aleph|allowrevins|altkeymap|ambiwidth|ambw|anti|antialias|arab|arabic|arabicshape|ari|arshape|autochdir|autoindent|autoread|autowrite|autowriteall|aw|awa|background|backspace|backup|backupcopy|backupdir|backupext|backupskip|balloondelay|ballooneval|balloonexpr|bdir|bdlay|beval|bex|bexpr|bg|bh|bin|binary|biosk|bioskey|bk|bkc|bomb|breakat|brk|browsedir|bs|bsdir|bsk|bt|bufhidden|buflisted|buftype|casemap|ccv|cdpath|cedit|cfu|ch|charconvert|ci|cin|cindent|cink|cinkeys|cino|cinoptions|cinw|cinwords|clipboard|cmdheight|cmdwinheight|cmp|cms|columns|com|comments|commentstring|compatible|complete|completefunc|completeopt|consk|conskey|copyindent|cot|cpo|cpoptions|cpt|cscopepathcomp|cscopeprg|cscopequickfix|cscopetag|cscopetagorder|cscopeverbose|cspc|csprg|csqf|cst|csto|csverb|cuc|cul|cursorcolumn|cursorline|cwh|debug|deco|def|define|delcombine|dex|dg|dict|dictionary|diff|diffexpr|diffopt|digraph|dip|dir|directory|dy|ea|ead|eadirection|eb|ed|edcompatible|ef|efm|ei|ek|enc|encoding|endofline|eol|ep|equalalways|equalprg|errorbells|errorfile|errorformat|esckeys|et|eventignore|expandtab|exrc|fcl|fcs|fdc|fde|fdi|fdl|fdls|fdm|fdn|fdo|fdt|fen|fenc|fencs|fex|ff|ffs|fileencoding|fileencodings|fileformat|fileformats|fillchars|fk|fkmap|flp|fml|fmr|foldcolumn|foldenable|foldexpr|foldignore|foldlevel|foldlevelstart|foldmarker|foldmethod|foldminlines|foldnestmax|foldtext|formatexpr|formatlistpat|formatoptions|formatprg|fp|fs|fsync|ft|gcr|gd|gdefault|gfm|gfn|gfs|gfw|ghr|gp|grepformat|grepprg|gtl|gtt|guicursor|guifont|guifontset|guifontwide|guiheadroom|guioptions|guipty|guitablabel|guitabtooltip|helpfile|helpheight|helplang|hf|hh|hi|hidden|highlight|hk|hkmap|hkmapp|hkp|hl|hlg|hls|hlsearch|ic|icon|iconstring|ignorecase|im|imactivatekey|imak|imc|imcmdline|imd|imdisable|imi|iminsert|ims|imsearch|inc|include|includeexpr|incsearch|inde|indentexpr|indentkeys|indk|inex|inf|infercase|insertmode|isf|isfname|isi|isident|isk|iskeyword|isprint|joinspaces|js|key|keymap|keymodel|keywordprg|km|kmp|kp|langmap|langmenu|laststatus|lazyredraw|lbr|lcs|linebreak|lines|linespace|lisp|lispwords|listchars|loadplugins|lpl|lsp|lz|macatsui|magic|makeef|makeprg|matchpairs|matchtime|maxcombine|maxfuncdepth|maxmapdepth|maxmem|maxmempattern|maxmemtot|mco|mef|menuitems|mfd|mh|mis|mkspellmem|ml|mls|mm|mmd|mmp|mmt|modeline|modelines|modifiable|modified|more|mouse|mousef|mousefocus|mousehide|mousem|mousemodel|mouses|mouseshape|mouset|mousetime|mp|mps|msm|mzq|mzquantum|nf|nrformats|numberwidth|nuw|odev|oft|ofu|omnifunc|opendevice|operatorfunc|opfunc|osfiletype|pa|para|paragraphs|paste|pastetoggle|patchexpr|patchmode|path|pdev|penc|pex|pexpr|pfn|ph|pheader|pi|pm|pmbcs|pmbfn|popt|preserveindent|previewheight|previewwindow|printdevice|printencoding|printexpr|printfont|printheader|printmbcharset|printmbfont|printoptions|prompt|pt|pumheight|pvh|pvw|qe|quoteescape|readonly|remap|report|restorescreen|revins|rightleft|rightleftcmd|rl|rlc|ro|rs|rtp|ruf|ruler|rulerformat|runtimepath|sbo|sc|scb|scr|scroll|scrollbind|scrolljump|scrolloff|scrollopt|scs|sect|sections|secure|sel|selection|selectmode|sessionoptions|sft|shcf|shellcmdflag|shellpipe|shellquote|shellredir|shellslash|shelltemp|shelltype|shellxquote|shiftround|shiftwidth|shm|shortmess|shortname|showbreak|showcmd|showfulltag|showmatch|showmode|showtabline|shq|si|sidescroll|sidescrolloff|siso|sj|slm|smartcase|smartindent|smarttab|smc|smd|softtabstop|sol|spc|spell|spellcapcheck|spellfile|spelllang|spellsuggest|spf|spl|splitbelow|splitright|sps|sr|srr|ss|ssl|ssop|stal|startofline|statusline|stl|stmp|su|sua|suffixes|suffixesadd|sw|swapfile|swapsync|swb|swf|switchbuf|sws|sxq|syn|synmaxcol|syntax|tabline|tabpagemax|tabstop|tagbsearch|taglength|tagrelative|tagstack|tal|tb|tbi|tbidi|tbis|tbs|tenc|term|termbidi|termencoding|terse|textauto|textmode|textwidth|tgst|thesaurus|tildeop|timeout|timeoutlen|title|titlelen|titleold|titlestring|toolbar|toolbariconsize|top|tpm|tsl|tsr|ttimeout|ttimeoutlen|ttm|tty|ttybuiltin|ttyfast|ttym|ttymouse|ttyscroll|ttytype|tw|tx|uc|ul|undolevels|updatecount|updatetime|ut|vb|vbs|vdir|verbosefile|vfile|viewdir|viewoptions|viminfo|virtualedit|visualbell|vop|wak|warn|wb|wc|wcm|wd|weirdinvert|wfh|wfw|whichwrap|wi|wig|wildchar|wildcharm|wildignore|wildmenu|wildmode|wildoptions|wim|winaltkeys|window|winfixheight|winfixwidth|winheight|winminheight|winminwidth|winwidth|wiv|wiw|wm|wmh|wmnu|wmw|wop|wrap|wrapmargin|wrapscan|writeany|writebackup|writedelay|ww|noacd|noai|noakm|noallowrevins|noaltkeymap|noanti|noantialias|noar|noarab|noarabic|noarabicshape|noari|noarshape|noautochdir|noautoindent|noautoread|noautowrite|noautowriteall|noaw|noawa|nobackup|noballooneval|nobeval|nobin|nobinary|nobiosk|nobioskey|nobk|nobl|nobomb|nobuflisted|nocf|noci|nocin|nocindent|nocompatible|noconfirm|noconsk|noconskey|nocopyindent|nocp|nocscopetag|nocscopeverbose|nocst|nocsverb|nocuc|nocul|nocursorcolumn|nocursorline|nodeco|nodelcombine|nodg|nodiff|nodigraph|nodisable|noea|noeb|noed|noedcompatible|noek|noendofline|noeol|noequalalways|noerrorbells|noesckeys|noet|noex|noexpandtab|noexrc|nofen|nofk|nofkmap|nofoldenable|nogd|nogdefault|noguipty|nohid|nohidden|nohk|nohkmap|nohkmapp|nohkp|nohls|noic|noicon|noignorecase|noim|noimc|noimcmdline|noimd|noincsearch|noinf|noinfercase|noinsertmode|nois|nojoinspaces|nojs|nolazyredraw|nolbr|nolinebreak|nolisp|nolist|noloadplugins|nolpl|nolz|noma|nomacatsui|nomagic|nomh|noml|nomod|nomodeline|nomodifiable|nomodified|nomore|nomousef|nomousefocus|nomousehide|nonu|nonumber|noodev|noopendevice|nopaste|nopi|nopreserveindent|nopreviewwindow|noprompt|nopvw|noreadonly|noremap|norestorescreen|norevins|nori|norightleft|norightleftcmd|norl|norlc|noro|nors|noru|noruler|nosb|nosc|noscb|noscrollbind|noscs|nosecure|nosft|noshellslash|noshelltemp|noshiftround|noshortname|noshowcmd|noshowfulltag|noshowmatch|noshowmode|nosi|nosm|nosmartcase|nosmartindent|nosmarttab|nosmd|nosn|nosol|nospell|nosplitbelow|nosplitright|nospr|nosr|nossl|nosta|nostartofline|nostmp|noswapfile|noswf|nota|notagbsearch|notagrelative|notagstack|notbi|notbidi|notbs|notermbidi|noterse|notextauto|notextmode|notf|notgst|notildeop|notimeout|notitle|noto|notop|notr|nottimeout|nottybuiltin|nottyfast|notx|novb|novisualbell|nowa|nowarn|nowb|noweirdinvert|nowfh|nowfw|nowildmenu|nowinfixheight|nowinfixwidth|nowiv|nowmnu|nowrap|nowrapscan|nowrite|nowriteany|nowritebackup|nows|invacd|invai|invakm|invallowrevins|invaltkeymap|invanti|invantialias|invar|invarab|invarabic|invarabicshape|invari|invarshape|invautochdir|invautoindent|invautoread|invautowrite|invautowriteall|invaw|invawa|invbackup|invballooneval|invbeval|invbin|invbinary|invbiosk|invbioskey|invbk|invbl|invbomb|invbuflisted|invcf|invci|invcin|invcindent|invcompatible|invconfirm|invconsk|invconskey|invcopyindent|invcp|invcscopetag|invcscopeverbose|invcst|invcsverb|invcuc|invcul|invcursorcolumn|invcursorline|invdeco|invdelcombine|invdg|invdiff|invdigraph|invdisable|invea|inveb|inved|invedcompatible|invek|invendofline|inveol|invequalalways|inverrorbells|invesckeys|invet|invex|invexpandtab|invexrc|invfen|invfk|invfkmap|invfoldenable|invgd|invgdefault|invguipty|invhid|invhidden|invhk|invhkmap|invhkmapp|invhkp|invhls|invhlsearch|invic|invicon|invignorecase|invim|invimc|invimcmdline|invimd|invincsearch|invinf|invinfercase|invinsertmode|invis|invjoinspaces|invjs|invlazyredraw|invlbr|invlinebreak|invlisp|invlist|invloadplugins|invlpl|invlz|invma|invmacatsui|invmagic|invmh|invml|invmod|invmodeline|invmodifiable|invmodified|invmore|invmousef|invmousefocus|invmousehide|invnu|invnumber|invodev|invopendevice|invpaste|invpi|invpreserveindent|invpreviewwindow|invprompt|invpvw|invreadonly|invremap|invrestorescreen|invrevins|invri|invrightleft|invrightleftcmd|invrl|invrlc|invro|invrs|invru|invruler|invsb|invsc|invscb|invscrollbind|invscs|invsecure|invsft|invshellslash|invshelltemp|invshiftround|invshortname|invshowcmd|invshowfulltag|invshowmatch|invshowmode|invsi|invsm|invsmartcase|invsmartindent|invsmarttab|invsmd|invsn|invsol|invspell|invsplitbelow|invsplitright|invspr|invsr|invssl|invsta|invstartofline|invstmp|invswapfile|invswf|invta|invtagbsearch|invtagrelative|invtagstack|invtbi|invtbidi|invtbs|invtermbidi|invterse|invtextauto|invtextmode|invtf|invtgst|invtildeop|invtimeout|invtitle|invto|invtop|invtr|invttimeout|invttybuiltin|invttyfast|invtx|invvb|invvisualbell|invwa|invwarn|invwb|invweirdinvert|invwfh|invwfw|invwildmenu|invwinfixheight|invwinfixwidth|invwiv|invwmnu|invwrap|invwrapscan|invwrite|invwriteany|invwritebackup|invws|t_AB|t_AF|t_al|t_AL|t_bc|t_cd|t_ce|t_Ce|t_cl|t_cm|t_Co|t_cs|t_Cs|t_CS|t_CV|t_da|t_db|t_dl|t_DL|t_EI|t_F1|t_F2|t_F3|t_F4|t_F5|t_F6|t_F7|t_F8|t_F9|t_fs|t_IE|t_IS|t_k1|t_K1|t_k2|t_k3|t_K3|t_k4|t_K4|t_k5|t_K5|t_k6|t_K6|t_k7|t_K7|t_k8|t_K8|t_k9|t_K9|t_KA|t_kb|t_kB|t_KB|t_KC|t_kd|t_kD|t_KD|t_ke|t_KE|t_KF|t_KG|t_kh|t_KH|t_kI|t_KI|t_KJ|t_KK|t_kl|t_KL|t_kN|t_kP|t_kr|t_ks|t_ku|t_le|t_mb|t_md|t_me|t_mr|t_ms|t_nd|t_op|t_RI|t_RV|t_Sb|t_se|t_Sf|t_SI|t_so|t_sr|t_te|t_ti|t_ts|t_ue|t_us|t_ut|t_vb|t_ve|t_vi|t_vs|t_WP|t_WS|t_xs|t_ZH|t_ZR)\b/,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?)\b/i,operator:/\|\||&&|[-+.]=?|[=!](?:[=~][#?]?)?|[<>]=?[#?]?|[*\/%?]|\b(?:is(?:not)?)\b/,punctuation:/[{}[\](),;:]/}; -Prism.languages.wiki=Prism.languages.extend("markup",{"block-comment":{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0,alias:"comment"},heading:{pattern:/^(=+).+?\1/m,inside:{punctuation:/^=+|=+$/,important:/.+/}},emphasis:{pattern:/('{2,5}).+?\1/,inside:{"bold italic":{pattern:/(''''').+?(?=\1)/,lookbehind:!0},bold:{pattern:/(''')[^'](?:.*?[^'])?(?=\1)/,lookbehind:!0},italic:{pattern:/('')[^'](?:.*?[^'])?(?=\1)/,lookbehind:!0},punctuation:/^''+|''+$/}},hr:{pattern:/^-{4,}/m,alias:"punctuation"},url:[/ISBN +(?:97[89][ -]?)?(?:\d[ -]?){9}[\dx]\b|(?:RFC|PMID) +\d+/i,/\[\[.+?\]\]|\[.+?\]/],variable:[/__[A-Z]+__/,/\{{3}.+?\}{3}/,/\{\{.+?}}/],symbol:[/^#redirect/im,/~{3,5}/],"table-tag":{pattern:/((?:^|[|!])[|!])[^|\r\n]+\|(?!\|)/m,lookbehind:!0,inside:{"table-bar":{pattern:/\|$/,alias:"punctuation"},rest:Prism.languages.markup.tag.inside}},punctuation:/^(?:\{\||\|\}|\|-|[*#:;!|])|\|\||!!/m}),Prism.languages.insertBefore("wiki","tag",{nowiki:{pattern:/<(nowiki|pre|source)\b[\w\W]*?>[\w\W]*?<\/\1>/i,inside:{tag:{pattern:/<(?:nowiki|pre|source)\b[\w\W]*?>|<\/(?:nowiki|pre|source)>/i,inside:Prism.languages.markup.tag.inside}}}}); -Prism.languages.xojo={comment:{pattern:/(?:'|\/\/|Rem\b).+/i,inside:{keyword:/^Rem/i}},string:{pattern:/"(?:""|[^"])*"/,greedy:!0},number:[/(?:\b|\B[.-])(?:\d+\.?\d*)(?:E[+-]?\d+)?/i,/&[bchou][a-z\d]+/i],symbol:/#(?:If|Else|ElseIf|Endif|Pragma)\b/i,keyword:/\b(?:AddHandler|App|Array|As(?:signs)?|By(?:Ref|Val)|Break|Call|Case|Catch|Const|Continue|CurrentMethodName|Declare|Dim|Do(?:wnTo)?|Each|Else(?:If)?|End|Exit|Extends|False|Finally|For|Global|If|In|Lib|Loop|Me|Next|Nil|Optional|ParamArray|Raise(?:Event)?|ReDim|Rem|RemoveHandler|Return|Select|Self|Soft|Static|Step|Super|Then|To|True|Try|Ubound|Until|Using|Wend|While)\b/i,operator:/<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i,punctuation:/[.,;:()]/}; -Prism.languages.yaml={scalar:{pattern:/([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\3[^\r\n]+)*)/,lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:/(\s*(?:^|[:\-,[{\r\n?])[ \t]*(![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/,lookbehind:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[ \t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*($|,|]|}))/m,lookbehind:!0,alias:"number"},"boolean":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},"null":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},string:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')(?=[ \t]*($|,|]|}))/m,lookbehind:!0},number:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\da-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,lookbehind:!0},tag:/![^\s]+/,important:/[&*][\w]+/,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./}; diff --git a/docs/api/en/style.css b/docs/api/en/style.css deleted file mode 100644 index 1531017..0000000 --- a/docs/api/en/style.css +++ /dev/null @@ -1,624 +0,0 @@ -@import 'https://fonts.googleapis.com/css?family=Lora:400,400i,700,700i|PT+Sans+Caption|Raleway:100,400|Source+Sans+Pro'; -html, -body, -div, -span, -applet, -object, -iframe, -h1, -h2, -h3, -h4, -h5, -h6, -p, -blockquote, -pre, -a, -abbr, -acronym, -address, -big, -cite, -code, -del, -dfn, -em, -img, -ins, -kbd, -q, -s, -samp, -small, -strike, -strong, -sub, -sup, -tt, -var, -dl, -dt, -dd, -ol, -ul, -li, -fieldset, -form, -label, -legend, -table, -caption, -tbody, -tfoot, -thead, -tr, -th, -td, -#content-panel .deprecation-section { - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-weight: inherit; - font-style: inherit; - font-family: inherit; - font-size: 100%; - vertical-align: baseline; -} -body { - line-height: 1; - color: #000; - background: #fff; -} -ol, -ul { - list-style: none; -} -table { - border-collapse: separate; - border-spacing: 0; - vertical-align: middle; -} -caption, -th, -td { - text-align: left; - font-weight: normal; - vertical-align: middle; -} -a img { - border: none; -} -html, -body, -div, -span, -applet, -object, -iframe, -h1, -h2, -h3, -h4, -h5, -h6, -p, -blockquote, -pre, -a, -abbr, -acronym, -address, -big, -cite, -code, -del, -dfn, -em, -img, -ins, -kbd, -q, -s, -samp, -small, -strike, -strong, -sub, -sup, -tt, -var, -dl, -dt, -dd, -ol, -ul, -li, -fieldset, -form, -label, -legend, -table, -caption, -tbody, -tfoot, -thead, -tr, -th, -td, -#content-panel .deprecation-section { - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-weight: inherit; - font-style: inherit; - font-family: inherit; - font-size: 100%; - vertical-align: baseline; -} -body { - line-height: 1; - color: #000; - background: #fff; -} -ol, -ul { - list-style: none; -} -table { - border-collapse: separate; - border-spacing: 0; - vertical-align: middle; -} -caption, -th, -td { - text-align: left; - font-weight: normal; - vertical-align: middle; -} -a img { - border: none; -} -* { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -*:focus { - outline: none; -} -body { - background: #fafafa; - font-family: 'Lora', serif; - line-height: 1.4em; - font-size: 16px; -} -p { - margin: 0.7em 0 1.82em 0; -} -strong { - font-weight: bold; -} -em { - font-style: italic; -} -small, -.small { - font-size: 85%; -} -.lead { - font-size: 120%; - color: #95a5a6; - font-family: 'Raleway', sans; -} -cite { - font-style: normal; -} -blockquote, -#content-panel .deprecation-section { - margin: 0 0 1.4em 2.8em; - border-left: 8px solid #3498db; - padding: 0.3em 1em; - color: #95a5a6; -} -blockquote .source, -#content-panel .deprecation-section .source { - color: #e8ecec; -} -blockquote .source:before, -#content-panel .deprecation-section .source:before { - content: "— "; -} -blockquote .source cite, -#content-panel .deprecation-section .source cite { - color: #bfc8c9; -} -ul, -ol { - margin: 0 0 1.4em 2.8em; - padding: 0; -} -ul li, -ol li { - margin-bottom: 0.7em; -} -ul ul, -ul ol, -ol ul, -ol ol { - margin-bottom: 0; -} -ul { - list-style: disc; -} -ul ul, -ol ul { - list-style: circle; -} -ul ul ul, -ol ul ul, -ol ol ul, -ul ol ul { - list-style: square; -} -ol { - list-style: decimal; -} -ul.unstyled, -ol.unstyled { - margin: 0; - padding: 0; - list-style: none; -} -ul.unstyled > li, -ol.unstyled > li { - margin-bottom: 0; -} -h1, -h2, -h3, -h4, -h5, -h6 { - font-family: 'Raleway', sans; - line-height: 100%; - margin: 1.4em 0 0.7em 0; - font-weight: 800; - color: #7f8c8d; -} -h1 { - font-size: 2.5em; -} -h2 { - font-size: 2.3em; -} -h3 { - font-size: 2em; -} -h4 { - font-size: 1.6em; -} -h5 { - font-size: 1.4em; -} -h6 { - font-size: 1.3em; -} -body { - background: #fff; -} -a { - color: #216694; - text-decoration: none; -} -a:hover { - text-decoration: underline; -} -#content-wrapper { - zoom: 1; - display: block; - width: 102.08333333333333%; - margin: 0 -1.041666666666667%; - *width: 102.03125%; - *margin: 0 -1.09375%; - width: 960px; - margin: 2em auto; -} -#content-wrapper:before, -#content-wrapper:after { - content: ""; - display: table; -} -#content-wrapper:after { - clear: both; -} -#content-wrapper #content-panel { - display: inline; - float: left; - width: 72.91666666666666%; - margin: 0 1.041666666666667%; - *width: 72.86458333333333%; - *margin: 0 0.989583333333333%; -} -#content-wrapper #meta-panel { - display: inline; - float: left; - width: 22.916666666666664%; - margin: 0 1.041666666666667%; - *width: 22.864583333333332%; - *margin: 0 0.989583333333333%; -} -#content-panel { - font-size: 20px; - line-height: 1.5em; - color: #5f5f5f; -} -#content-panel code { - font-family: monospace; - color: #34495e; - background: #ecf0f1; - padding: 0 0.3em; -} -#content-panel .entity-title { - letter-spacing: -0.02em; - color: #2f2f2f; - font-size: 36px; - font-weight: bold !important; - margin-top: 0; -} -#content-panel .highlight-summary { - font-family: 'PT Sans Caption', sans-serif; - color: #95a5a6; - margin: -0.5em 0 2em 0; -} -#content-panel .section-title { - font-weight: 300; - font-size: 32px; - text-transform: uppercase; - margin-left: -1em; - border-top: 1px solid #ecf0f1; - padding-top: 0.5em; -} -#content-panel .definition .signature { - font-family: monospace; - font-size: 24px; -} -#content-panel .definition .type-title-container { - display: block; - font-family: 'Raleway', sans-serif; - color: #95a5a6; - font-size: 16px; - margin-top: 1em; -} -#content-panel .definition .type-title-container .type-title { - text-transform: uppercase; -} -#content-panel .definition .type-title-container .info { - margin-left: 1em; - font-size: 12px; -} -#content-panel .definition pre.type { - background: none; - padding: 0px 20px 20px 20px; - margin-top: 0; -} -#content-panel .deprecation-section { - border-color: #c0392b; - margin-left: -2em; -} -#content-panel .deprecation-section .deprecation-title { - color: #c0392b; - text-transform: uppercase; - font-family: 'PT Sans Caption', sans-serif; - border-bottom: 1px solid #ecf0f1; - margin-bottom: 0.5em; - display: block; - font-weight: bold; -} -#content-panel .documentation h2, -#content-panel .members .category { - font-family: 'PT Sans Caption', sans-serif; - letter-spacing: -0.02em; - color: #2f2f2f; - font-size: 36px; - font-weight: bold !important; - line-height: 100%; - margin: 1.2em 0 0.6em 0; -} -#content-panel .documentation h3 { - font-size: 28px; - letter-spacing: 0.02em; - border-bottom: 1px solid #ecf0f1; - padding-bottom: 0.3em; - margin-bototm: 0.3em; - color: #5f5f5f; -} -#content-panel .documentation h4, -#content-panel .documentation h5, -#content-panel .documentation h6 { - font-size: 26px; - font-weight: 300 !important; - color: #95a5a6; - margin-bottom: 0.3em; - letter-spacing: -0.02em; - text-transform: uppercase; - border-bottom: 1px solid #ecf0f1; -} -#content-panel .members .member { - margin-bottom: 1.5em; -} -#content-panel .members .doc-summary { - margin-left: 2em; - color: #7f8c8d; -} -#content-panel .members .doc-summary p { - margin: 0; -} -#content-panel .members .special-tags { - margin-left: 2em; -} -#content-panel .members .special-tags .tagged { - font-family: 'Raleway', sans-serif; - font-weight: 400; - font-size: 12px; - padding: 0.3em 0.8em; - margin-right: 1em; - border: 1px solid #95a5a6; - color: #95a5a6; - text-transform: uppercase; -} -#content-panel .members .special-tags .deprecated { - color: #c0392b; - border-color: #c0392b; - font-weight: bold; -} -#content-panel .members .special-tags .required { - color: #e74c3c; - border-color: #e74c3c; -} -#content-panel .members .special-tags .experimental { - color: #d35400; - border-color: #d35400; -} -#content-panel .members .member-name { - font-family: monospace; - font-weight: bold; -} -#content-panel .members.deprecated .member-name { - text-decoration: line-through; -} -#content-panel p { - margin: 0 0 1.2em 0; -} -#meta-panel { - font-family: 'Raleway', sans-serif; - font-size: 14px; - color: #5f5f5f; -} -#meta-panel .meta-section { - margin-bottom: 2em; -} -#meta-panel .meta-field { - margin-bottom: 1em; -} -#meta-panel .meta-field-value ul { - margin: 0; - list-style: none; -} -#meta-panel .meta-field-value li { - margin: 0 0 0.5em 0; -} -#meta-panel .meta-field-title { - letter-spacing: 0.02em; - font-family: 'PT Sans Caption', sans-serif; - color: #2f2f2f; -} -#meta-panel .meta-section-title { - text-transform: uppercase; - letter-spacing: 0.02em; - color: #95a5a6; - font-weight: 300; -} -#meta-panel .table-of-contents { - margin-bottom: 2em; -} -#meta-panel .table-of-contents .toc-list { - list-style: none; -} -#meta-panel .table-of-contents .toc-list p { - margin: 0; -} -#meta-panel .table-of-contents .toc-list.level-1 { - margin: 0 0 0 0; -} -#meta-panel .table-of-contents .toc-list.level-1 > .toc-item { - margin: 0.7em 0 0 0; -} -#meta-panel .table-of-contents .toc-list.level-1 > .toc-item > a, -#meta-panel .table-of-contents .toc-list.level-1 > .toc-item > .no-anchor { - font-weight: bold; - text-transform: uppercase; - color: #5f5f5f; -} -#meta-panel .table-of-contents .toc-list.level-2 { - margin: 0 0 0 1em; -} -#meta-panel .table-of-contents .toc-list.level-2 > .toc-item { - margin: 0 0 0.4em 0; - font-size: 13px; - line-height: 100%; - white-space: nowrap; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; -} -#meta-panel .table-of-contents .toc-list.level-2 > .toc-item div, -#meta-panel .table-of-contents .toc-list.level-2 > .toc-item p { - display: inline; -} -pre code[class*="language-"] { - font-size: 14px; - line-height: 16px; - background: none !important; - padding: 0 !important; -} -#header { - height: 50px; - background: #2c3e50; - line-height: 50px; - padding: 0 30px; - font-size: 28px; - font-family: 'Raleway', sans-serif; -} -#header a { - text-decoration: none; - color: #ecf0f1; -} -#header .version { - font-size: 14px; - font-weight: 100; - margin-left: 5px; - font-variant: small-caps; -} -#header .navigation { - float: right; - font-size: 80%; - list-style: none; - margin: 0; -} -#header .navigation-item { - display: inline-block; - margin: 0 0 0 0.2em; - padding: 0 0.5em; - border-bottom: 0px solid #2c3e50; - text-transform: uppercase; - font-size: 18px; -} -#header .navigation-item:hover { - border-bottom-width: 5px; - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - -ms-transition: none; - transition: none; -} -#header .navigation-item:hover a { - color: #fff; - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - -ms-transition: none; - transition: none; -} -#header .navigation-item, -#header a { - -webkit-transition: all 0.25s ease-out; - -moz-transition: all 0.25s ease-out; - -o-transition: all 0.25s ease-out; - -ms-transition: all 0.25s ease-out; - transition: all 0.25s ease-out; -}