@fncts/base 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_cjs/collection/Iterable/api/traverseConc.cjs +43 -0
- package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -0
- package/_cjs/collection/Iterable/api.cjs +857 -0
- package/_cjs/collection/Iterable/api.cjs.map +1 -0
- package/_cjs/collection/Iterable/constructors.cjs +114 -0
- package/_cjs/collection/Iterable/constructors.cjs.map +1 -0
- package/_cjs/collection/Iterable/definition.cjs +9 -0
- package/_cjs/collection/Iterable/definition.cjs.map +1 -0
- package/_cjs/collection/Iterable.cjs +45 -0
- package/_cjs/collection/Iterable.cjs.map +1 -0
- package/_cjs/collection/compat/Array/api.cjs +72 -0
- package/_cjs/collection/compat/Array/api.cjs.map +1 -0
- package/_cjs/collection/compat/Array/definition.cjs +9 -0
- package/_cjs/collection/compat/Array/definition.cjs.map +1 -0
- package/_cjs/collection/compat/Array.cjs +32 -0
- package/_cjs/collection/compat/Array.cjs.map +1 -0
- package/_cjs/collection/compat/ArrayLike/api.cjs +51 -0
- package/_cjs/collection/compat/ArrayLike/api.cjs.map +1 -0
- package/_cjs/collection/compat/ArrayLike/definition.cjs +6 -0
- package/_cjs/collection/compat/ArrayLike/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/api/empty.cjs +16 -0
- package/_cjs/collection/immutable/Conc/api/empty.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/api/makeBy.cjs +34 -0
- package/_cjs/collection/immutable/Conc/api/makeBy.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/api/replicate.cjs +20 -0
- package/_cjs/collection/immutable/Conc/api/replicate.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/api.cjs +1493 -0
- package/_cjs/collection/immutable/Conc/api.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/constructors.cjs +61 -0
- package/_cjs/collection/immutable/Conc/constructors.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/definition.cjs +852 -0
- package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc.cjs +84 -0
- package/_cjs/collection/immutable/Conc.cjs.map +1 -0
- package/_cjs/collection/immutable/Dictionary/api.cjs +84 -0
- package/_cjs/collection/immutable/Dictionary/api.cjs.map +1 -0
- package/_cjs/collection/immutable/Dictionary/definition.cjs +16 -0
- package/_cjs/collection/immutable/Dictionary/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/HashMap/api.cjs +873 -0
- package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -0
- package/_cjs/collection/immutable/HashMap/definition.cjs +135 -0
- package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/HashMap/internal.cjs +403 -0
- package/_cjs/collection/immutable/HashMap/internal.cjs.map +1 -0
- package/_cjs/collection/immutable/HashMap.cjs +32 -0
- package/_cjs/collection/immutable/HashMap.cjs.map +1 -0
- package/_cjs/collection/immutable/HashSet/api.cjs +590 -0
- package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -0
- package/_cjs/collection/immutable/HashSet/definition.cjs +412 -0
- package/_cjs/collection/immutable/HashSet/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/HashSet.cjs +32 -0
- package/_cjs/collection/immutable/HashSet.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/api.cjs +1807 -0
- package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/constructors.cjs +79 -0
- package/_cjs/collection/immutable/ImmutableArray/constructors.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs +56 -0
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs +187 -0
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray.cjs +58 -0
- package/_cjs/collection/immutable/ImmutableArray.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +634 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs +105 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs +27 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs +72 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs +143 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs +71 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs.map +1 -0
- package/_cjs/collection/immutable/List/api/foldLeft.cjs +28 -0
- package/_cjs/collection/immutable/List/api/foldLeft.cjs.map +1 -0
- package/_cjs/collection/immutable/List/api/unsafeTail.cjs +26 -0
- package/_cjs/collection/immutable/List/api/unsafeTail.cjs.map +1 -0
- package/_cjs/collection/immutable/List/api.cjs +443 -0
- package/_cjs/collection/immutable/List/api.cjs.map +1 -0
- package/_cjs/collection/immutable/List/constructors.cjs +92 -0
- package/_cjs/collection/immutable/List/constructors.cjs.map +1 -0
- package/_cjs/collection/immutable/List/definition.cjs +125 -0
- package/_cjs/collection/immutable/List/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/List.cjs +71 -0
- package/_cjs/collection/immutable/List.cjs.map +1 -0
- package/_cjs/collection/immutable/Queue/api.cjs +210 -0
- package/_cjs/collection/immutable/Queue/api.cjs.map +1 -0
- package/_cjs/collection/immutable/Queue/constructors.cjs +33 -0
- package/_cjs/collection/immutable/Queue/constructors.cjs.map +1 -0
- package/_cjs/collection/immutable/Queue/definition.cjs +53 -0
- package/_cjs/collection/immutable/Queue/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/Queue/guards.cjs +20 -0
- package/_cjs/collection/immutable/Queue/guards.cjs.map +1 -0
- package/_cjs/collection/immutable/Queue.cjs +58 -0
- package/_cjs/collection/immutable/Queue.cjs.map +1 -0
- package/_cjs/collection/immutable/SortedMap/api.cjs +691 -0
- package/_cjs/collection/immutable/SortedMap/api.cjs.map +1 -0
- package/_cjs/collection/immutable/SortedMap/definition.cjs +27 -0
- package/_cjs/collection/immutable/SortedMap/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/SortedMap/internal.cjs +530 -0
- package/_cjs/collection/immutable/SortedMap/internal.cjs.map +1 -0
- package/_cjs/collection/immutable/SortedMap/iterator.cjs +394 -0
- package/_cjs/collection/immutable/SortedMap/iterator.cjs.map +1 -0
- package/_cjs/collection/immutable/SortedMap/node.cjs +23 -0
- package/_cjs/collection/immutable/SortedMap/node.cjs.map +1 -0
- package/_cjs/collection/immutable/SortedMap.cjs +71 -0
- package/_cjs/collection/immutable/SortedMap.cjs.map +1 -0
- package/_cjs/collection/immutable/Vector/api.cjs +1525 -0
- package/_cjs/collection/immutable/Vector/api.cjs.map +1 -0
- package/_cjs/collection/immutable/Vector/definition.cjs +105 -0
- package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/Vector/internal.cjs +1665 -0
- package/_cjs/collection/immutable/Vector/internal.cjs.map +1 -0
- package/_cjs/collection/immutable/Vector.cjs +32 -0
- package/_cjs/collection/immutable/Vector.cjs.map +1 -0
- package/_cjs/collection/mutable/HashMap.cjs +390 -0
- package/_cjs/collection/mutable/HashMap.cjs.map +1 -0
- package/_cjs/collection/mutable/HashSet.cjs +308 -0
- package/_cjs/collection/mutable/HashSet.cjs.map +1 -0
- package/_cjs/collection/mutable/ListBuffer.cjs +156 -0
- package/_cjs/collection/mutable/ListBuffer.cjs.map +1 -0
- package/_cjs/collection/mutable/internal.cjs +39 -0
- package/_cjs/collection/mutable/internal.cjs.map +1 -0
- package/_cjs/control/Eval/api/sequenceArray.cjs +22 -0
- package/_cjs/control/Eval/api/sequenceArray.cjs.map +1 -0
- package/_cjs/control/Eval/api.cjs +148 -0
- package/_cjs/control/Eval/api.cjs.map +1 -0
- package/_cjs/control/Eval/constructors.cjs +49 -0
- package/_cjs/control/Eval/constructors.cjs.map +1 -0
- package/_cjs/control/Eval/definition.cjs +68 -0
- package/_cjs/control/Eval/definition.cjs.map +1 -0
- package/_cjs/control/Eval/instance.cjs +52 -0
- package/_cjs/control/Eval/instance.cjs.map +1 -0
- package/_cjs/control/Eval/run.cjs +72 -0
- package/_cjs/control/Eval/run.cjs.map +1 -0
- package/_cjs/control/Eval.cjs +71 -0
- package/_cjs/control/Eval.cjs.map +1 -0
- package/_cjs/control/LazyValue.cjs +38 -0
- package/_cjs/control/LazyValue.cjs.map +1 -0
- package/_cjs/control/Z/api.cjs +667 -0
- package/_cjs/control/Z/api.cjs.map +1 -0
- package/_cjs/control/Z/definition.cjs +227 -0
- package/_cjs/control/Z/definition.cjs.map +1 -0
- package/_cjs/control/Z/instances.cjs +28 -0
- package/_cjs/control/Z/instances.cjs.map +1 -0
- package/_cjs/control/Z/runtime.cjs +387 -0
- package/_cjs/control/Z/runtime.cjs.map +1 -0
- package/_cjs/control/Z.cjs +58 -0
- package/_cjs/control/Z.cjs.map +1 -0
- package/_cjs/data/Byte.cjs +6 -0
- package/_cjs/data/Byte.cjs.map +1 -0
- package/_cjs/data/CaseClass.cjs +127 -0
- package/_cjs/data/CaseClass.cjs.map +1 -0
- package/_cjs/data/Cause/api/fold.cjs +191 -0
- package/_cjs/data/Cause/api/fold.cjs.map +1 -0
- package/_cjs/data/Cause/api/isEmpty.cjs +83 -0
- package/_cjs/data/Cause/api/isEmpty.cjs.map +1 -0
- package/_cjs/data/Cause/api/linearize.cjs +32 -0
- package/_cjs/data/Cause/api/linearize.cjs.map +1 -0
- package/_cjs/data/Cause/api/prettyPrint.cjs +51 -0
- package/_cjs/data/Cause/api/prettyPrint.cjs.map +1 -0
- package/_cjs/data/Cause/api/unified.cjs +168 -0
- package/_cjs/data/Cause/api/unified.cjs.map +1 -0
- package/_cjs/data/Cause/api.cjs +1406 -0
- package/_cjs/data/Cause/api.cjs.map +1 -0
- package/_cjs/data/Cause/definition.cjs +670 -0
- package/_cjs/data/Cause/definition.cjs.map +1 -0
- package/_cjs/data/Cause.cjs +32 -0
- package/_cjs/data/Cause.cjs.map +1 -0
- package/_cjs/data/Const/api.cjs +30 -0
- package/_cjs/data/Const/api.cjs.map +1 -0
- package/_cjs/data/Const/definition.cjs +9 -0
- package/_cjs/data/Const/definition.cjs.map +1 -0
- package/_cjs/data/Const/instances.cjs +50 -0
- package/_cjs/data/Const/instances.cjs.map +1 -0
- package/_cjs/data/Const.cjs +45 -0
- package/_cjs/data/Const.cjs.map +1 -0
- package/_cjs/data/Duration/api.cjs +97 -0
- package/_cjs/data/Duration/api.cjs.map +1 -0
- package/_cjs/data/Duration/definition.cjs +50 -0
- package/_cjs/data/Duration/definition.cjs.map +1 -0
- package/_cjs/data/Duration.cjs +32 -0
- package/_cjs/data/Duration.cjs.map +1 -0
- package/_cjs/data/Either/api/align.cjs +19 -0
- package/_cjs/data/Either/api/align.cjs.map +1 -0
- package/_cjs/data/Either/api/alignWith.cjs +28 -0
- package/_cjs/data/Either/api/alignWith.cjs.map +1 -0
- package/_cjs/data/Either/api.cjs +343 -0
- package/_cjs/data/Either/api.cjs.map +1 -0
- package/_cjs/data/Either/constructors.cjs +95 -0
- package/_cjs/data/Either/constructors.cjs.map +1 -0
- package/_cjs/data/Either/definition.cjs +56 -0
- package/_cjs/data/Either/definition.cjs.map +1 -0
- package/_cjs/data/Either/destructors.cjs +24 -0
- package/_cjs/data/Either/destructors.cjs.map +1 -0
- package/_cjs/data/Either/instances.cjs +85 -0
- package/_cjs/data/Either/instances.cjs.map +1 -0
- package/_cjs/data/Either.cjs +71 -0
- package/_cjs/data/Either.cjs.map +1 -0
- package/_cjs/data/Environment/api.cjs +116 -0
- package/_cjs/data/Environment/api.cjs.map +1 -0
- package/_cjs/data/Environment/definition.cjs +60 -0
- package/_cjs/data/Environment/definition.cjs.map +1 -0
- package/_cjs/data/Environment.cjs +32 -0
- package/_cjs/data/Environment.cjs.map +1 -0
- package/_cjs/data/ExecutionStrategy.cjs +73 -0
- package/_cjs/data/ExecutionStrategy.cjs.map +1 -0
- package/_cjs/data/Exit/api.cjs +259 -0
- package/_cjs/data/Exit/api.cjs.map +1 -0
- package/_cjs/data/Exit/constructors.cjs +93 -0
- package/_cjs/data/Exit/constructors.cjs.map +1 -0
- package/_cjs/data/Exit/definition.cjs +139 -0
- package/_cjs/data/Exit/definition.cjs.map +1 -0
- package/_cjs/data/Exit.cjs +45 -0
- package/_cjs/data/Exit.cjs.map +1 -0
- package/_cjs/data/FiberId/api.cjs +72 -0
- package/_cjs/data/FiberId/api.cjs.map +1 -0
- package/_cjs/data/FiberId/constructors.cjs +41 -0
- package/_cjs/data/FiberId/constructors.cjs.map +1 -0
- package/_cjs/data/FiberId/definition.cjs +130 -0
- package/_cjs/data/FiberId/definition.cjs.map +1 -0
- package/_cjs/data/FiberId.cjs +45 -0
- package/_cjs/data/FiberId.cjs.map +1 -0
- package/_cjs/data/Identity/api.cjs +42 -0
- package/_cjs/data/Identity/api.cjs.map +1 -0
- package/_cjs/data/Identity/definition.cjs +9 -0
- package/_cjs/data/Identity/definition.cjs.map +1 -0
- package/_cjs/data/Identity/instances.cjs +50 -0
- package/_cjs/data/Identity/instances.cjs.map +1 -0
- package/_cjs/data/Identity.cjs +45 -0
- package/_cjs/data/Identity.cjs.map +1 -0
- package/_cjs/data/Maybe/api.cjs +265 -0
- package/_cjs/data/Maybe/api.cjs.map +1 -0
- package/_cjs/data/Maybe/constructors.cjs +117 -0
- package/_cjs/data/Maybe/constructors.cjs.map +1 -0
- package/_cjs/data/Maybe/definition.cjs +128 -0
- package/_cjs/data/Maybe/definition.cjs.map +1 -0
- package/_cjs/data/Maybe/destructors.cjs +19 -0
- package/_cjs/data/Maybe/destructors.cjs.map +1 -0
- package/_cjs/data/Maybe/instances.cjs +68 -0
- package/_cjs/data/Maybe/instances.cjs.map +1 -0
- package/_cjs/data/Maybe.cjs +71 -0
- package/_cjs/data/Maybe.cjs.map +1 -0
- package/_cjs/data/Newtype.cjs +27 -0
- package/_cjs/data/Newtype.cjs.map +1 -0
- package/_cjs/data/Patch/api.cjs +137 -0
- package/_cjs/data/Patch/api.cjs.map +1 -0
- package/_cjs/data/Patch/definition.cjs +88 -0
- package/_cjs/data/Patch/definition.cjs.map +1 -0
- package/_cjs/data/Patch.cjs +32 -0
- package/_cjs/data/Patch.cjs.map +1 -0
- package/_cjs/data/Predicate/api.cjs +41 -0
- package/_cjs/data/Predicate/api.cjs.map +1 -0
- package/_cjs/data/Predicate/definition.cjs +6 -0
- package/_cjs/data/Predicate/definition.cjs.map +1 -0
- package/_cjs/data/Predicate.cjs +32 -0
- package/_cjs/data/Predicate.cjs.map +1 -0
- package/_cjs/data/Refinement/api.cjs +43 -0
- package/_cjs/data/Refinement/api.cjs.map +1 -0
- package/_cjs/data/Refinement/definition.cjs +6 -0
- package/_cjs/data/Refinement/definition.cjs.map +1 -0
- package/_cjs/data/Refinement.cjs +32 -0
- package/_cjs/data/Refinement.cjs.map +1 -0
- package/_cjs/data/Struct/api.cjs +37 -0
- package/_cjs/data/Struct/api.cjs.map +1 -0
- package/_cjs/data/Struct/definition.cjs +16 -0
- package/_cjs/data/Struct/definition.cjs.map +1 -0
- package/_cjs/data/Tag/constructors.cjs +20 -0
- package/_cjs/data/Tag/constructors.cjs.map +1 -0
- package/_cjs/data/Tag/definition.cjs +57 -0
- package/_cjs/data/Tag/definition.cjs.map +1 -0
- package/_cjs/data/Tag.cjs +32 -0
- package/_cjs/data/Tag.cjs.map +1 -0
- package/_cjs/data/These/constructors.cjs +37 -0
- package/_cjs/data/These/constructors.cjs.map +1 -0
- package/_cjs/data/These/definition.cjs +63 -0
- package/_cjs/data/These/definition.cjs.map +1 -0
- package/_cjs/data/These/destructors.cjs +29 -0
- package/_cjs/data/These/destructors.cjs.map +1 -0
- package/_cjs/data/These.cjs +45 -0
- package/_cjs/data/These.cjs.map +1 -0
- package/_cjs/data/Trace/api.cjs +35 -0
- package/_cjs/data/Trace/api.cjs.map +1 -0
- package/_cjs/data/Trace/constructors.cjs +32 -0
- package/_cjs/data/Trace/constructors.cjs.map +1 -0
- package/_cjs/data/Trace/definition.cjs +21 -0
- package/_cjs/data/Trace/definition.cjs.map +1 -0
- package/_cjs/data/Trace.cjs +45 -0
- package/_cjs/data/Trace.cjs.map +1 -0
- package/_cjs/data/TraceElement/definition.cjs +75 -0
- package/_cjs/data/TraceElement/definition.cjs.map +1 -0
- package/_cjs/data/TraceElement.cjs +19 -0
- package/_cjs/data/TraceElement.cjs.map +1 -0
- package/_cjs/data/exceptions/ArrayIndexOutOfBoundsError.cjs +20 -0
- package/_cjs/data/exceptions/ArrayIndexOutOfBoundsError.cjs.map +1 -0
- package/_cjs/data/exceptions/IllegalArgumentError.cjs +21 -0
- package/_cjs/data/exceptions/IllegalArgumentError.cjs.map +1 -0
- package/_cjs/data/exceptions/IllegalStateError.cjs +20 -0
- package/_cjs/data/exceptions/IllegalStateError.cjs.map +1 -0
- package/_cjs/data/exceptions/IndexOutOfBoundsError.cjs +20 -0
- package/_cjs/data/exceptions/IndexOutOfBoundsError.cjs.map +1 -0
- package/_cjs/data/exceptions/InterruptedException.cjs +27 -0
- package/_cjs/data/exceptions/InterruptedException.cjs.map +1 -0
- package/_cjs/data/exceptions/InvalidCapacityError.cjs +23 -0
- package/_cjs/data/exceptions/InvalidCapacityError.cjs.map +1 -0
- package/_cjs/data/exceptions/NoSuchElementError.cjs +20 -0
- package/_cjs/data/exceptions/NoSuchElementError.cjs.map +1 -0
- package/_cjs/data/exceptions.cjs +97 -0
- package/_cjs/data/exceptions.cjs.map +1 -0
- package/_cjs/data/function/api.cjs +52 -0
- package/_cjs/data/function/api.cjs.map +1 -0
- package/_cjs/data/function/definition.cjs +6 -0
- package/_cjs/data/function/definition.cjs.map +1 -0
- package/_cjs/data/function/pipe.cjs +74 -0
- package/_cjs/data/function/pipe.cjs.map +1 -0
- package/_cjs/data/function.cjs +45 -0
- package/_cjs/data/function.cjs.map +1 -0
- package/_cjs/data/number/api.cjs +14 -0
- package/_cjs/data/number/api.cjs.map +1 -0
- package/_cjs/data/number/definition.cjs +6 -0
- package/_cjs/data/number/definition.cjs.map +1 -0
- package/_cjs/data/number/instances.cjs +34 -0
- package/_cjs/data/number/instances.cjs.map +1 -0
- package/_cjs/data/number.cjs +45 -0
- package/_cjs/data/number.cjs.map +1 -0
- package/_cjs/data/object/definition.cjs +6 -0
- package/_cjs/data/object/definition.cjs.map +1 -0
- package/_cjs/data/object.cjs +19 -0
- package/_cjs/data/object.cjs.map +1 -0
- package/_cjs/data/string/api.cjs +254 -0
- package/_cjs/data/string/api.cjs.map +1 -0
- package/_cjs/data/string/definition.cjs +6 -0
- package/_cjs/data/string/definition.cjs.map +1 -0
- package/_cjs/data/string/instances.cjs +55 -0
- package/_cjs/data/string/instances.cjs.map +1 -0
- package/_cjs/data/string.cjs +45 -0
- package/_cjs/data/string.cjs.map +1 -0
- package/_cjs/global/api.cjs +11 -0
- package/_cjs/global/api.cjs.map +1 -0
- package/_cjs/internal/AtomicBoolean.cjs +18 -0
- package/_cjs/internal/AtomicBoolean.cjs.map +1 -0
- package/_cjs/internal/AtomicNumber.cjs +36 -0
- package/_cjs/internal/AtomicNumber.cjs.map +1 -0
- package/_cjs/internal/AtomicReference.cjs +40 -0
- package/_cjs/internal/AtomicReference.cjs.map +1 -0
- package/_cjs/internal/Stack.cjs +69 -0
- package/_cjs/internal/Stack.cjs.map +1 -0
- package/_cjs/optics/At/api.cjs +24 -0
- package/_cjs/optics/At/api.cjs.map +1 -0
- package/_cjs/optics/At/definition.cjs +34 -0
- package/_cjs/optics/At/definition.cjs.map +1 -0
- package/_cjs/optics/At.cjs +32 -0
- package/_cjs/optics/At.cjs.map +1 -0
- package/_cjs/optics/Fold/definition.cjs +21 -0
- package/_cjs/optics/Fold/definition.cjs.map +1 -0
- package/_cjs/optics/Fold.cjs +19 -0
- package/_cjs/optics/Fold.cjs.map +1 -0
- package/_cjs/optics/Getter/definition.cjs +22 -0
- package/_cjs/optics/Getter/definition.cjs.map +1 -0
- package/_cjs/optics/Getter.cjs +19 -0
- package/_cjs/optics/Getter.cjs.map +1 -0
- package/_cjs/optics/Index/api.cjs +37 -0
- package/_cjs/optics/Index/api.cjs.map +1 -0
- package/_cjs/optics/Index/definition.cjs +20 -0
- package/_cjs/optics/Index/definition.cjs.map +1 -0
- package/_cjs/optics/Index.cjs +32 -0
- package/_cjs/optics/Index.cjs.map +1 -0
- package/_cjs/optics/Iso/api.cjs +25 -0
- package/_cjs/optics/Iso/api.cjs.map +1 -0
- package/_cjs/optics/Iso/definition.cjs +54 -0
- package/_cjs/optics/Iso/definition.cjs.map +1 -0
- package/_cjs/optics/Iso.cjs +32 -0
- package/_cjs/optics/Iso.cjs.map +1 -0
- package/_cjs/optics/Lens/api.cjs +171 -0
- package/_cjs/optics/Lens/api.cjs.map +1 -0
- package/_cjs/optics/Lens/definition.cjs +50 -0
- package/_cjs/optics/Lens/definition.cjs.map +1 -0
- package/_cjs/optics/Lens.cjs +32 -0
- package/_cjs/optics/Lens.cjs.map +1 -0
- package/_cjs/optics/Optional/api/compose.cjs +27 -0
- package/_cjs/optics/Optional/api/compose.cjs.map +1 -0
- package/_cjs/optics/Optional/definition.cjs +57 -0
- package/_cjs/optics/Optional/definition.cjs.map +1 -0
- package/_cjs/optics/Optional.cjs +32 -0
- package/_cjs/optics/Optional.cjs.map +1 -0
- package/_cjs/optics/Prism/api/compose.cjs +29 -0
- package/_cjs/optics/Prism/api/compose.cjs.map +1 -0
- package/_cjs/optics/Prism/api/fromNullable.cjs +27 -0
- package/_cjs/optics/Prism/api/fromNullable.cjs.map +1 -0
- package/_cjs/optics/Prism/api/just.cjs +29 -0
- package/_cjs/optics/Prism/api/just.cjs.map +1 -0
- package/_cjs/optics/Prism/definition.cjs +48 -0
- package/_cjs/optics/Prism/definition.cjs.map +1 -0
- package/_cjs/optics/Prism.cjs +58 -0
- package/_cjs/optics/Prism.cjs.map +1 -0
- package/_cjs/optics/Setter/definition.cjs +33 -0
- package/_cjs/optics/Setter/definition.cjs.map +1 -0
- package/_cjs/optics/Setter.cjs +19 -0
- package/_cjs/optics/Setter.cjs.map +1 -0
- package/_cjs/optics/Traversal/api/compose.cjs +22 -0
- package/_cjs/optics/Traversal/api/compose.cjs.map +1 -0
- package/_cjs/optics/Traversal/api/fromTraversable.cjs +22 -0
- package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -0
- package/_cjs/optics/Traversal/definition.cjs +53 -0
- package/_cjs/optics/Traversal/definition.cjs.map +1 -0
- package/_cjs/optics/Traversal.cjs +45 -0
- package/_cjs/optics/Traversal.cjs.map +1 -0
- package/_cjs/typeclass/Align.cjs +29 -0
- package/_cjs/typeclass/Align.cjs.map +1 -0
- package/_cjs/typeclass/Alt.cjs +26 -0
- package/_cjs/typeclass/Alt.cjs.map +1 -0
- package/_cjs/typeclass/Alternative.cjs +32 -0
- package/_cjs/typeclass/Alternative.cjs.map +1 -0
- package/_cjs/typeclass/Applicative.cjs +31 -0
- package/_cjs/typeclass/Applicative.cjs.map +1 -0
- package/_cjs/typeclass/ApplicativeExcept.cjs +56 -0
- package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -0
- package/_cjs/typeclass/Apply.cjs +136 -0
- package/_cjs/typeclass/Apply.cjs.map +1 -0
- package/_cjs/typeclass/Chain.cjs +35 -0
- package/_cjs/typeclass/Chain.cjs.map +1 -0
- package/_cjs/typeclass/Closure.cjs +21 -0
- package/_cjs/typeclass/Closure.cjs.map +1 -0
- package/_cjs/typeclass/Eq.cjs +21 -0
- package/_cjs/typeclass/Eq.cjs.map +1 -0
- package/_cjs/typeclass/Equatable/api.cjs +45 -0
- package/_cjs/typeclass/Equatable/api.cjs.map +1 -0
- package/_cjs/typeclass/Equatable/definition.cjs +28 -0
- package/_cjs/typeclass/Equatable/definition.cjs.map +1 -0
- package/_cjs/typeclass/Equatable/fast-equals.cjs +520 -0
- package/_cjs/typeclass/Equatable/fast-equals.cjs.map +1 -0
- package/_cjs/typeclass/Equatable.cjs +45 -0
- package/_cjs/typeclass/Equatable.cjs.map +1 -0
- package/_cjs/typeclass/Fail.cjs +22 -0
- package/_cjs/typeclass/Fail.cjs.map +1 -0
- package/_cjs/typeclass/Filterable.cjs +32 -0
- package/_cjs/typeclass/Filterable.cjs.map +1 -0
- package/_cjs/typeclass/FilterableWithIndex.cjs +35 -0
- package/_cjs/typeclass/FilterableWithIndex.cjs.map +1 -0
- package/_cjs/typeclass/Foldable.cjs +34 -0
- package/_cjs/typeclass/Foldable.cjs.map +1 -0
- package/_cjs/typeclass/FoldableWithIndex.cjs +36 -0
- package/_cjs/typeclass/FoldableWithIndex.cjs.map +1 -0
- package/_cjs/typeclass/Functor.cjs +30 -0
- package/_cjs/typeclass/Functor.cjs.map +1 -0
- package/_cjs/typeclass/FunctorWithIndex.cjs +30 -0
- package/_cjs/typeclass/FunctorWithIndex.cjs.map +1 -0
- package/_cjs/typeclass/Has.cjs +17 -0
- package/_cjs/typeclass/Has.cjs.map +1 -0
- package/_cjs/typeclass/Hash.cjs +18 -0
- package/_cjs/typeclass/Hash.cjs.map +1 -0
- package/_cjs/typeclass/HashEq.cjs +51 -0
- package/_cjs/typeclass/HashEq.cjs.map +1 -0
- package/_cjs/typeclass/Hashable/definition.cjs +28 -0
- package/_cjs/typeclass/Hashable/definition.cjs.map +1 -0
- package/_cjs/typeclass/Hashable/hash.cjs +267 -0
- package/_cjs/typeclass/Hashable/hash.cjs.map +1 -0
- package/_cjs/typeclass/Hashable.cjs +32 -0
- package/_cjs/typeclass/Hashable.cjs.map +1 -0
- package/_cjs/typeclass/Monad.cjs +31 -0
- package/_cjs/typeclass/Monad.cjs.map +1 -0
- package/_cjs/typeclass/MonadExcept.cjs +36 -0
- package/_cjs/typeclass/MonadExcept.cjs.map +1 -0
- package/_cjs/typeclass/Monoid.cjs +27 -0
- package/_cjs/typeclass/Monoid.cjs.map +1 -0
- package/_cjs/typeclass/Nil.cjs +6 -0
- package/_cjs/typeclass/Nil.cjs.map +1 -0
- package/_cjs/typeclass/Ord/api/contramap.cjs +19 -0
- package/_cjs/typeclass/Ord/api/contramap.cjs.map +1 -0
- package/_cjs/typeclass/Ord/api/max.cjs +15 -0
- package/_cjs/typeclass/Ord/api/max.cjs.map +1 -0
- package/_cjs/typeclass/Ord/api/min.cjs +15 -0
- package/_cjs/typeclass/Ord/api/min.cjs.map +1 -0
- package/_cjs/typeclass/Ord/api.cjs +45 -0
- package/_cjs/typeclass/Ord/api.cjs.map +1 -0
- package/_cjs/typeclass/Ord/definition.cjs +28 -0
- package/_cjs/typeclass/Ord/definition.cjs.map +1 -0
- package/_cjs/typeclass/Ord/instances.cjs +52 -0
- package/_cjs/typeclass/Ord/instances.cjs.map +1 -0
- package/_cjs/typeclass/Ord.cjs +45 -0
- package/_cjs/typeclass/Ord.cjs.map +1 -0
- package/_cjs/typeclass/Ordering.cjs +57 -0
- package/_cjs/typeclass/Ordering.cjs.map +1 -0
- package/_cjs/typeclass/Pointed.cjs +25 -0
- package/_cjs/typeclass/Pointed.cjs.map +1 -0
- package/_cjs/typeclass/Semialign.cjs +121 -0
- package/_cjs/typeclass/Semialign.cjs.map +1 -0
- package/_cjs/typeclass/Semigroup/api.cjs +37 -0
- package/_cjs/typeclass/Semigroup/api.cjs.map +1 -0
- package/_cjs/typeclass/Semigroup/definition.cjs +18 -0
- package/_cjs/typeclass/Semigroup/definition.cjs.map +1 -0
- package/_cjs/typeclass/Semigroup.cjs +32 -0
- package/_cjs/typeclass/Semigroup.cjs.map +1 -0
- package/_cjs/typeclass/Semimonoidal.cjs +24 -0
- package/_cjs/typeclass/Semimonoidal.cjs.map +1 -0
- package/_cjs/typeclass/Showable/definition.cjs +32 -0
- package/_cjs/typeclass/Showable/definition.cjs.map +1 -0
- package/_cjs/typeclass/Showable/show.cjs +837 -0
- package/_cjs/typeclass/Showable/show.cjs.map +1 -0
- package/_cjs/typeclass/Showable/styles.cjs +39 -0
- package/_cjs/typeclass/Showable/styles.cjs.map +1 -0
- package/_cjs/typeclass/Showable/util.cjs +433 -0
- package/_cjs/typeclass/Showable/util.cjs.map +1 -0
- package/_cjs/typeclass/Showable.cjs +32 -0
- package/_cjs/typeclass/Showable.cjs.map +1 -0
- package/_cjs/typeclass/Traversable.cjs +54 -0
- package/_cjs/typeclass/Traversable.cjs.map +1 -0
- package/_cjs/typeclass/TraversableWithIndex.cjs +49 -0
- package/_cjs/typeclass/TraversableWithIndex.cjs.map +1 -0
- package/_cjs/typeclass/Witherable.cjs +68 -0
- package/_cjs/typeclass/Witherable.cjs.map +1 -0
- package/_cjs/typeclass/WitherableWithIndex.cjs +76 -0
- package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -0
- package/_cjs/typeclass/builtin/Symbol.cjs +6 -0
- package/_cjs/typeclass/builtin/Symbol.cjs.map +1 -0
- package/_cjs/typeclass/builtin.cjs +19 -0
- package/_cjs/typeclass/builtin.cjs.map +1 -0
- package/_cjs/typeclass.cjs +474 -0
- package/_cjs/typeclass.cjs.map +1 -0
- package/_cjs/types/extractions.cjs +6 -0
- package/_cjs/types/extractions.cjs.map +1 -0
- package/_cjs/types/test.cjs +6 -0
- package/_cjs/types/test.cjs.map +1 -0
- package/_cjs/types/utility.cjs +6 -0
- package/_cjs/types/utility.cjs.map +1 -0
- package/_cjs/types.cjs +45 -0
- package/_cjs/types.cjs.map +1 -0
- package/_cjs/util/AnsiFormat.cjs +338 -0
- package/_cjs/util/AnsiFormat.cjs.map +1 -0
- package/_cjs/util/PCGRandom.cjs +177 -0
- package/_cjs/util/PCGRandom.cjs.map +1 -0
- package/_cjs/util/assert.cjs +24 -0
- package/_cjs/util/assert.cjs.map +1 -0
- package/_cjs/util/pattern.cjs +23 -0
- package/_cjs/util/pattern.cjs.map +1 -0
- package/_cjs/util/predicates.cjs +157 -0
- package/_cjs/util/predicates.cjs.map +1 -0
- package/_cjs/util/rand/Random.cjs +103 -0
- package/_cjs/util/rand/Random.cjs.map +1 -0
- package/_cjs/util/rand/distribution/Distribution.cjs +6 -0
- package/_cjs/util/rand/distribution/Distribution.cjs.map +1 -0
- package/_cjs/util/rand/distribution/UniformArrayIntDistribution.cjs +32 -0
- package/_cjs/util/rand/distribution/UniformArrayIntDistribution.cjs.map +1 -0
- package/_cjs/util/rand/distribution/UniformBigIntDistribution.cjs +50 -0
- package/_cjs/util/rand/distribution/UniformBigIntDistribution.cjs.map +1 -0
- package/_cjs/util/rand/distribution/UniformIntDistribution.cjs +70 -0
- package/_cjs/util/rand/distribution/UniformIntDistribution.cjs.map +1 -0
- package/_cjs/util/rand/distribution/internals/ArrayInt.cjs +220 -0
- package/_cjs/util/rand/distribution/internals/ArrayInt.cjs.map +1 -0
- package/_cjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.cjs +44 -0
- package/_cjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.cjs.map +1 -0
- package/_cjs/util/rand/distribution/internals/UniformIntDistributionInternal.cjs +56 -0
- package/_cjs/util/rand/distribution/internals/UniformIntDistributionInternal.cjs.map +1 -0
- package/_cjs/util/rand/generator/MersenneTwister.cjs +115 -0
- package/_cjs/util/rand/generator/MersenneTwister.cjs.map +1 -0
- package/_cjs/util/rand/generator/RandomGenerator.cjs +23 -0
- package/_cjs/util/rand/generator/RandomGenerator.cjs.map +1 -0
- package/_cjs/util/rand.cjs +88 -0
- package/_cjs/util/rand.cjs.map +1 -0
- package/_mjs/collection/Iterable/api/traverseConc.mjs +28 -0
- package/_mjs/collection/Iterable/api/traverseConc.mjs.map +1 -0
- package/_mjs/collection/Iterable/api.mjs +784 -0
- package/_mjs/collection/Iterable/api.mjs.map +1 -0
- package/_mjs/collection/Iterable/constructors.mjs +100 -0
- package/_mjs/collection/Iterable/constructors.mjs.map +1 -0
- package/_mjs/collection/Iterable/definition.mjs +2 -0
- package/_mjs/collection/Iterable/definition.mjs.map +1 -0
- package/_mjs/collection/Iterable.mjs +5 -0
- package/_mjs/collection/Iterable.mjs.map +1 -0
- package/_mjs/collection/compat/Array/api.mjs +56 -0
- package/_mjs/collection/compat/Array/api.mjs.map +1 -0
- package/_mjs/collection/compat/Array/definition.mjs +2 -0
- package/_mjs/collection/compat/Array/definition.mjs.map +1 -0
- package/_mjs/collection/compat/Array.mjs +4 -0
- package/_mjs/collection/compat/Array.mjs.map +1 -0
- package/_mjs/collection/compat/ArrayLike/api.mjs +40 -0
- package/_mjs/collection/compat/ArrayLike/api.mjs.map +1 -0
- package/_mjs/collection/compat/ArrayLike/definition.mjs +2 -0
- package/_mjs/collection/compat/ArrayLike/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/api/empty.mjs +9 -0
- package/_mjs/collection/immutable/Conc/api/empty.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/api/makeBy.mjs +22 -0
- package/_mjs/collection/immutable/Conc/api/makeBy.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/api/replicate.mjs +9 -0
- package/_mjs/collection/immutable/Conc/api/replicate.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/api.mjs +1340 -0
- package/_mjs/collection/immutable/Conc/api.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/constructors.mjs +40 -0
- package/_mjs/collection/immutable/Conc/constructors.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/definition.mjs +798 -0
- package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc.mjs +10 -0
- package/_mjs/collection/immutable/Conc.mjs.map +1 -0
- package/_mjs/collection/immutable/Dictionary/api.mjs +62 -0
- package/_mjs/collection/immutable/Dictionary/api.mjs.map +1 -0
- package/_mjs/collection/immutable/Dictionary/definition.mjs +3 -0
- package/_mjs/collection/immutable/Dictionary/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/HashMap/api.mjs +724 -0
- package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -0
- package/_mjs/collection/immutable/HashMap/definition.mjs +111 -0
- package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/HashMap/internal.mjs +352 -0
- package/_mjs/collection/immutable/HashMap/internal.mjs.map +1 -0
- package/_mjs/collection/immutable/HashMap.mjs +4 -0
- package/_mjs/collection/immutable/HashMap.mjs.map +1 -0
- package/_mjs/collection/immutable/HashSet/api.mjs +515 -0
- package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -0
- package/_mjs/collection/immutable/HashSet/definition.mjs +370 -0
- package/_mjs/collection/immutable/HashSet/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/HashSet.mjs +4 -0
- package/_mjs/collection/immutable/HashSet.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/api.mjs +1514 -0
- package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/constructors.mjs +56 -0
- package/_mjs/collection/immutable/ImmutableArray/constructors.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs +34 -0
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs +142 -0
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray.mjs +6 -0
- package/_mjs/collection/immutable/ImmutableArray.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +521 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs +76 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs +14 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs +52 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs +110 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs +7 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs.map +1 -0
- package/_mjs/collection/immutable/List/api/foldLeft.mjs +17 -0
- package/_mjs/collection/immutable/List/api/foldLeft.mjs.map +1 -0
- package/_mjs/collection/immutable/List/api/unsafeTail.mjs +14 -0
- package/_mjs/collection/immutable/List/api/unsafeTail.mjs.map +1 -0
- package/_mjs/collection/immutable/List/api.mjs +388 -0
- package/_mjs/collection/immutable/List/api.mjs.map +1 -0
- package/_mjs/collection/immutable/List/constructors.mjs +71 -0
- package/_mjs/collection/immutable/List/constructors.mjs.map +1 -0
- package/_mjs/collection/immutable/List/definition.mjs +106 -0
- package/_mjs/collection/immutable/List/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/List.mjs +9 -0
- package/_mjs/collection/immutable/List.mjs.map +1 -0
- package/_mjs/collection/immutable/Queue/api.mjs +165 -0
- package/_mjs/collection/immutable/Queue/api.mjs.map +1 -0
- package/_mjs/collection/immutable/Queue/constructors.mjs +18 -0
- package/_mjs/collection/immutable/Queue/constructors.mjs.map +1 -0
- package/_mjs/collection/immutable/Queue/definition.mjs +38 -0
- package/_mjs/collection/immutable/Queue/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/Queue/guards.mjs +9 -0
- package/_mjs/collection/immutable/Queue/guards.mjs.map +1 -0
- package/_mjs/collection/immutable/Queue.mjs +6 -0
- package/_mjs/collection/immutable/Queue.mjs.map +1 -0
- package/_mjs/collection/immutable/SortedMap/api.mjs +631 -0
- package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -0
- package/_mjs/collection/immutable/SortedMap/definition.mjs +18 -0
- package/_mjs/collection/immutable/SortedMap/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/SortedMap/internal.mjs +515 -0
- package/_mjs/collection/immutable/SortedMap/internal.mjs.map +1 -0
- package/_mjs/collection/immutable/SortedMap/iterator.mjs +373 -0
- package/_mjs/collection/immutable/SortedMap/iterator.mjs.map +1 -0
- package/_mjs/collection/immutable/SortedMap/node.mjs +13 -0
- package/_mjs/collection/immutable/SortedMap/node.mjs.map +1 -0
- package/_mjs/collection/immutable/SortedMap.mjs +7 -0
- package/_mjs/collection/immutable/SortedMap.mjs.map +1 -0
- package/_mjs/collection/immutable/Vector/api.mjs +1367 -0
- package/_mjs/collection/immutable/Vector/api.mjs.map +1 -0
- package/_mjs/collection/immutable/Vector/definition.mjs +81 -0
- package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/Vector/internal.mjs +1557 -0
- package/_mjs/collection/immutable/Vector/internal.mjs.map +1 -0
- package/_mjs/collection/immutable/Vector.mjs +4 -0
- package/_mjs/collection/immutable/Vector.mjs.map +1 -0
- package/_mjs/collection/mutable/HashMap.mjs +370 -0
- package/_mjs/collection/mutable/HashMap.mjs.map +1 -0
- package/_mjs/collection/mutable/HashSet.mjs +290 -0
- package/_mjs/collection/mutable/HashSet.mjs.map +1 -0
- package/_mjs/collection/mutable/ListBuffer.mjs +141 -0
- package/_mjs/collection/mutable/ListBuffer.mjs.map +1 -0
- package/_mjs/collection/mutable/internal.mjs +26 -0
- package/_mjs/collection/mutable/internal.mjs.map +1 -0
- package/_mjs/control/Eval/api/sequenceArray.mjs +10 -0
- package/_mjs/control/Eval/api/sequenceArray.mjs.map +1 -0
- package/_mjs/control/Eval/api.mjs +98 -0
- package/_mjs/control/Eval/api.mjs.map +1 -0
- package/_mjs/control/Eval/constructors.mjs +35 -0
- package/_mjs/control/Eval/constructors.mjs.map +1 -0
- package/_mjs/control/Eval/definition.mjs +47 -0
- package/_mjs/control/Eval/definition.mjs.map +1 -0
- package/_mjs/control/Eval/instance.mjs +33 -0
- package/_mjs/control/Eval/instance.mjs.map +1 -0
- package/_mjs/control/Eval/run.mjs +60 -0
- package/_mjs/control/Eval/run.mjs.map +1 -0
- package/_mjs/control/Eval.mjs +7 -0
- package/_mjs/control/Eval.mjs.map +1 -0
- package/_mjs/control/LazyValue.mjs +27 -0
- package/_mjs/control/LazyValue.mjs.map +1 -0
- package/_mjs/control/Z/api.mjs +541 -0
- package/_mjs/control/Z/api.mjs.map +1 -0
- package/_mjs/control/Z/definition.mjs +169 -0
- package/_mjs/control/Z/definition.mjs.map +1 -0
- package/_mjs/control/Z/instances.mjs +14 -0
- package/_mjs/control/Z/instances.mjs.map +1 -0
- package/_mjs/control/Z/runtime.mjs +354 -0
- package/_mjs/control/Z/runtime.mjs.map +1 -0
- package/_mjs/control/Z.mjs +6 -0
- package/_mjs/control/Z.mjs.map +1 -0
- package/_mjs/data/Byte.mjs +2 -0
- package/_mjs/data/Byte.mjs.map +1 -0
- package/_mjs/data/CaseClass.mjs +103 -0
- package/_mjs/data/CaseClass.mjs.map +1 -0
- package/_mjs/data/Cause/api/fold.mjs +174 -0
- package/_mjs/data/Cause/api/fold.mjs.map +1 -0
- package/_mjs/data/Cause/api/isEmpty.mjs +72 -0
- package/_mjs/data/Cause/api/isEmpty.mjs.map +1 -0
- package/_mjs/data/Cause/api/linearize.mjs +19 -0
- package/_mjs/data/Cause/api/linearize.mjs.map +1 -0
- package/_mjs/data/Cause/api/prettyPrint.mjs +37 -0
- package/_mjs/data/Cause/api/prettyPrint.mjs.map +1 -0
- package/_mjs/data/Cause/api/unified.mjs +150 -0
- package/_mjs/data/Cause/api/unified.mjs.map +1 -0
- package/_mjs/data/Cause/api.mjs +1200 -0
- package/_mjs/data/Cause/api.mjs.map +1 -0
- package/_mjs/data/Cause/definition.mjs +612 -0
- package/_mjs/data/Cause/definition.mjs.map +1 -0
- package/_mjs/data/Cause.mjs +4 -0
- package/_mjs/data/Cause.mjs.map +1 -0
- package/_mjs/data/Const/api.mjs +17 -0
- package/_mjs/data/Const/api.mjs.map +1 -0
- package/_mjs/data/Const/definition.mjs +2 -0
- package/_mjs/data/Const/definition.mjs.map +1 -0
- package/_mjs/data/Const/instances.mjs +32 -0
- package/_mjs/data/Const/instances.mjs.map +1 -0
- package/_mjs/data/Const.mjs +5 -0
- package/_mjs/data/Const.mjs.map +1 -0
- package/_mjs/data/Duration/api.mjs +70 -0
- package/_mjs/data/Duration/api.mjs.map +1 -0
- package/_mjs/data/Duration/definition.mjs +29 -0
- package/_mjs/data/Duration/definition.mjs.map +1 -0
- package/_mjs/data/Duration.mjs +4 -0
- package/_mjs/data/Duration.mjs.map +1 -0
- package/_mjs/data/Either/api/align.mjs +6 -0
- package/_mjs/data/Either/api/align.mjs.map +1 -0
- package/_mjs/data/Either/api/alignWith.mjs +16 -0
- package/_mjs/data/Either/api/alignWith.mjs.map +1 -0
- package/_mjs/data/Either/api.mjs +211 -0
- package/_mjs/data/Either/api.mjs.map +1 -0
- package/_mjs/data/Either/constructors.mjs +70 -0
- package/_mjs/data/Either/constructors.mjs.map +1 -0
- package/_mjs/data/Either/definition.mjs +40 -0
- package/_mjs/data/Either/definition.mjs.map +1 -0
- package/_mjs/data/Either/destructors.mjs +17 -0
- package/_mjs/data/Either/destructors.mjs.map +1 -0
- package/_mjs/data/Either/instances.mjs +66 -0
- package/_mjs/data/Either/instances.mjs.map +1 -0
- package/_mjs/data/Either.mjs +7 -0
- package/_mjs/data/Either.mjs.map +1 -0
- package/_mjs/data/Environment/api.mjs +87 -0
- package/_mjs/data/Environment/api.mjs.map +1 -0
- package/_mjs/data/Environment/definition.mjs +38 -0
- package/_mjs/data/Environment/definition.mjs.map +1 -0
- package/_mjs/data/Environment.mjs +4 -0
- package/_mjs/data/Environment.mjs.map +1 -0
- package/_mjs/data/ExecutionStrategy.mjs +57 -0
- package/_mjs/data/ExecutionStrategy.mjs.map +1 -0
- package/_mjs/data/Exit/api.mjs +206 -0
- package/_mjs/data/Exit/api.mjs.map +1 -0
- package/_mjs/data/Exit/constructors.mjs +65 -0
- package/_mjs/data/Exit/constructors.mjs.map +1 -0
- package/_mjs/data/Exit/definition.mjs +106 -0
- package/_mjs/data/Exit/definition.mjs.map +1 -0
- package/_mjs/data/Exit.mjs +5 -0
- package/_mjs/data/Exit.mjs.map +1 -0
- package/_mjs/data/FiberId/api.mjs +55 -0
- package/_mjs/data/FiberId/api.mjs.map +1 -0
- package/_mjs/data/FiberId/constructors.mjs +24 -0
- package/_mjs/data/FiberId/constructors.mjs.map +1 -0
- package/_mjs/data/FiberId/definition.mjs +101 -0
- package/_mjs/data/FiberId/definition.mjs.map +1 -0
- package/_mjs/data/FiberId.mjs +5 -0
- package/_mjs/data/FiberId.mjs.map +1 -0
- package/_mjs/data/Identity/api.mjs +29 -0
- package/_mjs/data/Identity/api.mjs.map +1 -0
- package/_mjs/data/Identity/definition.mjs +2 -0
- package/_mjs/data/Identity/definition.mjs.map +1 -0
- package/_mjs/data/Identity/instances.mjs +32 -0
- package/_mjs/data/Identity/instances.mjs.map +1 -0
- package/_mjs/data/Identity.mjs +5 -0
- package/_mjs/data/Identity.mjs.map +1 -0
- package/_mjs/data/Maybe/api.mjs +206 -0
- package/_mjs/data/Maybe/api.mjs.map +1 -0
- package/_mjs/data/Maybe/constructors.mjs +92 -0
- package/_mjs/data/Maybe/constructors.mjs.map +1 -0
- package/_mjs/data/Maybe/definition.mjs +99 -0
- package/_mjs/data/Maybe/definition.mjs.map +1 -0
- package/_mjs/data/Maybe/destructors.mjs +12 -0
- package/_mjs/data/Maybe/destructors.mjs.map +1 -0
- package/_mjs/data/Maybe/instances.mjs +42 -0
- package/_mjs/data/Maybe/instances.mjs.map +1 -0
- package/_mjs/data/Maybe.mjs +7 -0
- package/_mjs/data/Maybe.mjs.map +1 -0
- package/_mjs/data/Newtype.mjs +11 -0
- package/_mjs/data/Newtype.mjs.map +1 -0
- package/_mjs/data/Patch/api.mjs +111 -0
- package/_mjs/data/Patch/api.mjs.map +1 -0
- package/_mjs/data/Patch/definition.mjs +61 -0
- package/_mjs/data/Patch/definition.mjs.map +1 -0
- package/_mjs/data/Patch.mjs +4 -0
- package/_mjs/data/Patch.mjs.map +1 -0
- package/_mjs/data/Predicate/api.mjs +28 -0
- package/_mjs/data/Predicate/api.mjs.map +1 -0
- package/_mjs/data/Predicate/definition.mjs +2 -0
- package/_mjs/data/Predicate/definition.mjs.map +1 -0
- package/_mjs/data/Predicate.mjs +4 -0
- package/_mjs/data/Predicate.mjs.map +1 -0
- package/_mjs/data/Refinement/api.mjs +30 -0
- package/_mjs/data/Refinement/api.mjs.map +1 -0
- package/_mjs/data/Refinement/definition.mjs +2 -0
- package/_mjs/data/Refinement/definition.mjs.map +1 -0
- package/_mjs/data/Refinement.mjs +4 -0
- package/_mjs/data/Refinement.mjs.map +1 -0
- package/_mjs/data/Struct/api.mjs +26 -0
- package/_mjs/data/Struct/api.mjs.map +1 -0
- package/_mjs/data/Struct/definition.mjs +3 -0
- package/_mjs/data/Struct/definition.mjs.map +1 -0
- package/_mjs/data/Tag/constructors.mjs +9 -0
- package/_mjs/data/Tag/constructors.mjs.map +1 -0
- package/_mjs/data/Tag/definition.mjs +36 -0
- package/_mjs/data/Tag/definition.mjs.map +1 -0
- package/_mjs/data/Tag.mjs +4 -0
- package/_mjs/data/Tag.mjs.map +1 -0
- package/_mjs/data/These/constructors.mjs +26 -0
- package/_mjs/data/These/constructors.mjs.map +1 -0
- package/_mjs/data/These/definition.mjs +46 -0
- package/_mjs/data/These/definition.mjs.map +1 -0
- package/_mjs/data/These/destructors.mjs +22 -0
- package/_mjs/data/These/destructors.mjs.map +1 -0
- package/_mjs/data/These.mjs +5 -0
- package/_mjs/data/These.mjs.map +1 -0
- package/_mjs/data/Trace/api.mjs +19 -0
- package/_mjs/data/Trace/api.mjs.map +1 -0
- package/_mjs/data/Trace/constructors.mjs +16 -0
- package/_mjs/data/Trace/constructors.mjs.map +1 -0
- package/_mjs/data/Trace/definition.mjs +12 -0
- package/_mjs/data/Trace/definition.mjs.map +1 -0
- package/_mjs/data/Trace.mjs +5 -0
- package/_mjs/data/Trace.mjs.map +1 -0
- package/_mjs/data/TraceElement/definition.mjs +62 -0
- package/_mjs/data/TraceElement/definition.mjs.map +1 -0
- package/_mjs/data/TraceElement.mjs +3 -0
- package/_mjs/data/TraceElement.mjs.map +1 -0
- package/_mjs/data/exceptions/ArrayIndexOutOfBoundsError.mjs +10 -0
- package/_mjs/data/exceptions/ArrayIndexOutOfBoundsError.mjs.map +1 -0
- package/_mjs/data/exceptions/IllegalArgumentError.mjs +11 -0
- package/_mjs/data/exceptions/IllegalArgumentError.mjs.map +1 -0
- package/_mjs/data/exceptions/IllegalStateError.mjs +10 -0
- package/_mjs/data/exceptions/IllegalStateError.mjs.map +1 -0
- package/_mjs/data/exceptions/IndexOutOfBoundsError.mjs +10 -0
- package/_mjs/data/exceptions/IndexOutOfBoundsError.mjs.map +1 -0
- package/_mjs/data/exceptions/InterruptedException.mjs +13 -0
- package/_mjs/data/exceptions/InterruptedException.mjs.map +1 -0
- package/_mjs/data/exceptions/InvalidCapacityError.mjs +12 -0
- package/_mjs/data/exceptions/InvalidCapacityError.mjs.map +1 -0
- package/_mjs/data/exceptions/NoSuchElementError.mjs +10 -0
- package/_mjs/data/exceptions/NoSuchElementError.mjs.map +1 -0
- package/_mjs/data/exceptions.mjs +9 -0
- package/_mjs/data/exceptions.mjs.map +1 -0
- package/_mjs/data/function/api.mjs +37 -0
- package/_mjs/data/function/api.mjs.map +1 -0
- package/_mjs/data/function/definition.mjs +2 -0
- package/_mjs/data/function/definition.mjs.map +1 -0
- package/_mjs/data/function/pipe.mjs +67 -0
- package/_mjs/data/function/pipe.mjs.map +1 -0
- package/_mjs/data/function.mjs +5 -0
- package/_mjs/data/function.mjs.map +1 -0
- package/_mjs/data/number/api.mjs +7 -0
- package/_mjs/data/number/api.mjs.map +1 -0
- package/_mjs/data/number/definition.mjs +2 -0
- package/_mjs/data/number/definition.mjs.map +1 -0
- package/_mjs/data/number/instances.mjs +20 -0
- package/_mjs/data/number/instances.mjs.map +1 -0
- package/_mjs/data/number.mjs +5 -0
- package/_mjs/data/number.mjs.map +1 -0
- package/_mjs/data/object/definition.mjs +2 -0
- package/_mjs/data/object/definition.mjs.map +1 -0
- package/_mjs/data/object.mjs +3 -0
- package/_mjs/data/object.mjs.map +1 -0
- package/_mjs/data/string/api.mjs +192 -0
- package/_mjs/data/string/api.mjs.map +1 -0
- package/_mjs/data/string/definition.mjs +2 -0
- package/_mjs/data/string/definition.mjs.map +1 -0
- package/_mjs/data/string/instances.mjs +36 -0
- package/_mjs/data/string/instances.mjs.map +1 -0
- package/_mjs/data/string.mjs +5 -0
- package/_mjs/data/string.mjs.map +1 -0
- package/_mjs/global/api.mjs +4 -0
- package/_mjs/global/api.mjs.map +1 -0
- package/_mjs/internal/AtomicBoolean.mjs +8 -0
- package/_mjs/internal/AtomicBoolean.mjs.map +1 -0
- package/_mjs/internal/AtomicNumber.mjs +26 -0
- package/_mjs/internal/AtomicNumber.mjs.map +1 -0
- package/_mjs/internal/AtomicReference.mjs +31 -0
- package/_mjs/internal/AtomicReference.mjs.map +1 -0
- package/_mjs/internal/Stack.mjs +56 -0
- package/_mjs/internal/Stack.mjs.map +1 -0
- package/_mjs/optics/At/api.mjs +12 -0
- package/_mjs/optics/At/api.mjs.map +1 -0
- package/_mjs/optics/At/definition.mjs +19 -0
- package/_mjs/optics/At/definition.mjs.map +1 -0
- package/_mjs/optics/At.mjs +4 -0
- package/_mjs/optics/At.mjs.map +1 -0
- package/_mjs/optics/Fold/definition.mjs +12 -0
- package/_mjs/optics/Fold/definition.mjs.map +1 -0
- package/_mjs/optics/Fold.mjs +3 -0
- package/_mjs/optics/Fold.mjs.map +1 -0
- package/_mjs/optics/Getter/definition.mjs +13 -0
- package/_mjs/optics/Getter/definition.mjs.map +1 -0
- package/_mjs/optics/Getter.mjs +3 -0
- package/_mjs/optics/Getter.mjs.map +1 -0
- package/_mjs/optics/Index/api.mjs +22 -0
- package/_mjs/optics/Index/api.mjs.map +1 -0
- package/_mjs/optics/Index/definition.mjs +11 -0
- package/_mjs/optics/Index/definition.mjs.map +1 -0
- package/_mjs/optics/Index.mjs +4 -0
- package/_mjs/optics/Index.mjs.map +1 -0
- package/_mjs/optics/Iso/api.mjs +13 -0
- package/_mjs/optics/Iso/api.mjs.map +1 -0
- package/_mjs/optics/Iso/definition.mjs +34 -0
- package/_mjs/optics/Iso/definition.mjs.map +1 -0
- package/_mjs/optics/Iso.mjs +4 -0
- package/_mjs/optics/Iso.mjs.map +1 -0
- package/_mjs/optics/Lens/api.mjs +140 -0
- package/_mjs/optics/Lens/api.mjs.map +1 -0
- package/_mjs/optics/Lens/definition.mjs +29 -0
- package/_mjs/optics/Lens/definition.mjs.map +1 -0
- package/_mjs/optics/Lens.mjs +4 -0
- package/_mjs/optics/Lens.mjs.map +1 -0
- package/_mjs/optics/Optional/api/compose.mjs +14 -0
- package/_mjs/optics/Optional/api/compose.mjs.map +1 -0
- package/_mjs/optics/Optional/definition.mjs +35 -0
- package/_mjs/optics/Optional/definition.mjs.map +1 -0
- package/_mjs/optics/Optional.mjs +6 -0
- package/_mjs/optics/Optional.mjs.map +1 -0
- package/_mjs/optics/Prism/api/compose.mjs +15 -0
- package/_mjs/optics/Prism/api/compose.mjs.map +1 -0
- package/_mjs/optics/Prism/api/fromNullable.mjs +14 -0
- package/_mjs/optics/Prism/api/fromNullable.mjs.map +1 -0
- package/_mjs/optics/Prism/api/just.mjs +15 -0
- package/_mjs/optics/Prism/api/just.mjs.map +1 -0
- package/_mjs/optics/Prism/definition.mjs +28 -0
- package/_mjs/optics/Prism/definition.mjs.map +1 -0
- package/_mjs/optics/Prism.mjs +8 -0
- package/_mjs/optics/Prism.mjs.map +1 -0
- package/_mjs/optics/Setter/definition.mjs +23 -0
- package/_mjs/optics/Setter/definition.mjs.map +1 -0
- package/_mjs/optics/Setter.mjs +3 -0
- package/_mjs/optics/Setter.mjs.map +1 -0
- package/_mjs/optics/Traversal/api/compose.mjs +11 -0
- package/_mjs/optics/Traversal/api/compose.mjs.map +1 -0
- package/_mjs/optics/Traversal/api/fromTraversable.mjs +10 -0
- package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -0
- package/_mjs/optics/Traversal/definition.mjs +33 -0
- package/_mjs/optics/Traversal/definition.mjs.map +1 -0
- package/_mjs/optics/Traversal.mjs +7 -0
- package/_mjs/optics/Traversal.mjs.map +1 -0
- package/_mjs/typeclass/Align.mjs +13 -0
- package/_mjs/typeclass/Align.mjs.map +1 -0
- package/_mjs/typeclass/Alt.mjs +10 -0
- package/_mjs/typeclass/Alt.mjs.map +1 -0
- package/_mjs/typeclass/Alternative.mjs +15 -0
- package/_mjs/typeclass/Alternative.mjs.map +1 -0
- package/_mjs/typeclass/Applicative.mjs +14 -0
- package/_mjs/typeclass/Applicative.mjs.map +1 -0
- package/_mjs/typeclass/ApplicativeExcept.mjs +33 -0
- package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -0
- package/_mjs/typeclass/Apply.mjs +114 -0
- package/_mjs/typeclass/Apply.mjs.map +1 -0
- package/_mjs/typeclass/Chain.mjs +18 -0
- package/_mjs/typeclass/Chain.mjs.map +1 -0
- package/_mjs/typeclass/Closure.mjs +12 -0
- package/_mjs/typeclass/Closure.mjs.map +1 -0
- package/_mjs/typeclass/Eq.mjs +12 -0
- package/_mjs/typeclass/Eq.mjs.map +1 -0
- package/_mjs/typeclass/Equatable/api.mjs +31 -0
- package/_mjs/typeclass/Equatable/api.mjs.map +1 -0
- package/_mjs/typeclass/Equatable/definition.mjs +12 -0
- package/_mjs/typeclass/Equatable/definition.mjs.map +1 -0
- package/_mjs/typeclass/Equatable/fast-equals.mjs +476 -0
- package/_mjs/typeclass/Equatable/fast-equals.mjs.map +1 -0
- package/_mjs/typeclass/Equatable.mjs +5 -0
- package/_mjs/typeclass/Equatable.mjs.map +1 -0
- package/_mjs/typeclass/Fail.mjs +11 -0
- package/_mjs/typeclass/Fail.mjs.map +1 -0
- package/_mjs/typeclass/Filterable.mjs +16 -0
- package/_mjs/typeclass/Filterable.mjs.map +1 -0
- package/_mjs/typeclass/FilterableWithIndex.mjs +18 -0
- package/_mjs/typeclass/FilterableWithIndex.mjs.map +1 -0
- package/_mjs/typeclass/Foldable.mjs +19 -0
- package/_mjs/typeclass/Foldable.mjs.map +1 -0
- package/_mjs/typeclass/FoldableWithIndex.mjs +20 -0
- package/_mjs/typeclass/FoldableWithIndex.mjs.map +1 -0
- package/_mjs/typeclass/Functor.mjs +15 -0
- package/_mjs/typeclass/Functor.mjs.map +1 -0
- package/_mjs/typeclass/FunctorWithIndex.mjs +14 -0
- package/_mjs/typeclass/FunctorWithIndex.mjs.map +1 -0
- package/_mjs/typeclass/Has.mjs +10 -0
- package/_mjs/typeclass/Has.mjs.map +1 -0
- package/_mjs/typeclass/Hash.mjs +9 -0
- package/_mjs/typeclass/Hash.mjs.map +1 -0
- package/_mjs/typeclass/HashEq.mjs +32 -0
- package/_mjs/typeclass/HashEq.mjs.map +1 -0
- package/_mjs/typeclass/Hashable/definition.mjs +12 -0
- package/_mjs/typeclass/Hashable/definition.mjs.map +1 -0
- package/_mjs/typeclass/Hashable/hash.mjs +242 -0
- package/_mjs/typeclass/Hashable/hash.mjs.map +1 -0
- package/_mjs/typeclass/Hashable.mjs +4 -0
- package/_mjs/typeclass/Hashable.mjs.map +1 -0
- package/_mjs/typeclass/Monad.mjs +14 -0
- package/_mjs/typeclass/Monad.mjs.map +1 -0
- package/_mjs/typeclass/MonadExcept.mjs +17 -0
- package/_mjs/typeclass/MonadExcept.mjs.map +1 -0
- package/_mjs/typeclass/Monoid.mjs +12 -0
- package/_mjs/typeclass/Monoid.mjs.map +1 -0
- package/_mjs/typeclass/Nil.mjs +2 -0
- package/_mjs/typeclass/Nil.mjs.map +1 -0
- package/_mjs/typeclass/Ord/api/contramap.mjs +12 -0
- package/_mjs/typeclass/Ord/api/contramap.mjs.map +1 -0
- package/_mjs/typeclass/Ord/api/max.mjs +8 -0
- package/_mjs/typeclass/Ord/api/max.mjs.map +1 -0
- package/_mjs/typeclass/Ord/api/min.mjs +8 -0
- package/_mjs/typeclass/Ord/api/min.mjs.map +1 -0
- package/_mjs/typeclass/Ord/api.mjs +5 -0
- package/_mjs/typeclass/Ord/api.mjs.map +1 -0
- package/_mjs/typeclass/Ord/definition.mjs +13 -0
- package/_mjs/typeclass/Ord/definition.mjs.map +1 -0
- package/_mjs/typeclass/Ord/instances.mjs +34 -0
- package/_mjs/typeclass/Ord/instances.mjs.map +1 -0
- package/_mjs/typeclass/Ord.mjs +5 -0
- package/_mjs/typeclass/Ord.mjs.map +1 -0
- package/_mjs/typeclass/Ordering.mjs +42 -0
- package/_mjs/typeclass/Ordering.mjs.map +1 -0
- package/_mjs/typeclass/Pointed.mjs +10 -0
- package/_mjs/typeclass/Pointed.mjs.map +1 -0
- package/_mjs/typeclass/Semialign.mjs +84 -0
- package/_mjs/typeclass/Semialign.mjs.map +1 -0
- package/_mjs/typeclass/Semigroup/api.mjs +22 -0
- package/_mjs/typeclass/Semigroup/api.mjs.map +1 -0
- package/_mjs/typeclass/Semigroup/definition.mjs +8 -0
- package/_mjs/typeclass/Semigroup/definition.mjs.map +1 -0
- package/_mjs/typeclass/Semigroup.mjs +4 -0
- package/_mjs/typeclass/Semigroup.mjs.map +1 -0
- package/_mjs/typeclass/Semimonoidal.mjs +9 -0
- package/_mjs/typeclass/Semimonoidal.mjs.map +1 -0
- package/_mjs/typeclass/Showable/definition.mjs +13 -0
- package/_mjs/typeclass/Showable/definition.mjs.map +1 -0
- package/_mjs/typeclass/Showable/show.mjs +796 -0
- package/_mjs/typeclass/Showable/show.mjs.map +1 -0
- package/_mjs/typeclass/Showable/styles.mjs +22 -0
- package/_mjs/typeclass/Showable/styles.mjs.map +1 -0
- package/_mjs/typeclass/Showable/util.mjs +368 -0
- package/_mjs/typeclass/Showable/util.mjs.map +1 -0
- package/_mjs/typeclass/Showable.mjs +3 -0
- package/_mjs/typeclass/Showable.mjs.map +1 -0
- package/_mjs/typeclass/Traversable.mjs +32 -0
- package/_mjs/typeclass/Traversable.mjs.map +1 -0
- package/_mjs/typeclass/TraversableWithIndex.mjs +27 -0
- package/_mjs/typeclass/TraversableWithIndex.mjs.map +1 -0
- package/_mjs/typeclass/Witherable.mjs +40 -0
- package/_mjs/typeclass/Witherable.mjs.map +1 -0
- package/_mjs/typeclass/WitherableWithIndex.mjs +45 -0
- package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -0
- package/_mjs/typeclass/builtin/Symbol.mjs +2 -0
- package/_mjs/typeclass/builtin/Symbol.mjs.map +1 -0
- package/_mjs/typeclass/builtin.mjs +3 -0
- package/_mjs/typeclass/builtin.mjs.map +1 -0
- package/_mjs/typeclass.mjs +38 -0
- package/_mjs/typeclass.mjs.map +1 -0
- package/_mjs/types/extractions.mjs +2 -0
- package/_mjs/types/extractions.mjs.map +1 -0
- package/_mjs/types/test.mjs +2 -0
- package/_mjs/types/test.mjs.map +1 -0
- package/_mjs/types/utility.mjs +2 -0
- package/_mjs/types/utility.mjs.map +1 -0
- package/_mjs/types.mjs +5 -0
- package/_mjs/types.mjs.map +1 -0
- package/_mjs/util/AnsiFormat.mjs +244 -0
- package/_mjs/util/AnsiFormat.mjs.map +1 -0
- package/_mjs/util/PCGRandom.mjs +166 -0
- package/_mjs/util/PCGRandom.mjs.map +1 -0
- package/_mjs/util/assert.mjs +13 -0
- package/_mjs/util/assert.mjs.map +1 -0
- package/_mjs/util/pattern.mjs +9 -0
- package/_mjs/util/pattern.mjs.map +1 -0
- package/_mjs/util/predicates.mjs +93 -0
- package/_mjs/util/predicates.mjs.map +1 -0
- package/_mjs/util/rand/Random.mjs +92 -0
- package/_mjs/util/rand/Random.mjs.map +1 -0
- package/_mjs/util/rand/distribution/Distribution.mjs +2 -0
- package/_mjs/util/rand/distribution/Distribution.mjs.map +1 -0
- package/_mjs/util/rand/distribution/UniformArrayIntDistribution.mjs +26 -0
- package/_mjs/util/rand/distribution/UniformArrayIntDistribution.mjs.map +1 -0
- package/_mjs/util/rand/distribution/UniformBigIntDistribution.mjs +45 -0
- package/_mjs/util/rand/distribution/UniformBigIntDistribution.mjs.map +1 -0
- package/_mjs/util/rand/distribution/UniformIntDistribution.mjs +62 -0
- package/_mjs/util/rand/distribution/UniformIntDistribution.mjs.map +1 -0
- package/_mjs/util/rand/distribution/internals/ArrayInt.mjs +203 -0
- package/_mjs/util/rand/distribution/internals/ArrayInt.mjs.map +1 -0
- package/_mjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.mjs +37 -0
- package/_mjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.mjs.map +1 -0
- package/_mjs/util/rand/distribution/internals/UniformIntDistributionInternal.mjs +49 -0
- package/_mjs/util/rand/distribution/internals/UniformIntDistributionInternal.mjs.map +1 -0
- package/_mjs/util/rand/generator/MersenneTwister.mjs +106 -0
- package/_mjs/util/rand/generator/MersenneTwister.mjs.map +1 -0
- package/_mjs/util/rand/generator/RandomGenerator.mjs +17 -0
- package/_mjs/util/rand/generator/RandomGenerator.mjs.map +1 -0
- package/_mjs/util/rand.mjs +9 -0
- package/_mjs/util/rand.mjs.map +1 -0
- package/_src/collection/Iterable/api/traverseConc.ts +40 -0
- package/_src/collection/Iterable/api.ts +690 -0
- package/_src/collection/Iterable/constructors.ts +73 -0
- package/_src/collection/Iterable/definition.ts +15 -0
- package/_src/collection/Iterable.ts +5 -0
- package/_src/collection/compat/Array/api.ts +53 -0
- package/_src/collection/compat/Array/definition.ts +21 -0
- package/_src/collection/compat/Array.ts +4 -0
- package/_src/collection/compat/ArrayLike/api.ts +26 -0
- package/_src/collection/compat/ArrayLike/definition.ts +11 -0
- package/_src/collection/immutable/Conc/api/empty.ts +8 -0
- package/_src/collection/immutable/Conc/api/makeBy.ts +16 -0
- package/_src/collection/immutable/Conc/api/replicate.ts +6 -0
- package/_src/collection/immutable/Conc/api.ts +1146 -0
- package/_src/collection/immutable/Conc/constructors.ts +38 -0
- package/_src/collection/immutable/Conc/definition.ts +785 -0
- package/_src/collection/immutable/Conc.ts +11 -0
- package/_src/collection/immutable/Dictionary/api.ts +49 -0
- package/_src/collection/immutable/Dictionary/definition.ts +21 -0
- package/_src/collection/immutable/HashMap/api.ts +731 -0
- package/_src/collection/immutable/HashMap/definition.ts +128 -0
- package/_src/collection/immutable/HashMap/internal.ts +380 -0
- package/_src/collection/immutable/HashMap.ts +4 -0
- package/_src/collection/immutable/HashSet/api.ts +481 -0
- package/_src/collection/immutable/HashSet/definition.ts +402 -0
- package/_src/collection/immutable/HashSet.ts +4 -0
- package/_src/collection/immutable/ImmutableArray/api.ts +1519 -0
- package/_src/collection/immutable/ImmutableArray/constructors.ts +47 -0
- package/_src/collection/immutable/ImmutableArray/definition.ts +39 -0
- package/_src/collection/immutable/ImmutableArray/instances.ts +168 -0
- package/_src/collection/immutable/ImmutableArray.ts +6 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +513 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/constructors.ts +66 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +31 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/destructors.ts +41 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/instances.ts +115 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray.ts +7 -0
- package/_src/collection/immutable/List/api/foldLeft.ts +12 -0
- package/_src/collection/immutable/List/api/unsafeTail.ts +9 -0
- package/_src/collection/immutable/List/api.ts +354 -0
- package/_src/collection/immutable/List/constructors.ts +64 -0
- package/_src/collection/immutable/List/definition.ts +91 -0
- package/_src/collection/immutable/List.ts +10 -0
- package/_src/collection/immutable/Queue/api.ts +142 -0
- package/_src/collection/immutable/Queue/constructors.ts +16 -0
- package/_src/collection/immutable/Queue/definition.ts +34 -0
- package/_src/collection/immutable/Queue/guards.ts +8 -0
- package/_src/collection/immutable/Queue.ts +6 -0
- package/_src/collection/immutable/SortedMap/api.ts +540 -0
- package/_src/collection/immutable/SortedMap/definition.ts +17 -0
- package/_src/collection/immutable/SortedMap/internal.ts +358 -0
- package/_src/collection/immutable/SortedMap/iterator.ts +304 -0
- package/_src/collection/immutable/SortedMap/node.ts +21 -0
- package/_src/collection/immutable/SortedMap.ts +7 -0
- package/_src/collection/immutable/Vector/api.ts +1335 -0
- package/_src/collection/immutable/Vector/definition.ts +96 -0
- package/_src/collection/immutable/Vector/internal.ts +1438 -0
- package/_src/collection/immutable/Vector.ts +4 -0
- package/_src/collection/mutable/HashMap.ts +338 -0
- package/_src/collection/mutable/HashSet.ts +254 -0
- package/_src/collection/mutable/ListBuffer.ts +123 -0
- package/_src/collection/mutable/internal.ts +26 -0
- package/_src/control/Eval/api/sequenceArray.ts +6 -0
- package/_src/control/Eval/api.ts +93 -0
- package/_src/control/Eval/constructors.ts +30 -0
- package/_src/control/Eval/definition.ts +67 -0
- package/_src/control/Eval/instance.ts +31 -0
- package/_src/control/Eval/run.ts +41 -0
- package/_src/control/Eval.ts +7 -0
- package/_src/control/LazyValue.ts +24 -0
- package/_src/control/Z/api.ts +619 -0
- package/_src/control/Z/definition.ts +189 -0
- package/_src/control/Z/instances.ts +14 -0
- package/_src/control/Z/runtime.ts +291 -0
- package/_src/control/Z.ts +6 -0
- package/_src/data/Byte.ts +1 -0
- package/_src/data/CaseClass.ts +112 -0
- package/_src/data/Cause/api/fold.ts +104 -0
- package/_src/data/Cause/api/isEmpty.ts +46 -0
- package/_src/data/Cause/api/linearize.ts +16 -0
- package/_src/data/Cause/api/prettyPrint.ts +38 -0
- package/_src/data/Cause/api/unified.ts +67 -0
- package/_src/data/Cause/api.ts +984 -0
- package/_src/data/Cause/definition.ts +521 -0
- package/_src/data/Cause.ts +4 -0
- package/_src/data/Const/api.ts +16 -0
- package/_src/data/Const/definition.ts +11 -0
- package/_src/data/Const/instances.ts +34 -0
- package/_src/data/Const.ts +5 -0
- package/_src/data/Duration/api.ts +69 -0
- package/_src/data/Duration/definition.ts +25 -0
- package/_src/data/Duration.ts +4 -0
- package/_src/data/Either/api/align.ts +8 -0
- package/_src/data/Either/api/alignWith.ts +21 -0
- package/_src/data/Either/api.ts +200 -0
- package/_src/data/Either/constructors.ts +77 -0
- package/_src/data/Either/definition.ts +48 -0
- package/_src/data/Either/destructors.ts +13 -0
- package/_src/data/Either/instances.ts +80 -0
- package/_src/data/Either.ts +7 -0
- package/_src/data/Environment/api.ts +78 -0
- package/_src/data/Environment/definition.ts +32 -0
- package/_src/data/Environment.ts +4 -0
- package/_src/data/ExecutionStrategy.ts +81 -0
- package/_src/data/Exit/api.ts +172 -0
- package/_src/data/Exit/constructors.ts +55 -0
- package/_src/data/Exit/definition.ts +102 -0
- package/_src/data/Exit.ts +5 -0
- package/_src/data/FiberId/api.ts +45 -0
- package/_src/data/FiberId/constructors.ts +21 -0
- package/_src/data/FiberId/definition.ts +91 -0
- package/_src/data/FiberId.ts +5 -0
- package/_src/data/Identity/api.ts +28 -0
- package/_src/data/Identity/definition.ts +11 -0
- package/_src/data/Identity/instances.ts +21 -0
- package/_src/data/Identity.ts +5 -0
- package/_src/data/Maybe/api.ts +187 -0
- package/_src/data/Maybe/constructors.ts +84 -0
- package/_src/data/Maybe/definition.ts +91 -0
- package/_src/data/Maybe/destructors.ts +11 -0
- package/_src/data/Maybe/instances.ts +53 -0
- package/_src/data/Maybe.ts +7 -0
- package/_src/data/Newtype.ts +66 -0
- package/_src/data/Patch/api.ts +75 -0
- package/_src/data/Patch/definition.ts +58 -0
- package/_src/data/Patch.ts +4 -0
- package/_src/data/Predicate/api.ts +27 -0
- package/_src/data/Predicate/definition.ts +10 -0
- package/_src/data/Predicate.ts +4 -0
- package/_src/data/Refinement/api.ts +29 -0
- package/_src/data/Refinement/definition.ts +13 -0
- package/_src/data/Refinement.ts +4 -0
- package/_src/data/Struct/api.ts +22 -0
- package/_src/data/Struct/definition.ts +23 -0
- package/_src/data/Tag/constructors.ts +6 -0
- package/_src/data/Tag/definition.ts +31 -0
- package/_src/data/Tag.ts +4 -0
- package/_src/data/These/constructors.ts +25 -0
- package/_src/data/These/definition.ts +47 -0
- package/_src/data/These/destructors.ts +20 -0
- package/_src/data/These.ts +5 -0
- package/_src/data/Trace/api.ts +13 -0
- package/_src/data/Trace/constructors.ts +13 -0
- package/_src/data/Trace/definition.ts +9 -0
- package/_src/data/Trace.ts +5 -0
- package/_src/data/TraceElement/definition.ts +69 -0
- package/_src/data/TraceElement.ts +3 -0
- package/_src/data/exceptions/ArrayIndexOutOfBoundsError.ts +9 -0
- package/_src/data/exceptions/IllegalArgumentError.ts +9 -0
- package/_src/data/exceptions/IllegalStateError.ts +9 -0
- package/_src/data/exceptions/IndexOutOfBoundsError.ts +9 -0
- package/_src/data/exceptions/InterruptedException.ts +13 -0
- package/_src/data/exceptions/InvalidCapacityError.ts +12 -0
- package/_src/data/exceptions/NoSuchElementError.ts +9 -0
- package/_src/data/exceptions.ts +9 -0
- package/_src/data/function/api.ts +39 -0
- package/_src/data/function/definition.ts +31 -0
- package/_src/data/function/pipe.ts +301 -0
- package/_src/data/function.ts +5 -0
- package/_src/data/number/api.ts +6 -0
- package/_src/data/number/definition.ts +13 -0
- package/_src/data/number/instances.ts +15 -0
- package/_src/data/number.ts +5 -0
- package/_src/data/object/definition.ts +12 -0
- package/_src/data/object.ts +3 -0
- package/_src/data/string/api.ts +182 -0
- package/_src/data/string/definition.ts +13 -0
- package/_src/data/string/instances.ts +24 -0
- package/_src/data/string.ts +5 -0
- package/_src/global/api.ts +23 -0
- package/_src/internal/AtomicBoolean.ts +7 -0
- package/_src/internal/AtomicNumber.ts +28 -0
- package/_src/internal/AtomicReference.ts +28 -0
- package/_src/internal/Stack.ts +52 -0
- package/_src/optics/At/api.ts +10 -0
- package/_src/optics/At/definition.ts +32 -0
- package/_src/optics/At.ts +4 -0
- package/_src/optics/Fold/definition.ts +38 -0
- package/_src/optics/Fold.ts +3 -0
- package/_src/optics/Getter/definition.ts +34 -0
- package/_src/optics/Getter.ts +3 -0
- package/_src/optics/Index/api.ts +19 -0
- package/_src/optics/Index/definition.ts +24 -0
- package/_src/optics/Index.ts +4 -0
- package/_src/optics/Iso/api.ts +11 -0
- package/_src/optics/Iso/definition.ts +52 -0
- package/_src/optics/Iso.ts +4 -0
- package/_src/optics/Lens/api.ts +132 -0
- package/_src/optics/Lens/definition.ts +51 -0
- package/_src/optics/Lens.ts +4 -0
- package/_src/optics/Optional/api/compose.ts +15 -0
- package/_src/optics/Optional/definition.ts +90 -0
- package/_src/optics/Optional.ts +7 -0
- package/_src/optics/Prism/api/compose.ts +12 -0
- package/_src/optics/Prism/api/fromNullable.ts +12 -0
- package/_src/optics/Prism/api/just.ts +11 -0
- package/_src/optics/Prism/definition.ts +59 -0
- package/_src/optics/Prism.ts +9 -0
- package/_src/optics/Setter/definition.ts +66 -0
- package/_src/optics/Setter.ts +3 -0
- package/_src/optics/Traversal/api/compose.ts +13 -0
- package/_src/optics/Traversal/api/fromTraversable.ts +50 -0
- package/_src/optics/Traversal/definition.ts +73 -0
- package/_src/optics/Traversal.ts +8 -0
- package/_src/typeclass/Align.ts +28 -0
- package/_src/typeclass/Alt.ts +105 -0
- package/_src/typeclass/Alternative.ts +31 -0
- package/_src/typeclass/Applicative.ts +31 -0
- package/_src/typeclass/ApplicativeExcept.ts +226 -0
- package/_src/typeclass/Apply.ts +634 -0
- package/_src/typeclass/Chain.ts +226 -0
- package/_src/typeclass/Closure.ts +36 -0
- package/_src/typeclass/Eq.ts +36 -0
- package/_src/typeclass/Equatable/api.ts +34 -0
- package/_src/typeclass/Equatable/definition.ts +22 -0
- package/_src/typeclass/Equatable/fast-equals.ts +498 -0
- package/_src/typeclass/Equatable.ts +5 -0
- package/_src/typeclass/Fail.ts +40 -0
- package/_src/typeclass/Filterable.ts +139 -0
- package/_src/typeclass/FilterableWithIndex.ts +143 -0
- package/_src/typeclass/Foldable.ts +73 -0
- package/_src/typeclass/FoldableWithIndex.ts +96 -0
- package/_src/typeclass/Functor.ts +76 -0
- package/_src/typeclass/FunctorWithIndex.ts +43 -0
- package/_src/typeclass/Has.ts +19 -0
- package/_src/typeclass/Hash.ts +17 -0
- package/_src/typeclass/HashEq.ts +44 -0
- package/_src/typeclass/Hashable/definition.ts +22 -0
- package/_src/typeclass/Hashable/hash.ts +208 -0
- package/_src/typeclass/Hashable.ts +4 -0
- package/_src/typeclass/Monad.ts +26 -0
- package/_src/typeclass/MonadExcept.ts +47 -0
- package/_src/typeclass/Monoid.ts +31 -0
- package/_src/typeclass/Nil.ts +23 -0
- package/_src/typeclass/Ord/api/contramap.ts +13 -0
- package/_src/typeclass/Ord/api/max.ts +9 -0
- package/_src/typeclass/Ord/api/min.ts +9 -0
- package/_src/typeclass/Ord/api.ts +5 -0
- package/_src/typeclass/Ord/definition.ts +43 -0
- package/_src/typeclass/Ord/instances.ts +30 -0
- package/_src/typeclass/Ord.ts +5 -0
- package/_src/typeclass/Ordering.ts +42 -0
- package/_src/typeclass/Pointed.ts +37 -0
- package/_src/typeclass/Semialign.ts +551 -0
- package/_src/typeclass/Semigroup/api.ts +21 -0
- package/_src/typeclass/Semigroup/definition.ts +24 -0
- package/_src/typeclass/Semigroup.ts +4 -0
- package/_src/typeclass/Semimonoidal.ts +97 -0
- package/_src/typeclass/Showable/definition.ts +23 -0
- package/_src/typeclass/Showable/show.ts +914 -0
- package/_src/typeclass/Showable/styles.ts +57 -0
- package/_src/typeclass/Showable/util.ts +385 -0
- package/_src/typeclass/Showable.ts +2 -0
- package/_src/typeclass/Traversable.ts +177 -0
- package/_src/typeclass/TraversableWithIndex.ts +142 -0
- package/_src/typeclass/Witherable.ts +303 -0
- package/_src/typeclass/WitherableWithIndex.ts +359 -0
- package/_src/typeclass/builtin/Symbol.ts +8 -0
- package/_src/typeclass/builtin.ts +3 -0
- package/_src/typeclass.ts +38 -0
- package/_src/types/extractions.ts +11 -0
- package/_src/types/test.ts +0 -0
- package/_src/types/utility.ts +9 -0
- package/_src/types.ts +5 -0
- package/_src/util/AnsiFormat.ts +259 -0
- package/_src/util/PCGRandom.ts +191 -0
- package/_src/util/assert.ts +11 -0
- package/_src/util/pattern.ts +35 -0
- package/_src/util/predicates.ts +144 -0
- package/_src/util/rand/Random.ts +100 -0
- package/_src/util/rand/distribution/Distribution.ts +10 -0
- package/_src/util/rand/distribution/UniformArrayIntDistribution.ts +49 -0
- package/_src/util/rand/distribution/UniformBigIntDistribution.ts +62 -0
- package/_src/util/rand/distribution/UniformIntDistribution.ts +75 -0
- package/_src/util/rand/distribution/internals/ArrayInt.ts +200 -0
- package/_src/util/rand/distribution/internals/UniformArrayIntDistributionInternal.ts +43 -0
- package/_src/util/rand/distribution/internals/UniformIntDistributionInternal.ts +47 -0
- package/_src/util/rand/generator/MersenneTwister.ts +160 -0
- package/_src/util/rand/generator/RandomGenerator.ts +22 -0
- package/_src/util/rand.ts +20 -0
- package/collection/Iterable/api/traverseConc.d.ts +13 -0
- package/collection/Iterable/api.d.ts +172 -0
- package/collection/Iterable/constructors.d.ts +25 -0
- package/collection/Iterable/definition.d.ts +14 -0
- package/collection/Iterable.d.ts +3 -0
- package/collection/compat/Array/api.d.ts +32 -0
- package/collection/compat/Array/definition.d.ts +20 -0
- package/collection/compat/Array.d.ts +2 -0
- package/collection/compat/ArrayLike/api.d.ts +5 -0
- package/collection/compat/ArrayLike/definition.d.ts +13 -0
- package/collection/immutable/Conc/api/empty.d.ts +6 -0
- package/collection/immutable/Conc/api/makeBy.d.ts +7 -0
- package/collection/immutable/Conc/api/replicate.d.ts +6 -0
- package/collection/immutable/Conc/api.d.ts +368 -0
- package/collection/immutable/Conc/constructors.d.ts +27 -0
- package/collection/immutable/Conc/definition.d.ts +213 -0
- package/collection/immutable/Conc.d.ts +6 -0
- package/collection/immutable/Dictionary/api.d.ts +27 -0
- package/collection/immutable/Dictionary/definition.d.ts +19 -0
- package/collection/immutable/HashMap/api.d.ts +336 -0
- package/collection/immutable/HashMap/definition.d.ts +44 -0
- package/collection/immutable/HashMap/internal.d.ts +67 -0
- package/collection/immutable/HashMap.d.ts +2 -0
- package/collection/immutable/HashSet/api.d.ts +170 -0
- package/collection/immutable/HashSet/definition.d.ts +97 -0
- package/collection/immutable/HashSet.d.ts +2 -0
- package/collection/immutable/ImmutableArray/api.d.ts +680 -0
- package/collection/immutable/ImmutableArray/constructors.d.ts +32 -0
- package/collection/immutable/ImmutableArray/definition.d.ts +25 -0
- package/collection/immutable/ImmutableArray/instances.d.ts +18 -0
- package/collection/immutable/ImmutableArray.d.ts +4 -0
- package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +205 -0
- package/collection/immutable/ImmutableNonEmptyArray/constructors.d.ts +45 -0
- package/collection/immutable/ImmutableNonEmptyArray/definition.d.ts +28 -0
- package/collection/immutable/ImmutableNonEmptyArray/destructors.d.ts +32 -0
- package/collection/immutable/ImmutableNonEmptyArray/instances.d.ts +52 -0
- package/collection/immutable/ImmutableNonEmptyArray.d.ts +5 -0
- package/collection/immutable/List/api/foldLeft.d.ts +6 -0
- package/collection/immutable/List/api/unsafeTail.d.ts +6 -0
- package/collection/immutable/List/api.d.ts +100 -0
- package/collection/immutable/List/constructors.d.ts +27 -0
- package/collection/immutable/List/definition.d.ts +40 -0
- package/collection/immutable/List.d.ts +5 -0
- package/collection/immutable/Queue/api.d.ts +78 -0
- package/collection/immutable/Queue/constructors.d.ts +11 -0
- package/collection/immutable/Queue/definition.d.ts +12 -0
- package/collection/immutable/Queue/guards.d.ts +6 -0
- package/collection/immutable/Queue.d.ts +4 -0
- package/collection/immutable/SortedMap/api.d.ts +134 -0
- package/collection/immutable/SortedMap/definition.d.ts +13 -0
- package/collection/immutable/SortedMap/internal.d.ts +8 -0
- package/collection/immutable/SortedMap/iterator.d.ts +64 -0
- package/collection/immutable/SortedMap/node.d.ts +16 -0
- package/collection/immutable/SortedMap.d.ts +5 -0
- package/collection/immutable/Vector/api.d.ts +596 -0
- package/collection/immutable/Vector/definition.d.ts +66 -0
- package/collection/immutable/Vector/internal.d.ts +199 -0
- package/collection/immutable/Vector.d.ts +2 -0
- package/collection/mutable/HashMap.d.ts +55 -0
- package/collection/mutable/HashSet.d.ts +48 -0
- package/collection/mutable/ListBuffer.d.ts +19 -0
- package/collection/mutable/internal.d.ts +4 -0
- package/control/Eval/api/sequenceArray.d.ts +6 -0
- package/control/Eval/api.d.ts +53 -0
- package/control/Eval/constructors.d.ts +19 -0
- package/control/Eval/definition.d.ts +59 -0
- package/control/Eval/instance.d.ts +17 -0
- package/control/Eval/run.d.ts +7 -0
- package/control/Eval.d.ts +5 -0
- package/control/LazyValue.d.ts +15 -0
- package/control/Z/api.d.ts +343 -0
- package/control/Z/definition.d.ts +135 -0
- package/control/Z/instances.d.ts +7 -0
- package/control/Z/runtime.d.ts +55 -0
- package/control/Z.d.ts +4 -0
- package/data/Byte.d.ts +1 -0
- package/data/CaseClass.d.ts +26 -0
- package/data/Cause/api/fold.d.ts +19 -0
- package/data/Cause/api/isEmpty.d.ts +7 -0
- package/data/Cause/api/linearize.d.ts +7 -0
- package/data/Cause/api/prettyPrint.d.ts +6 -0
- package/data/Cause/api/unified.d.ts +9 -0
- package/data/Cause/api.d.ts +283 -0
- package/data/Cause/definition.d.ts +130 -0
- package/data/Cause.d.ts +2 -0
- package/data/Const/api.d.ts +12 -0
- package/data/Const/definition.d.ts +12 -0
- package/data/Const/instances.d.ts +20 -0
- package/data/Const.d.ts +3 -0
- package/data/Duration/api.d.ts +52 -0
- package/data/Duration/definition.d.ts +16 -0
- package/data/Duration.d.ts +2 -0
- package/data/Either/api/align.d.ts +3 -0
- package/data/Either/api/alignWith.d.ts +7 -0
- package/data/Either/api.d.ts +128 -0
- package/data/Either/constructors.d.ts +50 -0
- package/data/Either/definition.d.ts +40 -0
- package/data/Either/destructors.d.ts +6 -0
- package/data/Either/instances.d.ts +21 -0
- package/data/Either.d.ts +5 -0
- package/data/Environment/api.d.ts +45 -0
- package/data/Environment/definition.d.ts +25 -0
- package/data/Environment.d.ts +2 -0
- package/data/ExecutionStrategy.d.ts +45 -0
- package/data/Exit/api.d.ts +99 -0
- package/data/Exit/constructors.d.ts +45 -0
- package/data/Exit/definition.d.ts +70 -0
- package/data/Exit.d.ts +3 -0
- package/data/FiberId/api.d.ts +17 -0
- package/data/FiberId/constructors.d.ts +17 -0
- package/data/FiberId/definition.d.ts +65 -0
- package/data/FiberId.d.ts +3 -0
- package/data/Identity/api.d.ts +22 -0
- package/data/Identity/definition.d.ts +10 -0
- package/data/Identity/instances.d.ts +21 -0
- package/data/Identity.d.ts +3 -0
- package/data/Maybe/api.d.ts +125 -0
- package/data/Maybe/constructors.d.ts +47 -0
- package/data/Maybe/definition.d.ts +59 -0
- package/data/Maybe/destructors.d.ts +8 -0
- package/data/Maybe/instances.d.ts +15 -0
- package/data/Maybe.d.ts +5 -0
- package/data/Newtype.d.ts +36 -0
- package/data/Patch/api.d.ts +24 -0
- package/data/Patch/definition.d.ts +44 -0
- package/data/Patch.d.ts +2 -0
- package/data/Predicate/api.d.ts +21 -0
- package/data/Predicate/definition.d.ts +9 -0
- package/data/Predicate.d.ts +2 -0
- package/data/Refinement/api.d.ts +23 -0
- package/data/Refinement/definition.d.ts +12 -0
- package/data/Refinement.d.ts +2 -0
- package/data/Struct/api.d.ts +12 -0
- package/data/Struct/definition.d.ts +19 -0
- package/data/Tag/constructors.d.ts +6 -0
- package/data/Tag/definition.d.ts +19 -0
- package/data/Tag.d.ts +2 -0
- package/data/These/constructors.d.ts +19 -0
- package/data/These/definition.d.ts +45 -0
- package/data/These/destructors.d.ts +6 -0
- package/data/These.d.ts +3 -0
- package/data/Trace/api.d.ts +12 -0
- package/data/Trace/constructors.d.ts +14 -0
- package/data/Trace/definition.d.ts +12 -0
- package/data/Trace.d.ts +3 -0
- package/data/TraceElement/definition.d.ts +39 -0
- package/data/TraceElement.d.ts +1 -0
- package/data/exceptions/ArrayIndexOutOfBoundsError.d.ts +5 -0
- package/data/exceptions/IllegalArgumentError.d.ts +6 -0
- package/data/exceptions/IllegalStateError.d.ts +5 -0
- package/data/exceptions/IndexOutOfBoundsError.d.ts +5 -0
- package/data/exceptions/InterruptedException.d.ts +8 -0
- package/data/exceptions/InvalidCapacityError.d.ts +5 -0
- package/data/exceptions/NoSuchElementError.d.ts +5 -0
- package/data/exceptions.d.ts +7 -0
- package/data/function/api.d.ts +27 -0
- package/data/function/definition.d.ts +30 -0
- package/data/function/pipe.d.ts +25 -0
- package/data/function.d.ts +3 -0
- package/data/number/api.d.ts +5 -0
- package/data/number/definition.d.ts +13 -0
- package/data/number/instances.d.ts +11 -0
- package/data/number.d.ts +3 -0
- package/data/object/definition.d.ts +13 -0
- package/data/object.d.ts +1 -0
- package/data/string/api.d.ts +145 -0
- package/data/string/definition.d.ts +13 -0
- package/data/string/instances.d.ts +21 -0
- package/data/string.d.ts +3 -0
- package/global/api.d.ts +8 -0
- package/internal/AtomicBoolean.d.ts +4 -0
- package/internal/AtomicNumber.d.ts +7 -0
- package/internal/AtomicReference.d.ts +9 -0
- package/internal/Stack.d.ts +28 -0
- package/optics/At/api.d.ts +7 -0
- package/optics/At/definition.d.ts +22 -0
- package/optics/At.d.ts +2 -0
- package/optics/Fold/definition.d.ts +28 -0
- package/optics/Fold.d.ts +1 -0
- package/optics/Getter/definition.d.ts +24 -0
- package/optics/Getter.d.ts +1 -0
- package/optics/Index/api.d.ts +14 -0
- package/optics/Index/definition.d.ts +19 -0
- package/optics/Index.d.ts +2 -0
- package/optics/Iso/api.d.ts +6 -0
- package/optics/Iso/definition.d.ts +40 -0
- package/optics/Iso.d.ts +2 -0
- package/optics/Lens/api.d.ts +49 -0
- package/optics/Lens/definition.d.ts +40 -0
- package/optics/Lens.d.ts +2 -0
- package/optics/Optional/api/compose.d.ts +6 -0
- package/optics/Optional/definition.d.ts +62 -0
- package/optics/Optional.d.ts +2 -0
- package/optics/Prism/api/compose.d.ts +6 -0
- package/optics/Prism/api/fromNullable.d.ts +6 -0
- package/optics/Prism/api/just.d.ts +7 -0
- package/optics/Prism/definition.d.ts +42 -0
- package/optics/Prism.d.ts +4 -0
- package/optics/Setter/definition.d.ts +51 -0
- package/optics/Setter.d.ts +1 -0
- package/optics/Traversal/api/compose.d.ts +6 -0
- package/optics/Traversal/api/fromTraversable.d.ts +8 -0
- package/optics/Traversal/definition.d.ts +46 -0
- package/optics/Traversal.d.ts +3 -0
- package/package.json +16 -0
- package/typeclass/Align.d.ts +21 -0
- package/typeclass/Alt.d.ts +30 -0
- package/typeclass/Alternative.d.ts +23 -0
- package/typeclass/Applicative.d.ts +20 -0
- package/typeclass/ApplicativeExcept.d.ts +60 -0
- package/typeclass/Apply.d.ts +103 -0
- package/typeclass/Chain.d.ts +39 -0
- package/typeclass/Closure.d.ts +27 -0
- package/typeclass/Eq.d.ts +27 -0
- package/typeclass/Equatable/api.d.ts +11 -0
- package/typeclass/Equatable/definition.d.ts +18 -0
- package/typeclass/Equatable/fast-equals.d.ts +202 -0
- package/typeclass/Equatable.d.ts +3 -0
- package/typeclass/Fail.d.ts +23 -0
- package/typeclass/Filterable.d.ts +68 -0
- package/typeclass/FilterableWithIndex.d.ts +67 -0
- package/typeclass/Foldable.d.ts +47 -0
- package/typeclass/FoldableWithIndex.d.ts +49 -0
- package/typeclass/Functor.d.ts +37 -0
- package/typeclass/FunctorWithIndex.d.ts +27 -0
- package/typeclass/Has.d.ts +16 -0
- package/typeclass/Hash.d.ts +14 -0
- package/typeclass/HashEq.d.ts +30 -0
- package/typeclass/Hashable/definition.d.ts +18 -0
- package/typeclass/Hashable/hash.d.ts +55 -0
- package/typeclass/Hashable.d.ts +2 -0
- package/typeclass/Monad.d.ts +19 -0
- package/typeclass/MonadExcept.d.ts +32 -0
- package/typeclass/Monoid.d.ts +22 -0
- package/typeclass/Nil.d.ts +13 -0
- package/typeclass/Ord/api/contramap.d.ts +6 -0
- package/typeclass/Ord/api/max.d.ts +7 -0
- package/typeclass/Ord/api/min.d.ts +7 -0
- package/typeclass/Ord/api.d.ts +3 -0
- package/typeclass/Ord/definition.d.ts +31 -0
- package/typeclass/Ord/instances.d.ts +13 -0
- package/typeclass/Ord.d.ts +3 -0
- package/typeclass/Ordering.d.ts +32 -0
- package/typeclass/Pointed.d.ts +21 -0
- package/typeclass/Semialign.d.ts +84 -0
- package/typeclass/Semigroup/api.d.ts +12 -0
- package/typeclass/Semigroup/definition.d.ts +20 -0
- package/typeclass/Semigroup.d.ts +2 -0
- package/typeclass/Semimonoidal.d.ts +25 -0
- package/typeclass/Showable/definition.d.ts +17 -0
- package/typeclass/Showable/show.d.ts +54 -0
- package/typeclass/Showable/styles.d.ts +8 -0
- package/typeclass/Showable/util.d.ts +38 -0
- package/typeclass/Showable.d.ts +2 -0
- package/typeclass/Traversable.d.ts +71 -0
- package/typeclass/TraversableWithIndex.d.ts +64 -0
- package/typeclass/Witherable.d.ts +98 -0
- package/typeclass/WitherableWithIndex.d.ts +114 -0
- package/typeclass/builtin/Symbol.d.ts +8 -0
- package/typeclass/builtin.d.ts +1 -0
- package/typeclass.d.ts +36 -0
- package/types/extractions.d.ts +12 -0
- package/types/test.d.ts +1 -0
- package/types/utility.d.ts +8 -0
- package/types.d.ts +3 -0
- package/util/AnsiFormat.d.ts +107 -0
- package/util/PCGRandom.d.ts +50 -0
- package/util/assert.d.ts +5 -0
- package/util/pattern.d.ts +68 -0
- package/util/predicates.d.ts +36 -0
- package/util/rand/Random.d.ts +69 -0
- package/util/rand/distribution/Distribution.d.ts +9 -0
- package/util/rand/distribution/UniformArrayIntDistribution.d.ts +23 -0
- package/util/rand/distribution/UniformBigIntDistribution.d.ts +22 -0
- package/util/rand/distribution/UniformIntDistribution.d.ts +22 -0
- package/util/rand/distribution/internals/ArrayInt.d.ts +57 -0
- package/util/rand/distribution/internals/UniformArrayIntDistributionInternal.d.ts +12 -0
- package/util/rand/distribution/internals/UniformIntDistributionInternal.d.ts +6 -0
- package/util/rand/generator/MersenneTwister.d.ts +11 -0
- package/util/rand/generator/RandomGenerator.d.ts +10 -0
- package/util/rand.d.ts +9 -0
@@ -0,0 +1,1438 @@
|
|
1
|
+
/* eslint-disable prefer-const */
|
2
|
+
/* eslint-disable no-var */
|
3
|
+
import type { MutableVector, Vector } from "@fncts/base/collection/immutable/Vector/definition";
|
4
|
+
|
5
|
+
/*
|
6
|
+
* -------------------------------------------------------------------------------------------------
|
7
|
+
* Internal
|
8
|
+
* -------------------------------------------------------------------------------------------------
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @internal
|
13
|
+
*/
|
14
|
+
export abstract class VectorIterator<A> implements Iterator<A> {
|
15
|
+
stack: any[][] | undefined;
|
16
|
+
indices: number[] | undefined;
|
17
|
+
idx: number;
|
18
|
+
prefixSize: number;
|
19
|
+
middleSize: number;
|
20
|
+
result: IteratorResult<A> = { done: false, value: undefined as any };
|
21
|
+
constructor(protected l: Vector<A>, direction: 1 | -1) {
|
22
|
+
this.idx = direction === 1 ? -1 : l.length;
|
23
|
+
this.prefixSize = getPrefixSize(l);
|
24
|
+
this.middleSize = l.length - getSuffixSize(l);
|
25
|
+
if (l.root !== undefined) {
|
26
|
+
const depth = getDepth(l);
|
27
|
+
this.stack = new Array(depth + 1);
|
28
|
+
this.indices = new Array(depth + 1);
|
29
|
+
let currentNode = l.root.array;
|
30
|
+
for (let i = depth; 0 <= i; --i) {
|
31
|
+
this.stack[i] = currentNode;
|
32
|
+
const idx = direction === 1 ? 0 : currentNode.length - 1;
|
33
|
+
this.indices[i] = idx;
|
34
|
+
currentNode = currentNode[idx].array;
|
35
|
+
}
|
36
|
+
this.indices[0] -= direction;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
abstract next(): IteratorResult<A>;
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @internal
|
44
|
+
*/
|
45
|
+
export class ForwardVectorIterator<A> extends VectorIterator<A> {
|
46
|
+
constructor(l: Vector<A>) {
|
47
|
+
super(l, 1);
|
48
|
+
}
|
49
|
+
nextInTree(): void {
|
50
|
+
for (var i = 0; ++this.indices![i] === this.stack![i]!.length; ++i) {
|
51
|
+
this.indices![i] = 0;
|
52
|
+
}
|
53
|
+
for (; 0 < i; --i) {
|
54
|
+
this.stack![i - 1] = this.stack![i]![this.indices![i]!].array;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
next(): IteratorResult<A> {
|
58
|
+
let newVal;
|
59
|
+
const idx = ++this.idx;
|
60
|
+
if (idx < this.prefixSize) {
|
61
|
+
newVal = this.l.prefix[this.prefixSize - idx - 1];
|
62
|
+
} else if (idx < this.middleSize) {
|
63
|
+
this.nextInTree();
|
64
|
+
newVal = this.stack![0]![this.indices![0]!];
|
65
|
+
} else if (idx < this.l.length) {
|
66
|
+
newVal = this.l.suffix[idx - this.middleSize];
|
67
|
+
} else {
|
68
|
+
this.result.done = true;
|
69
|
+
}
|
70
|
+
this.result.value = newVal;
|
71
|
+
return this.result;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
/**
|
76
|
+
* @internal
|
77
|
+
*/
|
78
|
+
export class BackwardVectorIterator<A> extends VectorIterator<A> {
|
79
|
+
constructor(l: Vector<A>) {
|
80
|
+
super(l, -1);
|
81
|
+
}
|
82
|
+
prevInTree(): void {
|
83
|
+
for (var i = 0; this.indices![i] === 0; ++i) {
|
84
|
+
//
|
85
|
+
}
|
86
|
+
--this.indices![i];
|
87
|
+
for (; 0 < i; --i) {
|
88
|
+
const n = this.stack![i]![this.indices![i]!].array;
|
89
|
+
this.stack![i - 1] = n;
|
90
|
+
this.indices![i - 1] = n.length - 1;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
next(): IteratorResult<A> {
|
94
|
+
let newVal;
|
95
|
+
const idx = --this.idx;
|
96
|
+
if (this.middleSize <= idx) {
|
97
|
+
newVal = this.l.suffix[idx - this.middleSize];
|
98
|
+
} else if (this.prefixSize <= idx) {
|
99
|
+
this.prevInTree();
|
100
|
+
newVal = this.stack![0]![this.indices![0]!];
|
101
|
+
} else if (0 <= idx) {
|
102
|
+
newVal = this.l.prefix[this.prefixSize - idx - 1];
|
103
|
+
} else {
|
104
|
+
this.result.done = true;
|
105
|
+
}
|
106
|
+
this.result.value = newVal;
|
107
|
+
return this.result;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
/**
|
112
|
+
* @internal
|
113
|
+
*/
|
114
|
+
const branchingFactor = 32;
|
115
|
+
|
116
|
+
/**
|
117
|
+
* @internal
|
118
|
+
*/
|
119
|
+
export const branchBits = 5;
|
120
|
+
|
121
|
+
/**
|
122
|
+
* @internal
|
123
|
+
*/
|
124
|
+
export const mask = 31;
|
125
|
+
|
126
|
+
/**
|
127
|
+
* @internal
|
128
|
+
*/
|
129
|
+
type Sizes = number[] | undefined;
|
130
|
+
|
131
|
+
/** @internal */
|
132
|
+
export class Node {
|
133
|
+
constructor(public sizes: Sizes, public array: any[]) {}
|
134
|
+
}
|
135
|
+
|
136
|
+
/**
|
137
|
+
* @internal
|
138
|
+
*/
|
139
|
+
function elementEquals(a: any, b: any): boolean {
|
140
|
+
return a === b;
|
141
|
+
}
|
142
|
+
|
143
|
+
/**
|
144
|
+
* @internal
|
145
|
+
*/
|
146
|
+
function createPath(depth: number, value: any): any {
|
147
|
+
let current = value;
|
148
|
+
for (let i = 0; i < depth; ++i) {
|
149
|
+
current = new Node(undefined, [current]);
|
150
|
+
}
|
151
|
+
return current;
|
152
|
+
}
|
153
|
+
|
154
|
+
// Array Helpers
|
155
|
+
|
156
|
+
/**
|
157
|
+
* @internal
|
158
|
+
*/
|
159
|
+
export function copyArray(source: any[]): any[] {
|
160
|
+
const array = [];
|
161
|
+
for (let i = 0; i < source.length; ++i) {
|
162
|
+
array[i] = source[i];
|
163
|
+
}
|
164
|
+
return array;
|
165
|
+
}
|
166
|
+
|
167
|
+
/**
|
168
|
+
* @internal
|
169
|
+
*/
|
170
|
+
function pushElements<A>(source: A[], target: A[], offset: number, amount: number): void {
|
171
|
+
for (let i = offset; i < offset + amount; ++i) {
|
172
|
+
target.push(source[i]!);
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
/**
|
177
|
+
* @internal
|
178
|
+
*/
|
179
|
+
function copyIndices(source: any[], sourceStart: number, target: any[], targetStart: number, length: number): void {
|
180
|
+
for (let i = 0; i < length; ++i) {
|
181
|
+
target[targetStart + i] = source[sourceStart + i];
|
182
|
+
}
|
183
|
+
}
|
184
|
+
|
185
|
+
/**
|
186
|
+
* @internal
|
187
|
+
*/
|
188
|
+
function arrayPrepend<A>(value: A, array: A[]): A[] {
|
189
|
+
const newLength = array.length + 1;
|
190
|
+
const result = new Array(newLength);
|
191
|
+
result[0] = value;
|
192
|
+
for (let i = 1; i < newLength; ++i) {
|
193
|
+
result[i] = array[i - 1];
|
194
|
+
}
|
195
|
+
return result;
|
196
|
+
}
|
197
|
+
|
198
|
+
/**
|
199
|
+
* Create a reverse _copy_ of an array.
|
200
|
+
* @internal
|
201
|
+
*/
|
202
|
+
export function reverseArray<A>(array: A[]): A[] {
|
203
|
+
return array.slice().reverse();
|
204
|
+
}
|
205
|
+
|
206
|
+
/**
|
207
|
+
* @internal
|
208
|
+
*/
|
209
|
+
function arrayFirst<A>(array: A[]): A {
|
210
|
+
return array[0]!;
|
211
|
+
}
|
212
|
+
|
213
|
+
/**
|
214
|
+
* @internal
|
215
|
+
*/
|
216
|
+
function arrayLast<A>(array: A[]): A {
|
217
|
+
return array[array.length - 1]!;
|
218
|
+
}
|
219
|
+
|
220
|
+
const pathResult = { path: 0, index: 0, updatedOffset: 0 };
|
221
|
+
type PathResult = typeof pathResult;
|
222
|
+
|
223
|
+
/**
|
224
|
+
* @internal
|
225
|
+
*/
|
226
|
+
function getPath(index: number, offset: number, depth: number, sizes: Sizes): PathResult {
|
227
|
+
let i = index;
|
228
|
+
if (sizes === undefined && offset !== 0) {
|
229
|
+
pathResult.updatedOffset = 0;
|
230
|
+
i = handleOffset(depth, offset, i);
|
231
|
+
}
|
232
|
+
let path = (i >> (depth * branchBits)) & mask;
|
233
|
+
if (sizes !== undefined) {
|
234
|
+
while (sizes[path]! <= i) {
|
235
|
+
path++;
|
236
|
+
}
|
237
|
+
const traversed = path === 0 ? 0 : sizes[path - 1]!;
|
238
|
+
i -= traversed;
|
239
|
+
pathResult.updatedOffset = offset;
|
240
|
+
}
|
241
|
+
pathResult.path = path;
|
242
|
+
pathResult.index = i;
|
243
|
+
return pathResult;
|
244
|
+
}
|
245
|
+
|
246
|
+
/**
|
247
|
+
* @internal
|
248
|
+
*/
|
249
|
+
export function updateNode(node: Node, depth: number, index: number, offset: number, value: any): Node {
|
250
|
+
const { path, index: newIndex, updatedOffset } = getPath(index, offset, depth, node.sizes);
|
251
|
+
|
252
|
+
const array = copyArray(node.array);
|
253
|
+
array[path] = depth > 0 ? updateNode(array[path], depth - 1, newIndex, updatedOffset, value) : value;
|
254
|
+
return new Node(node.sizes, array);
|
255
|
+
}
|
256
|
+
|
257
|
+
/**
|
258
|
+
* @internal
|
259
|
+
*/
|
260
|
+
function cloneNode({ sizes, array }: Node): Node {
|
261
|
+
return new Node(sizes === undefined ? undefined : copyArray(sizes), copyArray(array));
|
262
|
+
}
|
263
|
+
|
264
|
+
// This array should not be mutated. Thus a dummy element is placed in
|
265
|
+
// it. Thus the affix will not be owned and thus not mutated.
|
266
|
+
|
267
|
+
/**
|
268
|
+
* @internal
|
269
|
+
*/
|
270
|
+
export const emptyAffix: any[] = [0];
|
271
|
+
|
272
|
+
// We store a bit field in Vector. From right to left, the first five
|
273
|
+
// bits are suffix length, the next five are prefix length and the
|
274
|
+
// rest is depth. The functions below are for working with the bits in
|
275
|
+
// a sane way.
|
276
|
+
|
277
|
+
/**
|
278
|
+
* @internal
|
279
|
+
*/
|
280
|
+
const affixBits = 6;
|
281
|
+
|
282
|
+
/**
|
283
|
+
* @internal
|
284
|
+
*/
|
285
|
+
const affixMask = 0b111111;
|
286
|
+
|
287
|
+
/**
|
288
|
+
* @internal
|
289
|
+
*/
|
290
|
+
export function getSuffixSize(l: Vector<any>): number {
|
291
|
+
return l.bits & affixMask;
|
292
|
+
}
|
293
|
+
|
294
|
+
/**
|
295
|
+
* @internal
|
296
|
+
*/
|
297
|
+
export function getPrefixSize(l: Vector<any>): number {
|
298
|
+
return (l.bits >> affixBits) & affixMask;
|
299
|
+
}
|
300
|
+
|
301
|
+
/**
|
302
|
+
* @internal
|
303
|
+
*/
|
304
|
+
export function getDepth(l: Vector<any>): number {
|
305
|
+
return l.bits >> (affixBits * 2);
|
306
|
+
}
|
307
|
+
|
308
|
+
/**
|
309
|
+
* @internal
|
310
|
+
*/
|
311
|
+
export function setPrefix(size: number, bits: number): number {
|
312
|
+
return (size << affixBits) | (bits & ~(affixMask << affixBits));
|
313
|
+
}
|
314
|
+
|
315
|
+
/**
|
316
|
+
* @internal
|
317
|
+
*/
|
318
|
+
export function setSuffix(size: number, bits: number): number {
|
319
|
+
return size | (bits & ~affixMask);
|
320
|
+
}
|
321
|
+
|
322
|
+
/**
|
323
|
+
* @internal
|
324
|
+
*/
|
325
|
+
export function setDepth(depth: number, bits: number): number {
|
326
|
+
return (depth << (affixBits * 2)) | (bits & (affixMask | (affixMask << affixBits)));
|
327
|
+
}
|
328
|
+
|
329
|
+
/**
|
330
|
+
* @internal
|
331
|
+
*/
|
332
|
+
export function incrementPrefix(bits: number): number {
|
333
|
+
return bits + (1 << affixBits);
|
334
|
+
}
|
335
|
+
|
336
|
+
/**
|
337
|
+
* @internal
|
338
|
+
*/
|
339
|
+
export function incrementSuffix(bits: number): number {
|
340
|
+
return bits + 1;
|
341
|
+
}
|
342
|
+
|
343
|
+
/**
|
344
|
+
* @internal
|
345
|
+
*/
|
346
|
+
export function incrementDepth(bits: number): number {
|
347
|
+
return bits + (1 << (affixBits * 2));
|
348
|
+
}
|
349
|
+
|
350
|
+
/**
|
351
|
+
* @internal
|
352
|
+
*/
|
353
|
+
export function decrementDepth(bits: number): number {
|
354
|
+
return bits - (1 << (affixBits * 2));
|
355
|
+
}
|
356
|
+
|
357
|
+
/**
|
358
|
+
* Appends the value to the Vector by _mutating_ the Vector and its content.
|
359
|
+
*
|
360
|
+
* @tsplus fluent fncts.base.MutableVector push
|
361
|
+
*/
|
362
|
+
export function push<A>(l: MutableVector<A>, value: A): MutableVector<A> {
|
363
|
+
const suffixSize = getSuffixSize(l);
|
364
|
+
if (l.length === 0) {
|
365
|
+
l.bits = setPrefix(1, l.bits);
|
366
|
+
l.prefix = [value];
|
367
|
+
} else if (suffixSize < 32) {
|
368
|
+
l.bits = incrementSuffix(l.bits);
|
369
|
+
l.suffix.push(value);
|
370
|
+
} else if (l.root === undefined) {
|
371
|
+
l.root = new Node(undefined, l.suffix);
|
372
|
+
l.suffix = [value];
|
373
|
+
l.bits = setSuffix(1, l.bits);
|
374
|
+
} else {
|
375
|
+
const newNode = new Node(undefined, l.suffix);
|
376
|
+
const index = l.length - 1 - 32 + 1;
|
377
|
+
let current = l.root!;
|
378
|
+
let depth = getDepth(l);
|
379
|
+
l.suffix = [value];
|
380
|
+
l.bits = setSuffix(1, l.bits);
|
381
|
+
if (index - 1 < branchingFactor ** (depth + 1)) {
|
382
|
+
for (; depth >= 0; --depth) {
|
383
|
+
const path = (index >> (depth * branchBits)) & mask;
|
384
|
+
if (path < current.array.length) {
|
385
|
+
current = current.array[path];
|
386
|
+
} else {
|
387
|
+
current.array.push(createPath(depth - 1, newNode));
|
388
|
+
break;
|
389
|
+
}
|
390
|
+
}
|
391
|
+
} else {
|
392
|
+
l.bits = incrementDepth(l.bits);
|
393
|
+
l.root = new Node(undefined, [l.root, createPath(depth, newNode)]);
|
394
|
+
}
|
395
|
+
}
|
396
|
+
l.length++;
|
397
|
+
return l;
|
398
|
+
}
|
399
|
+
|
400
|
+
/**
|
401
|
+
* @internal
|
402
|
+
*/
|
403
|
+
export function nodeNthDense(node: Node, depth: number, index: number): any {
|
404
|
+
let current = node;
|
405
|
+
// eslint-disable-next-line no-param-reassign
|
406
|
+
for (; depth >= 0; --depth) {
|
407
|
+
current = current.array[(index >> (depth * branchBits)) & mask];
|
408
|
+
}
|
409
|
+
return current;
|
410
|
+
}
|
411
|
+
|
412
|
+
/**
|
413
|
+
* @internal
|
414
|
+
*/
|
415
|
+
export function handleOffset(depth: number, offset: number, index: number): number {
|
416
|
+
let i = index;
|
417
|
+
i += offset;
|
418
|
+
// eslint-disable-next-line no-param-reassign
|
419
|
+
for (; depth >= 0; --depth) {
|
420
|
+
i = index - (offset & (mask << (depth * branchBits)));
|
421
|
+
if (((index >> (depth * branchBits)) & mask) !== 0) {
|
422
|
+
break;
|
423
|
+
}
|
424
|
+
}
|
425
|
+
return i;
|
426
|
+
}
|
427
|
+
|
428
|
+
/**
|
429
|
+
* @internal
|
430
|
+
*/
|
431
|
+
export function nodeNth(node: Node, depth: number, offset: number, index: number): any {
|
432
|
+
let path;
|
433
|
+
let current = node;
|
434
|
+
let i = index;
|
435
|
+
let ofs = offset;
|
436
|
+
let dep = depth;
|
437
|
+
while (current.sizes !== undefined) {
|
438
|
+
path = (i >> (dep * branchBits)) & mask;
|
439
|
+
while (current.sizes[path]! <= i) {
|
440
|
+
path++;
|
441
|
+
}
|
442
|
+
if (path !== 0) {
|
443
|
+
i -= current.sizes[path - 1]!;
|
444
|
+
ofs = 0; // Offset is discarded if the left spine isn't traversed
|
445
|
+
}
|
446
|
+
dep--;
|
447
|
+
current = current.array[path];
|
448
|
+
}
|
449
|
+
return nodeNthDense(current, dep, ofs === 0 ? i : handleOffset(dep, ofs, i));
|
450
|
+
}
|
451
|
+
|
452
|
+
/**
|
453
|
+
* @internal
|
454
|
+
*/
|
455
|
+
export function setSizes(node: Node, height: number): Node {
|
456
|
+
let sum = 0;
|
457
|
+
const sizeTable = [];
|
458
|
+
for (let i = 0; i < node.array.length; ++i) {
|
459
|
+
sum += sizeOfSubtree(node.array[i], height - 1);
|
460
|
+
sizeTable[i] = sum;
|
461
|
+
}
|
462
|
+
node.sizes = sizeTable;
|
463
|
+
return node;
|
464
|
+
}
|
465
|
+
|
466
|
+
/**
|
467
|
+
* Returns the number of elements stored in the node.
|
468
|
+
*
|
469
|
+
* @internal
|
470
|
+
*/
|
471
|
+
function sizeOfSubtree(node: Node, height: number): number {
|
472
|
+
if (height !== 0) {
|
473
|
+
if (node.sizes !== undefined) {
|
474
|
+
return arrayLast(node.sizes);
|
475
|
+
} else {
|
476
|
+
// the node is leftwise dense so all all but the last child are full
|
477
|
+
const lastSize = sizeOfSubtree(arrayLast(node.array), height - 1);
|
478
|
+
return ((node.array.length - 1) << (height * branchBits)) + lastSize;
|
479
|
+
}
|
480
|
+
} else {
|
481
|
+
return node.array.length;
|
482
|
+
}
|
483
|
+
}
|
484
|
+
|
485
|
+
// prepend & append
|
486
|
+
|
487
|
+
/**
|
488
|
+
* @internal
|
489
|
+
*/
|
490
|
+
export function affixPush<A>(a: A, array: A[], length: number): A[] {
|
491
|
+
if (array.length === length) {
|
492
|
+
array.push(a);
|
493
|
+
return array;
|
494
|
+
} else {
|
495
|
+
const newArray: A[] = [];
|
496
|
+
copyIndices(array, 0, newArray, 0, length);
|
497
|
+
newArray.push(a);
|
498
|
+
return newArray;
|
499
|
+
}
|
500
|
+
}
|
501
|
+
|
502
|
+
/**
|
503
|
+
* Traverses down the left edge of the tree and copies k nodes.
|
504
|
+
* Returns the last copied node.
|
505
|
+
*
|
506
|
+
* @internal
|
507
|
+
*/
|
508
|
+
function copyLeft(l: MutableVector<any>, k: number): Node {
|
509
|
+
let currentNode = cloneNode(l.root!); // copy root
|
510
|
+
l.root = currentNode; // install copy of root
|
511
|
+
|
512
|
+
for (let i = 1; i < k; ++i) {
|
513
|
+
const index = 0; // go left
|
514
|
+
if (currentNode.sizes !== undefined) {
|
515
|
+
for (let i = 0; i < currentNode.sizes.length; ++i) {
|
516
|
+
currentNode.sizes[i] += 32;
|
517
|
+
}
|
518
|
+
}
|
519
|
+
const newNode = cloneNode(currentNode.array[index]);
|
520
|
+
// Install the copied node
|
521
|
+
currentNode.array[index] = newNode;
|
522
|
+
currentNode = newNode;
|
523
|
+
}
|
524
|
+
return currentNode;
|
525
|
+
}
|
526
|
+
|
527
|
+
/**
|
528
|
+
* Prepends an element to a node
|
529
|
+
*
|
530
|
+
* @internal
|
531
|
+
*/
|
532
|
+
function nodePrepend(value: any, size: number, node: Node): Node {
|
533
|
+
const array = arrayPrepend(value, node.array);
|
534
|
+
let sizes = undefined;
|
535
|
+
if (node.sizes !== undefined) {
|
536
|
+
sizes = new Array(node.sizes.length + 1);
|
537
|
+
sizes[0] = size;
|
538
|
+
for (let i = 0; i < node.sizes.length; ++i) {
|
539
|
+
sizes[i + 1] = node.sizes[i]! + size;
|
540
|
+
}
|
541
|
+
}
|
542
|
+
return new Node(sizes, array);
|
543
|
+
}
|
544
|
+
|
545
|
+
/**
|
546
|
+
* Prepends a node to a tree. Either by shifting the nodes in the root
|
547
|
+
* left or by increasing the height
|
548
|
+
*
|
549
|
+
* @internal
|
550
|
+
*/
|
551
|
+
function prependTopTree<A>(l: MutableVector<A>, depth: number, node: Node): number {
|
552
|
+
let newOffset;
|
553
|
+
if (l.root!.array.length < branchingFactor) {
|
554
|
+
// There is space in the root, there is never a size table in this
|
555
|
+
// case
|
556
|
+
newOffset = 32 ** depth - 32;
|
557
|
+
l.root = new Node(undefined, arrayPrepend(createPath(depth - 1, node), l.root!.array));
|
558
|
+
} else {
|
559
|
+
// We need to create a new root
|
560
|
+
l.bits = incrementDepth(l.bits);
|
561
|
+
const sizes = l.root!.sizes === undefined ? undefined : [32, arrayLast(l.root!.sizes!) + 32];
|
562
|
+
newOffset = depth === 0 ? 0 : 32 ** (depth + 1) - 32;
|
563
|
+
l.root = new Node(sizes, [createPath(depth, node), l.root]);
|
564
|
+
}
|
565
|
+
return newOffset;
|
566
|
+
}
|
567
|
+
|
568
|
+
/**
|
569
|
+
* Takes a Vector and a node tail. It then prepends the node to the tree
|
570
|
+
* of the Vector.
|
571
|
+
*
|
572
|
+
* @internal
|
573
|
+
*/
|
574
|
+
export function prependNodeToTree<A>(l: MutableVector<A>, array: A[]): Vector<A> {
|
575
|
+
if (l.root === undefined) {
|
576
|
+
if (getSuffixSize(l) === 0) {
|
577
|
+
// ensure invariant 1
|
578
|
+
l.bits = setSuffix(array.length, l.bits);
|
579
|
+
l.suffix = array;
|
580
|
+
} else {
|
581
|
+
l.root = new Node(undefined, array);
|
582
|
+
}
|
583
|
+
return l;
|
584
|
+
} else {
|
585
|
+
const node = new Node(undefined, array);
|
586
|
+
const depth = getDepth(l);
|
587
|
+
let newOffset = 0;
|
588
|
+
if (l.root.sizes === undefined) {
|
589
|
+
if (l.offset !== 0) {
|
590
|
+
newOffset = l.offset - branchingFactor;
|
591
|
+
l.root = prependDense(l.root, depth, l.offset, node);
|
592
|
+
} else {
|
593
|
+
// in this case we can be sure that the is not room in the tree
|
594
|
+
// for the new node
|
595
|
+
newOffset = prependTopTree(l, depth, node);
|
596
|
+
}
|
597
|
+
} else {
|
598
|
+
// represents how many nodes _with size-tables_ that we should copy.
|
599
|
+
let copyableCount = 0;
|
600
|
+
// go down while there is size tables
|
601
|
+
let nodesTraversed = 0;
|
602
|
+
let currentNode = l.root;
|
603
|
+
while (currentNode.sizes !== undefined && nodesTraversed < depth) {
|
604
|
+
++nodesTraversed;
|
605
|
+
if (currentNode.array.length < 32) {
|
606
|
+
// there is room if offset is > 0 or if the first node does not
|
607
|
+
// contain as many nodes as it possibly can
|
608
|
+
copyableCount = nodesTraversed;
|
609
|
+
}
|
610
|
+
currentNode = currentNode.array[0];
|
611
|
+
}
|
612
|
+
if (l.offset !== 0) {
|
613
|
+
const copiedNode = copyLeft(l, nodesTraversed);
|
614
|
+
for (let i = 0; i < copiedNode.sizes!.length; ++i) {
|
615
|
+
copiedNode.sizes![i] += branchingFactor;
|
616
|
+
}
|
617
|
+
copiedNode.array[0] = prependDense(copiedNode.array[0], depth - nodesTraversed, l.offset, node);
|
618
|
+
l.offset = l.offset - branchingFactor;
|
619
|
+
return l;
|
620
|
+
} else {
|
621
|
+
if (copyableCount === 0) {
|
622
|
+
l.offset = prependTopTree(l, depth, node);
|
623
|
+
} else {
|
624
|
+
let parent: Node | undefined;
|
625
|
+
let prependableNode: Node;
|
626
|
+
// Copy the part of the path with size tables
|
627
|
+
if (copyableCount > 1) {
|
628
|
+
parent = copyLeft(l, copyableCount - 1);
|
629
|
+
prependableNode = parent.array[0];
|
630
|
+
} else {
|
631
|
+
parent = undefined;
|
632
|
+
prependableNode = l.root!;
|
633
|
+
}
|
634
|
+
const path = createPath(depth - copyableCount, node);
|
635
|
+
// add offset
|
636
|
+
l.offset = 32 ** (depth - copyableCount + 1) - 32;
|
637
|
+
const prepended = nodePrepend(path, 32, prependableNode);
|
638
|
+
if (parent === undefined) {
|
639
|
+
l.root = prepended;
|
640
|
+
} else {
|
641
|
+
parent.array[0] = prepended;
|
642
|
+
}
|
643
|
+
}
|
644
|
+
return l;
|
645
|
+
}
|
646
|
+
}
|
647
|
+
l.offset = newOffset;
|
648
|
+
return l;
|
649
|
+
}
|
650
|
+
}
|
651
|
+
|
652
|
+
/**
|
653
|
+
* Prepends a node to a dense tree. The given `offset` is never zero.
|
654
|
+
*
|
655
|
+
* @internal
|
656
|
+
*/
|
657
|
+
function prependDense(node: Node, depth: number, offset: number, value: Node): Node {
|
658
|
+
// We're indexing down `offset - 1`. At each step `path` is either 0 or -1.
|
659
|
+
const curOffset = (offset >> (depth * branchBits)) & mask;
|
660
|
+
const path = (((offset - 1) >> (depth * branchBits)) & mask) - curOffset;
|
661
|
+
if (path < 0) {
|
662
|
+
return new Node(undefined, arrayPrepend(createPath(depth - 1, value), node.array));
|
663
|
+
} else {
|
664
|
+
const array = copyArray(node.array);
|
665
|
+
array[0] = prependDense(array[0], depth - 1, offset, value);
|
666
|
+
return new Node(undefined, array);
|
667
|
+
}
|
668
|
+
}
|
669
|
+
|
670
|
+
/**
|
671
|
+
* Takes a RRB-tree and an affix. It then appends the node to the
|
672
|
+
* tree.
|
673
|
+
*
|
674
|
+
* @internal
|
675
|
+
*/
|
676
|
+
export function appendNodeToTree<A>(l: MutableVector<A>, array: A[]): MutableVector<A> {
|
677
|
+
if (l.root === undefined) {
|
678
|
+
// The old Vector has no content in tree, all content is in affixes
|
679
|
+
if (getPrefixSize(l) === 0) {
|
680
|
+
l.bits = setPrefix(array.length, l.bits);
|
681
|
+
l.prefix = reverseArray(array);
|
682
|
+
} else {
|
683
|
+
l.root = new Node(undefined, array);
|
684
|
+
}
|
685
|
+
return l;
|
686
|
+
}
|
687
|
+
const depth = getDepth(l);
|
688
|
+
let index = handleOffset(depth, l.offset, l.length - 1 - getPrefixSize(l));
|
689
|
+
let nodesToCopy = 0;
|
690
|
+
let nodesVisited = 0;
|
691
|
+
let shift = depth * 5;
|
692
|
+
let currentNode = l.root;
|
693
|
+
if (32 ** (depth + 1) < index) {
|
694
|
+
shift = 0; // there is no room
|
695
|
+
nodesVisited = depth;
|
696
|
+
}
|
697
|
+
while (shift > 5) {
|
698
|
+
let childIndex: number;
|
699
|
+
if (currentNode.sizes === undefined) {
|
700
|
+
// does not have size table
|
701
|
+
childIndex = (index >> shift) & mask;
|
702
|
+
index &= ~(mask << shift); // wipe just used bits
|
703
|
+
} else {
|
704
|
+
childIndex = currentNode.array.length - 1;
|
705
|
+
index -= currentNode.sizes[childIndex - 1]!;
|
706
|
+
}
|
707
|
+
nodesVisited++;
|
708
|
+
if (childIndex < mask) {
|
709
|
+
// we are not going down the far right path, this implies that
|
710
|
+
// there is still room in the current node
|
711
|
+
nodesToCopy = nodesVisited;
|
712
|
+
}
|
713
|
+
currentNode = currentNode.array[childIndex];
|
714
|
+
if (currentNode === undefined) {
|
715
|
+
// This will only happened in a pvec subtree. The index does not
|
716
|
+
// exist so we'll have to create a new path from here on.
|
717
|
+
nodesToCopy = nodesVisited;
|
718
|
+
shift = 5; // Set shift to break out of the while-loop
|
719
|
+
}
|
720
|
+
shift -= 5;
|
721
|
+
}
|
722
|
+
|
723
|
+
if (shift !== 0) {
|
724
|
+
nodesVisited++;
|
725
|
+
if (currentNode.array.length < branchingFactor) {
|
726
|
+
// there is room in the found node
|
727
|
+
nodesToCopy = nodesVisited;
|
728
|
+
}
|
729
|
+
}
|
730
|
+
|
731
|
+
const node = new Node(undefined, array);
|
732
|
+
if (nodesToCopy === 0) {
|
733
|
+
// there was no room in the found node
|
734
|
+
const newPath = nodesVisited === 0 ? node : createPath(nodesVisited, node);
|
735
|
+
const newRoot = new Node(undefined, [l.root, newPath]);
|
736
|
+
l.root = newRoot;
|
737
|
+
l.bits = incrementDepth(l.bits);
|
738
|
+
} else {
|
739
|
+
const copiedNode = copyFirstK(l, nodesToCopy, array.length);
|
740
|
+
copiedNode.array.push(createPath(depth - nodesToCopy, node));
|
741
|
+
}
|
742
|
+
return l;
|
743
|
+
}
|
744
|
+
|
745
|
+
/**
|
746
|
+
* Traverses down the right edge of the tree and copies k nodes.
|
747
|
+
*
|
748
|
+
* @internal
|
749
|
+
*/
|
750
|
+
function copyFirstK(newVector: MutableVector<any>, k: number, leafSize: number): Node {
|
751
|
+
let currentNode = cloneNode(newVector.root!); // copy root
|
752
|
+
newVector.root = currentNode; // install root
|
753
|
+
|
754
|
+
for (let i = 1; i < k; ++i) {
|
755
|
+
const index = currentNode.array.length - 1;
|
756
|
+
if (currentNode.sizes !== undefined) {
|
757
|
+
currentNode.sizes[index] += leafSize;
|
758
|
+
}
|
759
|
+
const newNode = cloneNode(currentNode.array[index]);
|
760
|
+
// Install the copied node
|
761
|
+
currentNode.array[index] = newNode;
|
762
|
+
currentNode = newNode;
|
763
|
+
}
|
764
|
+
if (currentNode.sizes !== undefined) {
|
765
|
+
currentNode.sizes.push(arrayLast(currentNode.sizes) + leafSize);
|
766
|
+
}
|
767
|
+
return currentNode;
|
768
|
+
}
|
769
|
+
|
770
|
+
const eMax = 2;
|
771
|
+
|
772
|
+
/**
|
773
|
+
* @internal
|
774
|
+
*/
|
775
|
+
function createConcatPlan(array: Node[]): number[] | undefined {
|
776
|
+
const sizes: Array<number> = [];
|
777
|
+
let sum = 0;
|
778
|
+
for (let i = 0; i < array.length; ++i) {
|
779
|
+
sum += array[i]!.array.length; // FIXME: maybe only access array once
|
780
|
+
sizes[i] = array[i]!.array.length;
|
781
|
+
}
|
782
|
+
const optimalLength = Math.ceil(sum / branchingFactor);
|
783
|
+
let n = array.length;
|
784
|
+
let i = 0;
|
785
|
+
if (optimalLength + eMax >= n) {
|
786
|
+
return undefined; // no rebalancing needed
|
787
|
+
}
|
788
|
+
while (optimalLength + eMax < n) {
|
789
|
+
while (sizes[i]! > branchingFactor - eMax / 2) {
|
790
|
+
// Skip nodes that are already sufficiently balanced
|
791
|
+
++i;
|
792
|
+
}
|
793
|
+
// the node at this index is too short
|
794
|
+
let remaining = sizes[i]!; // number of elements to re-distribute
|
795
|
+
do {
|
796
|
+
const size = Math.min(remaining + sizes[i + 1]!, branchingFactor);
|
797
|
+
sizes[i] = size;
|
798
|
+
remaining = remaining - (size - sizes[i + 1]!);
|
799
|
+
++i;
|
800
|
+
} while (remaining > 0);
|
801
|
+
// Shift nodes after
|
802
|
+
for (let j = i; j <= n - 1; ++j) {
|
803
|
+
sizes[j] = sizes[j + 1]!;
|
804
|
+
}
|
805
|
+
--i;
|
806
|
+
--n;
|
807
|
+
}
|
808
|
+
sizes.length = n;
|
809
|
+
return sizes;
|
810
|
+
}
|
811
|
+
|
812
|
+
/**
|
813
|
+
* Combines the children of three nodes into an array. The last child
|
814
|
+
* of `left` and the first child of `right is ignored as they've been
|
815
|
+
* concatenated into `center`.
|
816
|
+
*
|
817
|
+
* @internal
|
818
|
+
*/
|
819
|
+
function concatNodeMerge(left: Node | undefined, center: Node, right: Node | undefined): Node[] {
|
820
|
+
const array = [];
|
821
|
+
if (left !== undefined) {
|
822
|
+
for (let i = 0; i < left.array.length - 1; ++i) {
|
823
|
+
array.push(left.array[i]);
|
824
|
+
}
|
825
|
+
}
|
826
|
+
for (let i = 0; i < center.array.length; ++i) {
|
827
|
+
array.push(center.array[i]);
|
828
|
+
}
|
829
|
+
if (right !== undefined) {
|
830
|
+
for (let i = 1; i < right.array.length; ++i) {
|
831
|
+
array.push(right.array[i]);
|
832
|
+
}
|
833
|
+
}
|
834
|
+
return array;
|
835
|
+
}
|
836
|
+
|
837
|
+
/**
|
838
|
+
* @internal
|
839
|
+
*/
|
840
|
+
function executeConcatPlan(merged: Node[], plan: number[], height: number): any[] {
|
841
|
+
const result = [];
|
842
|
+
let sourceIdx = 0; // the current node we're copying from
|
843
|
+
let offset = 0; // elements in source already used
|
844
|
+
for (let toMove of plan) {
|
845
|
+
let source = merged[sourceIdx]!.array;
|
846
|
+
if (toMove === source.length && offset === 0) {
|
847
|
+
// source matches target exactly, reuse source
|
848
|
+
result.push(merged[sourceIdx]);
|
849
|
+
++sourceIdx;
|
850
|
+
} else {
|
851
|
+
const node = new Node(undefined, []);
|
852
|
+
while (toMove > 0) {
|
853
|
+
const available = source.length - offset;
|
854
|
+
const itemsToCopy = Math.min(toMove, available);
|
855
|
+
pushElements(source, node.array, offset, itemsToCopy);
|
856
|
+
if (toMove >= available) {
|
857
|
+
++sourceIdx;
|
858
|
+
source = merged[sourceIdx]!.array;
|
859
|
+
offset = 0;
|
860
|
+
} else {
|
861
|
+
offset += itemsToCopy;
|
862
|
+
}
|
863
|
+
toMove -= itemsToCopy;
|
864
|
+
}
|
865
|
+
if (height > 1) {
|
866
|
+
// Set sizes on children unless they are leaf nodes
|
867
|
+
setSizes(node, height - 1);
|
868
|
+
}
|
869
|
+
result.push(node);
|
870
|
+
}
|
871
|
+
}
|
872
|
+
return result;
|
873
|
+
}
|
874
|
+
|
875
|
+
/**
|
876
|
+
* Takes three nodes and returns a new node with the content of the
|
877
|
+
* three nodes. Note: The returned node does not have its size table
|
878
|
+
* set correctly. The caller must do that.
|
879
|
+
*
|
880
|
+
* @internal
|
881
|
+
*/
|
882
|
+
function rebalance(left: Node | undefined, center: Node, right: Node | undefined, height: number, top: boolean): Node {
|
883
|
+
const merged = concatNodeMerge(left, center, right);
|
884
|
+
const plan = createConcatPlan(merged);
|
885
|
+
const balanced = plan !== undefined ? executeConcatPlan(merged, plan, height) : merged;
|
886
|
+
if (balanced.length <= branchingFactor) {
|
887
|
+
if (top === true) {
|
888
|
+
return new Node(undefined, balanced);
|
889
|
+
} else {
|
890
|
+
// Return a single node with extra height for balancing at next
|
891
|
+
// level
|
892
|
+
return new Node(undefined, [setSizes(new Node(undefined, balanced), height)]);
|
893
|
+
}
|
894
|
+
} else {
|
895
|
+
return new Node(undefined, [
|
896
|
+
setSizes(new Node(undefined, balanced.slice(0, branchingFactor)), height),
|
897
|
+
setSizes(new Node(undefined, balanced.slice(branchingFactor)), height),
|
898
|
+
]);
|
899
|
+
}
|
900
|
+
}
|
901
|
+
|
902
|
+
/**
|
903
|
+
* @internal
|
904
|
+
*/
|
905
|
+
export function concatSubTree<A>(left: Node, lDepth: number, right: Node, rDepth: number, isTop: boolean): Node {
|
906
|
+
if (lDepth > rDepth) {
|
907
|
+
const c = concatSubTree(arrayLast(left.array), lDepth - 1, right, rDepth, false);
|
908
|
+
return rebalance(left, c, undefined, lDepth, isTop);
|
909
|
+
} else if (lDepth < rDepth) {
|
910
|
+
const c = concatSubTree(left, lDepth, arrayFirst(right.array), rDepth - 1, false);
|
911
|
+
return rebalance(undefined, c, right, rDepth, isTop);
|
912
|
+
} else if (lDepth === 0) {
|
913
|
+
return new Node(undefined, [left, right]);
|
914
|
+
} else {
|
915
|
+
const c = concatSubTree<A>(arrayLast(left.array), lDepth - 1, arrayFirst(right.array), rDepth - 1, false);
|
916
|
+
return rebalance(left, c, right, lDepth, isTop);
|
917
|
+
}
|
918
|
+
}
|
919
|
+
|
920
|
+
/**
|
921
|
+
* @internal
|
922
|
+
*/
|
923
|
+
export const concatBuffer = new Array(3);
|
924
|
+
|
925
|
+
/**
|
926
|
+
* @internal
|
927
|
+
*/
|
928
|
+
export function concatAffixes<A>(left: Vector<A>, right: Vector<A>): number {
|
929
|
+
// TODO: Try and find a neat way to reduce the LOC here
|
930
|
+
let nr = 0;
|
931
|
+
let arrIdx = 0;
|
932
|
+
let i = 0;
|
933
|
+
let length = getSuffixSize(left);
|
934
|
+
concatBuffer[nr] = [];
|
935
|
+
for (i = 0; i < length; ++i) {
|
936
|
+
concatBuffer[nr][arrIdx++] = left.suffix[i];
|
937
|
+
}
|
938
|
+
length = getPrefixSize(right);
|
939
|
+
for (i = 0; i < length; ++i) {
|
940
|
+
if (arrIdx === 32) {
|
941
|
+
arrIdx = 0;
|
942
|
+
++nr;
|
943
|
+
concatBuffer[nr] = [];
|
944
|
+
}
|
945
|
+
concatBuffer[nr][arrIdx++] = right.prefix[length - 1 - i];
|
946
|
+
}
|
947
|
+
length = getSuffixSize(right);
|
948
|
+
for (i = 0; i < length; ++i) {
|
949
|
+
if (arrIdx === 32) {
|
950
|
+
arrIdx = 0;
|
951
|
+
++nr;
|
952
|
+
concatBuffer[nr] = [];
|
953
|
+
}
|
954
|
+
concatBuffer[nr][arrIdx++] = right.suffix[i];
|
955
|
+
}
|
956
|
+
return nr;
|
957
|
+
}
|
958
|
+
|
959
|
+
/**
|
960
|
+
* @internal
|
961
|
+
*/
|
962
|
+
export function getHeight(node: Node): number {
|
963
|
+
if (node.array[0] instanceof Node) {
|
964
|
+
return 1 + getHeight(node.array[0]);
|
965
|
+
} else {
|
966
|
+
return 0;
|
967
|
+
}
|
968
|
+
}
|
969
|
+
|
970
|
+
/**
|
971
|
+
* @internal
|
972
|
+
*/
|
973
|
+
export let newAffix: any[];
|
974
|
+
|
975
|
+
// function getBitsForDepth(n: number, depth: number): number {
|
976
|
+
// return n & ~(~0 << ((depth + 1) * branchBits));
|
977
|
+
// }
|
978
|
+
|
979
|
+
function sliceNode(
|
980
|
+
node: Node,
|
981
|
+
index: number,
|
982
|
+
depth: number,
|
983
|
+
pathLeft: number,
|
984
|
+
pathRight: number,
|
985
|
+
childLeft: Node | undefined,
|
986
|
+
childRight: Node | undefined,
|
987
|
+
): Node {
|
988
|
+
const array = node.array.slice(pathLeft, pathRight + 1);
|
989
|
+
if (childLeft !== undefined) {
|
990
|
+
array[0] = childLeft;
|
991
|
+
}
|
992
|
+
if (childRight !== undefined) {
|
993
|
+
array[array.length - 1] = childRight;
|
994
|
+
}
|
995
|
+
let sizes = node.sizes;
|
996
|
+
if (sizes !== undefined) {
|
997
|
+
sizes = sizes.slice(pathLeft, pathRight + 1);
|
998
|
+
let slicedOffLeft = pathLeft !== 0 ? node.sizes![pathLeft - 1]! : 0;
|
999
|
+
if (childLeft !== undefined) {
|
1000
|
+
// If the left child has been sliced into a new child we need to know
|
1001
|
+
// how many elements have been removed from the child.
|
1002
|
+
if (childLeft.sizes !== undefined) {
|
1003
|
+
// If the left child has a size table we can simply look at that.
|
1004
|
+
const oldChild: Node = node.array[pathLeft];
|
1005
|
+
slicedOffLeft += arrayLast(oldChild.sizes!) - arrayLast(childLeft.sizes);
|
1006
|
+
} else {
|
1007
|
+
// If the left child does not have a size table we can
|
1008
|
+
// calculate how many elements have been removed from it by
|
1009
|
+
// looking at the index. Note that when we slice into a leaf
|
1010
|
+
// the leaf is moved up as a prefix. Thus slicing, for
|
1011
|
+
// instance, at index 20 will remove 32 elements from the
|
1012
|
+
// child. Similarly slicing at index 50 will remove 64
|
1013
|
+
// elements at slicing at 64 will remove 92 elements.
|
1014
|
+
slicedOffLeft += ((index - slicedOffLeft) & ~0b011111) + 32;
|
1015
|
+
}
|
1016
|
+
}
|
1017
|
+
for (let i = 0; i < sizes.length; ++i) {
|
1018
|
+
sizes[i] -= slicedOffLeft;
|
1019
|
+
}
|
1020
|
+
if (childRight !== undefined) {
|
1021
|
+
const slicedOffRight = sizeOfSubtree(node.array[pathRight], depth - 1) - sizeOfSubtree(childRight, depth - 1);
|
1022
|
+
sizes[sizes.length - 1] -= slicedOffRight;
|
1023
|
+
}
|
1024
|
+
}
|
1025
|
+
return new Node(sizes, array);
|
1026
|
+
}
|
1027
|
+
|
1028
|
+
/**
|
1029
|
+
* @internal
|
1030
|
+
*/
|
1031
|
+
export let newOffset = 0;
|
1032
|
+
|
1033
|
+
export function sliceLeft(tree: Node, depth: number, index: number, offset: number, top: boolean): Node | undefined {
|
1034
|
+
let { index: newIndex, path, updatedOffset } = getPath(index, offset, depth, tree.sizes);
|
1035
|
+
if (depth === 0) {
|
1036
|
+
newAffix = tree.array.slice(path).reverse();
|
1037
|
+
// This leaf node is moved up as a suffix so there is nothing here
|
1038
|
+
// after slicing
|
1039
|
+
return undefined;
|
1040
|
+
} else {
|
1041
|
+
const child = sliceLeft(tree.array[path], depth - 1, newIndex, updatedOffset, false);
|
1042
|
+
if (child === undefined) {
|
1043
|
+
// There is nothing in the child after slicing so we don't include it
|
1044
|
+
++path;
|
1045
|
+
if (path === tree.array.length) {
|
1046
|
+
return undefined;
|
1047
|
+
}
|
1048
|
+
}
|
1049
|
+
// If we've sliced something away and it's not a the root, update offset
|
1050
|
+
if (tree.sizes === undefined && top === false) {
|
1051
|
+
newOffset |= (32 - (tree.array.length - path)) << (depth * branchBits);
|
1052
|
+
}
|
1053
|
+
return sliceNode(tree, index, depth, path, tree.array.length - 1, child, undefined);
|
1054
|
+
}
|
1055
|
+
}
|
1056
|
+
|
1057
|
+
/** Slice elements off of a tree from the right */
|
1058
|
+
export function sliceRight(node: Node, depth: number, index: number, offset: number): Node | undefined {
|
1059
|
+
let { index: newIndex, path } = getPath(index, offset, depth, node.sizes);
|
1060
|
+
if (depth === 0) {
|
1061
|
+
newAffix = node.array.slice(0, path + 1);
|
1062
|
+
// this leaf node is moved up as a suffix so there is nothing here
|
1063
|
+
// after slicing
|
1064
|
+
return undefined;
|
1065
|
+
} else {
|
1066
|
+
// slice the child, note that we subtract 1 then the radix lookup
|
1067
|
+
// algorithm can find the last element that we want to include
|
1068
|
+
// and sliceRight will do a slice that is inclusive on the index.
|
1069
|
+
const child = sliceRight(node.array[path], depth - 1, newIndex, path === 0 ? offset : 0);
|
1070
|
+
if (child === undefined) {
|
1071
|
+
// there is nothing in the child after slicing so we don't include it
|
1072
|
+
--path;
|
1073
|
+
if (path === -1) {
|
1074
|
+
return undefined;
|
1075
|
+
}
|
1076
|
+
}
|
1077
|
+
// note that we add 1 to the path since we want the slice to be
|
1078
|
+
// inclusive on the end index. Only at the leaf level do we want
|
1079
|
+
// to do an exclusive slice.
|
1080
|
+
const array = node.array.slice(0, path + 1);
|
1081
|
+
if (child !== undefined) {
|
1082
|
+
array[array.length - 1] = child;
|
1083
|
+
}
|
1084
|
+
let sizes: Sizes | undefined = node.sizes;
|
1085
|
+
if (sizes !== undefined) {
|
1086
|
+
sizes = sizes.slice(0, path + 1);
|
1087
|
+
if (child !== undefined) {
|
1088
|
+
const slicedOff = sizeOfSubtree(node.array[path], depth - 1) - sizeOfSubtree(child, depth - 1);
|
1089
|
+
sizes[sizes.length - 1] -= slicedOff;
|
1090
|
+
}
|
1091
|
+
}
|
1092
|
+
return new Node(sizes, array);
|
1093
|
+
}
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
export function sliceTreeVector<A>(
|
1097
|
+
from: number,
|
1098
|
+
to: number,
|
1099
|
+
tree: Node,
|
1100
|
+
depth: number,
|
1101
|
+
offset: number,
|
1102
|
+
l: MutableVector<A>,
|
1103
|
+
): Vector<A> {
|
1104
|
+
const sizes = tree.sizes;
|
1105
|
+
let { index: newFrom, path: pathLeft } = getPath(from, offset, depth, sizes);
|
1106
|
+
let { index: newTo, path: pathRight } = getPath(to, offset, depth, sizes);
|
1107
|
+
if (depth === 0) {
|
1108
|
+
// we are slicing a piece off a leaf node
|
1109
|
+
l.prefix = emptyAffix;
|
1110
|
+
l.suffix = tree.array.slice(pathLeft, pathRight + 1);
|
1111
|
+
l.root = undefined;
|
1112
|
+
l.bits = setSuffix(pathRight - pathLeft + 1, 0);
|
1113
|
+
return l;
|
1114
|
+
} else if (pathLeft === pathRight) {
|
1115
|
+
// Both ends are located in the same subtree, this means that we
|
1116
|
+
// can reduce the height
|
1117
|
+
l.bits = decrementDepth(l.bits);
|
1118
|
+
return sliceTreeVector(newFrom, newTo, tree.array[pathLeft], depth - 1, pathLeft === 0 ? offset : 0, l);
|
1119
|
+
} else {
|
1120
|
+
const childRight = sliceRight(tree.array[pathRight], depth - 1, newTo, 0);
|
1121
|
+
l.bits = setSuffix(newAffix.length, l.bits);
|
1122
|
+
l.suffix = newAffix;
|
1123
|
+
if (childRight === undefined) {
|
1124
|
+
--pathRight;
|
1125
|
+
}
|
1126
|
+
newOffset = 0;
|
1127
|
+
|
1128
|
+
const childLeft = sliceLeft(
|
1129
|
+
tree.array[pathLeft],
|
1130
|
+
depth - 1,
|
1131
|
+
newFrom,
|
1132
|
+
pathLeft === 0 ? offset : 0,
|
1133
|
+
pathLeft === pathRight,
|
1134
|
+
);
|
1135
|
+
l.offset = newOffset;
|
1136
|
+
l.bits = setPrefix(newAffix.length, l.bits);
|
1137
|
+
l.prefix = newAffix;
|
1138
|
+
|
1139
|
+
if (childLeft === undefined) {
|
1140
|
+
++pathLeft;
|
1141
|
+
}
|
1142
|
+
if (pathLeft >= pathRight) {
|
1143
|
+
if (pathLeft > pathRight) {
|
1144
|
+
// This only happens when `pathLeft` originally was equal to
|
1145
|
+
// `pathRight + 1` and `childLeft === childRight === undefined`.
|
1146
|
+
// In this case there is no tree left.
|
1147
|
+
l.bits = setDepth(0, l.bits);
|
1148
|
+
l.root = undefined;
|
1149
|
+
} else {
|
1150
|
+
// Height can be reduced
|
1151
|
+
l.bits = decrementDepth(l.bits);
|
1152
|
+
const newRoot =
|
1153
|
+
childRight !== undefined ? childRight : childLeft !== undefined ? childLeft : tree.array[pathLeft];
|
1154
|
+
l.root = new Node(newRoot.sizes, newRoot.array); // Is this size handling good enough?
|
1155
|
+
}
|
1156
|
+
} else {
|
1157
|
+
l.root = sliceNode(tree, from, depth, pathLeft, pathRight, childLeft, childRight);
|
1158
|
+
}
|
1159
|
+
return l;
|
1160
|
+
}
|
1161
|
+
}
|
1162
|
+
|
1163
|
+
/**
|
1164
|
+
* @internal
|
1165
|
+
*/
|
1166
|
+
export function zeroOffset(): void {
|
1167
|
+
newOffset = 0;
|
1168
|
+
}
|
1169
|
+
|
1170
|
+
type FoldCb<Input, State> = (input: Input, state: State, index: number) => boolean;
|
1171
|
+
|
1172
|
+
function foldLeftArrayCb<A, B>(
|
1173
|
+
cb: FoldCb<A, B>,
|
1174
|
+
state: B,
|
1175
|
+
array: A[],
|
1176
|
+
from: number,
|
1177
|
+
to: number,
|
1178
|
+
offset: number,
|
1179
|
+
): [boolean, number] {
|
1180
|
+
for (var i = from; i < to && cb(array[i]!, state, i + offset); ++i) {
|
1181
|
+
//
|
1182
|
+
}
|
1183
|
+
return [i === to, i + offset + 1];
|
1184
|
+
}
|
1185
|
+
|
1186
|
+
function foldRightArrayCb<A, B>(
|
1187
|
+
cb: FoldCb<A, B>,
|
1188
|
+
state: B,
|
1189
|
+
array: A[],
|
1190
|
+
from: number,
|
1191
|
+
to: number,
|
1192
|
+
offset: number,
|
1193
|
+
): [boolean, number] {
|
1194
|
+
// eslint-disable-next-line no-param-reassign
|
1195
|
+
for (var i = from - 1; to <= i && cb(array[i]!, state, offset); --i, offset--) {
|
1196
|
+
//
|
1197
|
+
}
|
1198
|
+
return [i === to - 1, offset];
|
1199
|
+
}
|
1200
|
+
|
1201
|
+
function foldLeftNodeCb<A, B>(
|
1202
|
+
cb: FoldCb<A, B>,
|
1203
|
+
state: B,
|
1204
|
+
node: Node,
|
1205
|
+
depth: number,
|
1206
|
+
offset: number,
|
1207
|
+
): [boolean, number] {
|
1208
|
+
const { array } = node;
|
1209
|
+
if (depth === 0) {
|
1210
|
+
return foldLeftArrayCb(cb, state, array, 0, array.length, offset);
|
1211
|
+
}
|
1212
|
+
const to = array.length;
|
1213
|
+
let j = offset;
|
1214
|
+
let cont;
|
1215
|
+
for (let i = 0; i < to; ++i) {
|
1216
|
+
[cont, j] = foldLeftNodeCb(cb, state, array[i], depth - 1, j);
|
1217
|
+
if (!cont) {
|
1218
|
+
return [false, j];
|
1219
|
+
}
|
1220
|
+
}
|
1221
|
+
return [true, j];
|
1222
|
+
}
|
1223
|
+
|
1224
|
+
/**
|
1225
|
+
* This function is a lot like a fold. But the reducer function is
|
1226
|
+
* supposed to mutate its state instead of returning it. Instead of
|
1227
|
+
* returning a new state it returns a boolean that tells wether or not
|
1228
|
+
* to continue the fold. `true` indicates that the folding should
|
1229
|
+
* continue.
|
1230
|
+
*/
|
1231
|
+
export function foldLeftCb<A, B>(cb: FoldCb<A, B>, state: B, l: Vector<A>): B {
|
1232
|
+
const prefixSize = getPrefixSize(l);
|
1233
|
+
let i = prefixSize - 1;
|
1234
|
+
let cont = true;
|
1235
|
+
[cont, i] = foldRightArrayCb(cb, state, l.prefix, prefixSize, 0, i);
|
1236
|
+
if (!cont) {
|
1237
|
+
return state;
|
1238
|
+
}
|
1239
|
+
i = prefixSize;
|
1240
|
+
if (l.root !== undefined) {
|
1241
|
+
[cont, i] = foldLeftNodeCb(cb, state, l.root, getDepth(l), i);
|
1242
|
+
if (!cont) {
|
1243
|
+
return state;
|
1244
|
+
}
|
1245
|
+
}
|
1246
|
+
const suffixSize = getSuffixSize(l);
|
1247
|
+
foldLeftArrayCb(cb, state, l.suffix, 0, suffixSize, i);
|
1248
|
+
return state;
|
1249
|
+
}
|
1250
|
+
|
1251
|
+
function foldRightNodeCb<A, B>(
|
1252
|
+
cb: FoldCb<A, B>,
|
1253
|
+
state: B,
|
1254
|
+
node: Node,
|
1255
|
+
depth: number,
|
1256
|
+
offset: number,
|
1257
|
+
): [boolean, number] {
|
1258
|
+
const { array } = node;
|
1259
|
+
if (depth === 0) {
|
1260
|
+
return foldRightArrayCb(cb, state, array, array.length, 0, offset);
|
1261
|
+
}
|
1262
|
+
let j = offset;
|
1263
|
+
let cont;
|
1264
|
+
for (let i = array.length - 1; 0 <= i; --i) {
|
1265
|
+
[cont, j] = foldRightNodeCb(cb, state, array[i], depth - 1, j);
|
1266
|
+
if (!cont) {
|
1267
|
+
return [false, j];
|
1268
|
+
}
|
1269
|
+
}
|
1270
|
+
return [true, j];
|
1271
|
+
}
|
1272
|
+
|
1273
|
+
export function foldRightCb<A, B>(cb: FoldCb<A, B>, state: B, l: Vector<A>): B {
|
1274
|
+
const suffixSize = getSuffixSize(l);
|
1275
|
+
const prefixSize = getPrefixSize(l);
|
1276
|
+
let i = l.length - 1;
|
1277
|
+
let cont = true;
|
1278
|
+
[cont, i] = foldRightArrayCb(cb, state, l.suffix, suffixSize, 0, i);
|
1279
|
+
if (!cont) {
|
1280
|
+
return state;
|
1281
|
+
}
|
1282
|
+
if (l.root !== undefined) {
|
1283
|
+
[cont, i] = foldRightNodeCb(cb, state, l.root, getDepth(l), i);
|
1284
|
+
if (!cont) {
|
1285
|
+
return state;
|
1286
|
+
}
|
1287
|
+
}
|
1288
|
+
const prefix = l.prefix;
|
1289
|
+
foldLeftArrayCb(cb, state, l.prefix, prefix.length - prefixSize, prefix.length, prefix.length - 1);
|
1290
|
+
return state;
|
1291
|
+
}
|
1292
|
+
|
1293
|
+
export function foldLeftPrefix<A, B>(f: (i: number, b: B, a: A) => B, b: B, array: A[], length: number): [B, number] {
|
1294
|
+
let acc = b;
|
1295
|
+
let j = 0;
|
1296
|
+
for (let i = length - 1; 0 <= i; --i, j++) {
|
1297
|
+
acc = f(j, acc, array[i]!);
|
1298
|
+
}
|
1299
|
+
return [acc, j];
|
1300
|
+
}
|
1301
|
+
|
1302
|
+
export function foldLeftNode<A, B>(
|
1303
|
+
f: (i: number, b: B, a: A) => B,
|
1304
|
+
b: B,
|
1305
|
+
node: Node,
|
1306
|
+
depth: number,
|
1307
|
+
offset: number,
|
1308
|
+
): [B, number] {
|
1309
|
+
const { array } = node;
|
1310
|
+
let acc = b;
|
1311
|
+
let j = offset;
|
1312
|
+
if (depth === 0) {
|
1313
|
+
return foldLeftSuffix(f, b, array, array.length, offset);
|
1314
|
+
}
|
1315
|
+
for (let i = 0; i < array.length; ++i) {
|
1316
|
+
[acc, j] = foldLeftNode(f, acc, array[i], depth - 1, j);
|
1317
|
+
}
|
1318
|
+
return [acc, j];
|
1319
|
+
}
|
1320
|
+
|
1321
|
+
export function foldLeftSuffix<A, B>(
|
1322
|
+
f: (i: number, b: B, a: A) => B,
|
1323
|
+
b: B,
|
1324
|
+
array: A[],
|
1325
|
+
length: number,
|
1326
|
+
offset: number,
|
1327
|
+
): [B, number] {
|
1328
|
+
let acc = b;
|
1329
|
+
let j = offset;
|
1330
|
+
for (let i = 0; i < length; ++i, j++) {
|
1331
|
+
acc = f(j, acc, array[i]!);
|
1332
|
+
}
|
1333
|
+
return [acc, j];
|
1334
|
+
}
|
1335
|
+
|
1336
|
+
export function foldRightPrefix<A, B>(
|
1337
|
+
f: (i: number, a: A, b: B) => B,
|
1338
|
+
b: B,
|
1339
|
+
array: A[],
|
1340
|
+
length: number,
|
1341
|
+
offset: number,
|
1342
|
+
): [B, number] {
|
1343
|
+
let acc = b;
|
1344
|
+
let j = offset;
|
1345
|
+
for (let i = 0; i < length; ++i, j--) {
|
1346
|
+
acc = f(j, array[i]!, acc);
|
1347
|
+
}
|
1348
|
+
return [acc, j];
|
1349
|
+
}
|
1350
|
+
|
1351
|
+
export function foldRightNode<A, B>(
|
1352
|
+
f: (i: number, a: A, b: B) => B,
|
1353
|
+
b: B,
|
1354
|
+
node: Node,
|
1355
|
+
depth: number,
|
1356
|
+
offset: number,
|
1357
|
+
): [B, number] {
|
1358
|
+
const { array } = node;
|
1359
|
+
let acc = b;
|
1360
|
+
let j = offset;
|
1361
|
+
if (depth === 0) {
|
1362
|
+
return foldRightSuffix(f, b, array, array.length, offset);
|
1363
|
+
}
|
1364
|
+
for (let i = array.length - 1; 0 <= i; --i) {
|
1365
|
+
[acc, j] = foldRightNode(f, acc, array[i], depth - 1, j);
|
1366
|
+
}
|
1367
|
+
return [acc, j];
|
1368
|
+
}
|
1369
|
+
|
1370
|
+
export function foldRightSuffix<A, B>(
|
1371
|
+
f: (i: number, a: A, b: B) => B,
|
1372
|
+
b: B,
|
1373
|
+
array: A[],
|
1374
|
+
length: number,
|
1375
|
+
offset: number,
|
1376
|
+
): [B, number] {
|
1377
|
+
let acc = b;
|
1378
|
+
let j = offset;
|
1379
|
+
for (let i = length - 1; 0 <= i; --i, j--) {
|
1380
|
+
acc = f(j, array[i]!, acc);
|
1381
|
+
}
|
1382
|
+
return [acc, j];
|
1383
|
+
}
|
1384
|
+
|
1385
|
+
function mapArray<A, B>(f: (i: number, a: A) => B, array: A[], offset: number): [B[], number] {
|
1386
|
+
const result = new Array(array.length);
|
1387
|
+
for (let i = 0; i < array.length; ++i) {
|
1388
|
+
result[i] = f(offset + i, array[i]!);
|
1389
|
+
}
|
1390
|
+
return [result, offset + array.length];
|
1391
|
+
}
|
1392
|
+
|
1393
|
+
export function mapNode<A, B>(
|
1394
|
+
f: (i: number, a: A) => B,
|
1395
|
+
node: Node,
|
1396
|
+
depth: number,
|
1397
|
+
offset: number,
|
1398
|
+
adjust: number,
|
1399
|
+
): [Node, number] {
|
1400
|
+
if (depth !== 0) {
|
1401
|
+
const { array } = node;
|
1402
|
+
let innerOffset = offset;
|
1403
|
+
const result = new Array(array.length);
|
1404
|
+
for (let i = 0; i < array.length; ++i) {
|
1405
|
+
const [res, newOffset] = mapNode(f, array[i], depth - 1, innerOffset, adjust * 32);
|
1406
|
+
innerOffset = newOffset;
|
1407
|
+
result[i] = res;
|
1408
|
+
}
|
1409
|
+
return [new Node(node.sizes, result), innerOffset];
|
1410
|
+
} else {
|
1411
|
+
const [res, newOffset] = mapArray(f, node.array, offset);
|
1412
|
+
return [new Node(undefined, res), newOffset];
|
1413
|
+
}
|
1414
|
+
}
|
1415
|
+
|
1416
|
+
export function mapPrefix<A, B>(f: (i: number, a: A) => B, prefix: A[], length: number): B[] {
|
1417
|
+
const newPrefix = new Array(length);
|
1418
|
+
for (let i = length - 1; 0 <= i; --i) {
|
1419
|
+
newPrefix[i] = f(length - 1 - i, prefix[i]!);
|
1420
|
+
}
|
1421
|
+
return newPrefix;
|
1422
|
+
}
|
1423
|
+
|
1424
|
+
export function mapAffix<A, B>(f: (i: number, a: A) => B, suffix: A[], length: number, totalLength: number): B[] {
|
1425
|
+
const priorLength = totalLength - length;
|
1426
|
+
const newSuffix = new Array(length);
|
1427
|
+
for (let i = 0; i < length; ++i) {
|
1428
|
+
newSuffix[i] = f(priorLength + i, suffix[i]!);
|
1429
|
+
}
|
1430
|
+
return newSuffix;
|
1431
|
+
}
|
1432
|
+
|
1433
|
+
// functions based on foldlCb
|
1434
|
+
|
1435
|
+
export function arrayPush<A>(array: A[], a: A): A[] {
|
1436
|
+
array.push(a);
|
1437
|
+
return array;
|
1438
|
+
}
|