@fncts/base 0.0.20 → 0.0.21
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 +8 -8
- package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -1
- package/_cjs/collection/Iterable/api.cjs +497 -444
- package/_cjs/collection/Iterable/api.cjs.map +1 -1
- package/_cjs/collection/Iterable/constructors.cjs +7 -7
- package/_cjs/collection/Iterable/constructors.cjs.map +1 -1
- package/_cjs/collection/compat/Array/api.cjs +16 -12
- package/_cjs/collection/compat/Array/api.cjs.map +1 -1
- package/_cjs/collection/compat/Array/derivations.cjs +41 -19
- package/_cjs/collection/compat/Array/derivations.cjs.map +1 -1
- package/_cjs/collection/compat/ArrayLike/api.cjs +1 -1
- package/_cjs/collection/compat/ArrayLike/api.cjs.map +1 -1
- package/_cjs/collection/compat/Record/instances.cjs +39 -3
- package/_cjs/collection/compat/Record/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/api/makeBy.cjs +1 -1
- package/_cjs/collection/immutable/Conc/api/makeBy.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/api.cjs +866 -765
- package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/definition.cjs +55 -53
- package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/derivations.cjs +13 -2
- package/_cjs/collection/immutable/Conc/derivations.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc.cjs.map +1 -1
- package/_cjs/collection/immutable/Dictionary/api.cjs +57 -44
- package/_cjs/collection/immutable/Dictionary/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/api.cjs +351 -258
- package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/definition.cjs +1 -1
- package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/internal.cjs.map +1 -1
- package/_cjs/collection/immutable/HashSet/api.cjs +230 -192
- package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashSet/definition.cjs +1 -1
- package/_cjs/collection/immutable/HashSet/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api/chunksOf.cjs +6 -4
- package/_cjs/collection/immutable/ImmutableArray/api/chunksOf.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api/slice.cjs +6 -4
- package/_cjs/collection/immutable/ImmutableArray/api/slice.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api/splitAt.cjs +6 -4
- package/_cjs/collection/immutable/ImmutableArray/api/splitAt.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api/splitWhere.cjs +15 -13
- package/_cjs/collection/immutable/ImmutableArray/api/splitWhere.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api.cjs +943 -749
- package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/derivations.cjs +12 -1
- package/_cjs/collection/immutable/ImmutableArray/derivations.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs +33 -33
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +338 -273
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs +15 -4
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs +2 -2
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs +12 -12
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/List/api/foldLeft.cjs +12 -10
- package/_cjs/collection/immutable/List/api/foldLeft.cjs.map +1 -1
- package/_cjs/collection/immutable/List/api.cjs +164 -141
- package/_cjs/collection/immutable/List/api.cjs.map +1 -1
- package/_cjs/collection/immutable/List.cjs.map +1 -1
- package/_cjs/collection/immutable/Queue/api.cjs +64 -48
- package/_cjs/collection/immutable/Queue/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Queue/definition.cjs +1 -1
- package/_cjs/collection/immutable/Queue/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/RoseTree/api.cjs +50 -36
- package/_cjs/collection/immutable/RoseTree/api.cjs.map +1 -1
- package/_cjs/collection/immutable/RoseTree/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/SortedMap/api.cjs +408 -368
- package/_cjs/collection/immutable/SortedMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/api.cjs +723 -608
- package/_cjs/collection/immutable/Vector/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/definition.cjs +18 -16
- package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/internal.cjs +40 -39
- package/_cjs/collection/immutable/Vector/internal.cjs.map +1 -1
- package/_cjs/collection/mutable/HashMap.cjs +3 -5
- package/_cjs/collection/mutable/HashMap.cjs.map +1 -1
- package/_cjs/collection/mutable/HashSet.cjs.map +1 -1
- package/_cjs/collection/mutable/ListBuffer.cjs +2 -2
- package/_cjs/collection/mutable/ListBuffer.cjs.map +1 -1
- package/_cjs/collection/mutable/internal.cjs +0 -2
- package/_cjs/collection/mutable/internal.cjs.map +1 -1
- package/_cjs/collection/weak/IterableWeakMap.cjs +7 -7
- package/_cjs/collection/weak/IterableWeakMap.cjs.map +1 -1
- package/_cjs/collection/weak/IterableWeakSet.cjs +7 -7
- package/_cjs/collection/weak/IterableWeakSet.cjs.map +1 -1
- package/_cjs/control/Eval/api.cjs +55 -43
- package/_cjs/control/Eval/api.cjs.map +1 -1
- package/_cjs/control/Eval/instance.cjs +4 -4
- package/_cjs/control/Eval/instance.cjs.map +1 -1
- package/_cjs/control/Eval/run.cjs +1 -1
- package/_cjs/control/Eval/run.cjs.map +1 -1
- package/_cjs/control/Z/api.cjs +241 -172
- package/_cjs/control/Z/api.cjs.map +1 -1
- package/_cjs/control/Z/instances.cjs +3 -3
- package/_cjs/control/Z/instances.cjs.map +1 -1
- package/_cjs/control/Z/runtime.cjs +250 -241
- package/_cjs/control/Z/runtime.cjs.map +1 -1
- package/_cjs/data/Branded/definition.cjs.map +1 -1
- package/_cjs/data/Branded/derivations.cjs +3 -3
- package/_cjs/data/Branded/derivations.cjs.map +1 -1
- package/_cjs/data/CaseClass.cjs.map +1 -1
- package/_cjs/data/Cause/api/fold.cjs +20 -18
- package/_cjs/data/Cause/api/fold.cjs.map +1 -1
- package/_cjs/data/Cause/api/isEmpty.cjs +1 -1
- package/_cjs/data/Cause/api/isEmpty.cjs.map +1 -1
- package/_cjs/data/Cause/api/linearize.cjs +8 -8
- package/_cjs/data/Cause/api/linearize.cjs.map +1 -1
- package/_cjs/data/Cause/api/prettyPrint.cjs +1 -1
- package/_cjs/data/Cause/api/prettyPrint.cjs.map +1 -1
- package/_cjs/data/Cause/api.cjs +160 -140
- package/_cjs/data/Cause/api.cjs.map +1 -1
- package/_cjs/data/Cause/definition.cjs +18 -18
- package/_cjs/data/Cause/definition.cjs.map +1 -1
- package/_cjs/data/Cause.cjs.map +1 -1
- package/_cjs/data/Const/api.cjs +8 -6
- package/_cjs/data/Const/api.cjs.map +1 -1
- package/_cjs/data/Const/instances.cjs +4 -4
- package/_cjs/data/Const/instances.cjs.map +1 -1
- package/_cjs/data/Datum/api.cjs +219 -176
- package/_cjs/data/Datum/api.cjs.map +1 -1
- package/_cjs/data/Datum/definition.cjs.map +1 -1
- package/_cjs/data/DatumEither/api.cjs +165 -133
- package/_cjs/data/DatumEither/api.cjs.map +1 -1
- package/_cjs/data/DecodeError/definition.cjs +14 -14
- package/_cjs/data/DecodeError/definition.cjs.map +1 -1
- package/_cjs/data/Decoder/api.cjs +9 -7
- package/_cjs/data/Decoder/api.cjs.map +1 -1
- package/_cjs/data/Duration/api.cjs +18 -12
- package/_cjs/data/Duration/api.cjs.map +1 -1
- package/_cjs/data/Either/api/align.cjs +8 -3
- package/_cjs/data/Either/api/align.cjs.map +1 -1
- package/_cjs/data/Either/api/alignWith.cjs +14 -12
- package/_cjs/data/Either/api/alignWith.cjs.map +1 -1
- package/_cjs/data/Either/api.cjs +206 -169
- package/_cjs/data/Either/api.cjs.map +1 -1
- package/_cjs/data/Either/constructors.cjs +11 -9
- package/_cjs/data/Either/constructors.cjs.map +1 -1
- package/_cjs/data/Either/destructors.cjs +16 -14
- package/_cjs/data/Either/destructors.cjs.map +1 -1
- package/_cjs/data/Either/instances.cjs +8 -8
- package/_cjs/data/Either/instances.cjs.map +1 -1
- package/_cjs/data/EitherT/api.cjs +8 -8
- package/_cjs/data/EitherT/api.cjs.map +1 -1
- package/_cjs/data/Encoder/api.cjs +134 -0
- package/_cjs/data/Encoder/api.cjs.map +1 -0
- package/_cjs/data/Encoder/definition.cjs +25 -0
- package/_cjs/data/Encoder/definition.cjs.map +1 -0
- package/_cjs/data/Encoder.cjs +32 -0
- package/_cjs/data/Encoder.cjs.map +1 -0
- package/_cjs/data/Environment/api.cjs +45 -33
- package/_cjs/data/Environment/api.cjs.map +1 -1
- package/_cjs/data/EnvironmentPatch.cjs +17 -13
- package/_cjs/data/EnvironmentPatch.cjs.map +1 -1
- package/_cjs/data/ExecutionStrategy.cjs +21 -29
- package/_cjs/data/ExecutionStrategy.cjs.map +1 -1
- package/_cjs/data/Exit/api.cjs +159 -127
- package/_cjs/data/Exit/api.cjs.map +1 -1
- package/_cjs/data/Exit/constructors.cjs +4 -4
- package/_cjs/data/Exit/constructors.cjs.map +1 -1
- package/_cjs/data/FiberId/api.cjs +23 -21
- package/_cjs/data/FiberId/api.cjs.map +1 -1
- package/_cjs/data/FiberId/constructors.cjs.map +1 -1
- package/_cjs/data/Identity/api.cjs +26 -18
- package/_cjs/data/Identity/api.cjs.map +1 -1
- package/_cjs/data/Identity/instances.cjs +3 -3
- package/_cjs/data/Identity/instances.cjs.map +1 -1
- package/_cjs/data/Interval.cjs +43 -33
- package/_cjs/data/Interval.cjs.map +1 -1
- package/_cjs/data/Intervals.cjs +35 -27
- package/_cjs/data/Intervals.cjs.map +1 -1
- package/_cjs/data/Maybe/api.cjs +160 -125
- package/_cjs/data/Maybe/api.cjs.map +1 -1
- package/_cjs/data/Maybe/constructors.cjs +2 -2
- package/_cjs/data/Maybe/constructors.cjs.map +1 -1
- package/_cjs/data/Maybe/definition.cjs.map +1 -1
- package/_cjs/data/Maybe/destructors.cjs +9 -7
- package/_cjs/data/Maybe/destructors.cjs.map +1 -1
- package/_cjs/data/Maybe/instances.cjs +11 -11
- package/_cjs/data/Maybe/instances.cjs.map +1 -1
- package/_cjs/data/Predicate/api.cjs +10 -8
- package/_cjs/data/Predicate/api.cjs.map +1 -1
- package/_cjs/data/Refinement/api.cjs +15 -9
- package/_cjs/data/Refinement/api.cjs.map +1 -1
- package/_cjs/data/Struct/api.cjs +62 -50
- package/_cjs/data/Struct/api.cjs.map +1 -1
- package/_cjs/data/Tag/constructors.cjs +3 -2
- package/_cjs/data/Tag/constructors.cjs.map +1 -1
- package/_cjs/data/Tag/definition.cjs +0 -3
- package/_cjs/data/Tag/definition.cjs.map +1 -1
- package/_cjs/data/These/api.cjs +188 -170
- package/_cjs/data/These/api.cjs.map +1 -1
- package/_cjs/data/These/constructors.cjs +1 -1
- package/_cjs/data/These/constructors.cjs.map +1 -1
- package/_cjs/data/These/destructors.cjs +39 -35
- package/_cjs/data/These/destructors.cjs.map +1 -1
- package/_cjs/data/These/instances.cjs +1 -1
- package/_cjs/data/These/instances.cjs.map +1 -1
- package/_cjs/data/Trace/api.cjs +7 -5
- package/_cjs/data/Trace/api.cjs.map +1 -1
- package/_cjs/data/Zipped.cjs.map +1 -1
- package/_cjs/data/function/api.cjs +6 -4
- package/_cjs/data/function/api.cjs.map +1 -1
- package/_cjs/data/function/pipe.cjs +9 -0
- package/_cjs/data/function/pipe.cjs.map +1 -1
- package/_cjs/data/string/api.cjs +53 -96
- package/_cjs/data/string/api.cjs.map +1 -1
- package/_cjs/global/api.cjs +4 -2
- package/_cjs/global/api.cjs.map +1 -1
- package/_cjs/internal/AtomicBoolean.cjs.map +1 -1
- package/_cjs/internal/AtomicNumber.cjs.map +1 -1
- package/_cjs/internal/AtomicReference.cjs.map +1 -1
- package/_cjs/internal/Stack.cjs +2 -2
- package/_cjs/internal/Stack.cjs.map +1 -1
- package/_cjs/optics/At/api.cjs +1 -1
- package/_cjs/optics/At/api.cjs.map +1 -1
- package/_cjs/optics/At/definition.cjs +2 -2
- package/_cjs/optics/At/definition.cjs.map +1 -1
- package/_cjs/optics/Fold/definition.cjs +3 -4
- package/_cjs/optics/Fold/definition.cjs.map +1 -1
- package/_cjs/optics/Getter/definition.cjs +2 -3
- package/_cjs/optics/Getter/definition.cjs.map +1 -1
- package/_cjs/optics/Index/api.cjs +4 -4
- package/_cjs/optics/Index/api.cjs.map +1 -1
- package/_cjs/optics/Index/definition.cjs +2 -2
- package/_cjs/optics/Index/definition.cjs.map +1 -1
- package/_cjs/optics/Iso/api.cjs +9 -7
- package/_cjs/optics/Iso/api.cjs.map +1 -1
- package/_cjs/optics/Iso/definition.cjs +12 -12
- package/_cjs/optics/Iso/definition.cjs.map +1 -1
- package/_cjs/optics/Lens/api.cjs +54 -44
- package/_cjs/optics/Lens/api.cjs.map +1 -1
- package/_cjs/optics/Lens/definition.cjs +10 -10
- package/_cjs/optics/Lens/definition.cjs.map +1 -1
- package/_cjs/optics/Optional/api/compose.cjs +9 -7
- package/_cjs/optics/Optional/api/compose.cjs.map +1 -1
- package/_cjs/optics/Optional/definition.cjs +12 -13
- package/_cjs/optics/Optional/definition.cjs.map +1 -1
- package/_cjs/optics/Optional.cjs.map +1 -1
- package/_cjs/optics/Prism/api/compose.cjs +9 -7
- package/_cjs/optics/Prism/api/compose.cjs.map +1 -1
- package/_cjs/optics/Prism/api/fromNullable.cjs +2 -2
- package/_cjs/optics/Prism/api/fromNullable.cjs.map +1 -1
- package/_cjs/optics/Prism/api/just.cjs +2 -2
- package/_cjs/optics/Prism/api/just.cjs.map +1 -1
- package/_cjs/optics/Prism/definition.cjs +9 -9
- package/_cjs/optics/Prism/definition.cjs.map +1 -1
- package/_cjs/optics/Prism.cjs.map +1 -1
- package/_cjs/optics/Setter/definition.cjs +8 -13
- package/_cjs/optics/Setter/definition.cjs.map +1 -1
- package/_cjs/optics/Traversal/api/compose.cjs +8 -6
- package/_cjs/optics/Traversal/api/compose.cjs.map +1 -1
- package/_cjs/optics/Traversal/api/fromTraversable.cjs +2 -2
- package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -1
- package/_cjs/optics/Traversal/definition.cjs +12 -12
- package/_cjs/optics/Traversal/definition.cjs.map +1 -1
- package/_cjs/optics/Traversal.cjs.map +1 -1
- package/_cjs/typeclass/Align.cjs.map +1 -1
- package/_cjs/typeclass/Alt.cjs.map +1 -1
- package/_cjs/typeclass/Applicative.cjs.map +1 -1
- package/_cjs/typeclass/ApplicativeExcept.cjs +5 -10
- package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -1
- package/_cjs/typeclass/Apply.cjs +8 -8
- package/_cjs/typeclass/Apply.cjs.map +1 -1
- package/_cjs/typeclass/Chain.cjs +4 -4
- package/_cjs/typeclass/Chain.cjs.map +1 -1
- package/_cjs/typeclass/Eq/definition.cjs.map +1 -1
- package/_cjs/typeclass/Eq/derivations.cjs.map +1 -1
- package/_cjs/typeclass/Equatable/api.cjs.map +1 -1
- package/_cjs/typeclass/Equatable/definition.cjs.map +1 -1
- package/_cjs/typeclass/Equatable/fast-equals.cjs.map +1 -1
- package/_cjs/typeclass/Filterable.cjs.map +1 -1
- package/_cjs/typeclass/FilterableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Foldable.cjs +1 -1
- package/_cjs/typeclass/Foldable.cjs.map +1 -1
- package/_cjs/typeclass/FoldableWithIndex.cjs +1 -1
- package/_cjs/typeclass/FoldableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Functor.cjs.map +1 -1
- package/_cjs/typeclass/FunctorWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Guard/api.cjs +18 -10
- package/_cjs/typeclass/Guard/api.cjs.map +1 -1
- package/_cjs/typeclass/Guard/definition.cjs.map +1 -1
- package/_cjs/typeclass/Guard/derivations.cjs.map +1 -1
- package/_cjs/typeclass/Has.cjs +7 -5
- package/_cjs/typeclass/Has.cjs.map +1 -1
- package/_cjs/typeclass/HashEq.cjs.map +1 -1
- package/_cjs/typeclass/Hashable/definition.cjs.map +1 -1
- package/_cjs/typeclass/Hashable/hash.cjs.map +1 -1
- package/_cjs/typeclass/MonadExcept.cjs +1 -1
- package/_cjs/typeclass/MonadExcept.cjs.map +1 -1
- package/_cjs/typeclass/Ord/api/contramap.cjs +7 -5
- package/_cjs/typeclass/Ord/api/contramap.cjs.map +1 -1
- package/_cjs/typeclass/Ord/api/max.cjs.map +1 -1
- package/_cjs/typeclass/Ord/api/min.cjs.map +1 -1
- package/_cjs/typeclass/Ord/definition.cjs.map +1 -1
- package/_cjs/typeclass/Ord/instances.cjs.map +1 -1
- package/_cjs/typeclass/Ordering.cjs.map +1 -1
- package/_cjs/typeclass/Semialign.cjs +7 -7
- package/_cjs/typeclass/Semialign.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/api.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/definition.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/derivations.cjs.map +1 -1
- package/_cjs/typeclass/Semimonoidal.cjs.map +1 -1
- package/_cjs/typeclass/Showable/definition.cjs.map +1 -1
- package/_cjs/typeclass/Showable/show.cjs +107 -107
- package/_cjs/typeclass/Showable/show.cjs.map +1 -1
- package/_cjs/typeclass/Showable/styles.cjs.map +1 -1
- package/_cjs/typeclass/Showable/util.cjs +1 -1
- package/_cjs/typeclass/Showable/util.cjs.map +1 -1
- package/_cjs/typeclass/Traversable.cjs +1 -2
- package/_cjs/typeclass/Traversable.cjs.map +1 -1
- package/_cjs/typeclass/TraversableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Witherable.cjs +3 -1
- package/_cjs/typeclass/Witherable.cjs.map +1 -1
- package/_cjs/typeclass/WitherableWithIndex.cjs +3 -1
- package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -1
- package/_cjs/util/AnsiFormat.cjs +11 -11
- package/_cjs/util/AnsiFormat.cjs.map +1 -1
- package/_cjs/util/PCGRandom.cjs.map +1 -1
- package/_cjs/util/assert.cjs.map +1 -1
- package/_cjs/util/pattern.cjs.map +1 -1
- package/_cjs/util/predicates.cjs.map +1 -1
- package/_cjs/util/rand/Random.cjs.map +1 -1
- package/_cjs/util/rand/distribution/UniformArrayIntDistribution.cjs.map +1 -1
- package/_cjs/util/rand/distribution/UniformBigIntDistribution.cjs.map +1 -1
- package/_cjs/util/rand/distribution/UniformIntDistribution.cjs.map +1 -1
- package/_cjs/util/rand/distribution/internals/ArrayInt.cjs.map +1 -1
- package/_cjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.cjs.map +1 -1
- package/_cjs/util/rand/distribution/internals/UniformIntDistributionInternal.cjs.map +1 -1
- package/_cjs/util/rand/generator/MersenneTwister.cjs.map +1 -1
- package/_cjs/util/rand/generator/RandomGenerator.cjs.map +1 -1
- package/_cjs/util/rand.cjs.map +1 -1
- package/_mjs/collection/Iterable/api/traverseConc.mjs +5 -5
- package/_mjs/collection/Iterable/api/traverseConc.mjs.map +1 -1
- package/_mjs/collection/Iterable/api.mjs +465 -411
- package/_mjs/collection/Iterable/api.mjs.map +1 -1
- package/_mjs/collection/Iterable/constructors.mjs +5 -5
- package/_mjs/collection/Iterable/constructors.mjs.map +1 -1
- package/_mjs/collection/compat/Array/api.mjs +16 -12
- package/_mjs/collection/compat/Array/api.mjs.map +1 -1
- package/_mjs/collection/compat/Array/derivations.mjs +35 -19
- package/_mjs/collection/compat/Array/derivations.mjs.map +1 -1
- package/_mjs/collection/compat/ArrayLike/api.mjs +1 -1
- package/_mjs/collection/compat/ArrayLike/api.mjs.map +1 -1
- package/_mjs/collection/compat/Record/instances.mjs +34 -3
- package/_mjs/collection/compat/Record/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/api/makeBy.mjs +1 -1
- package/_mjs/collection/immutable/Conc/api/makeBy.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/api.mjs +795 -697
- package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/definition.mjs +53 -51
- package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/derivations.mjs +10 -2
- package/_mjs/collection/immutable/Conc/derivations.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc.mjs.map +1 -1
- package/_mjs/collection/immutable/Dictionary/api.mjs +47 -35
- package/_mjs/collection/immutable/Dictionary/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/api.mjs +295 -217
- package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/definition.mjs +1 -1
- package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/internal.mjs.map +1 -1
- package/_mjs/collection/immutable/HashSet/api.mjs +206 -168
- package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashSet/definition.mjs +1 -1
- package/_mjs/collection/immutable/HashSet/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api/chunksOf.mjs +5 -3
- package/_mjs/collection/immutable/ImmutableArray/api/chunksOf.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api/slice.mjs +5 -3
- package/_mjs/collection/immutable/ImmutableArray/api/slice.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api/splitAt.mjs +5 -3
- package/_mjs/collection/immutable/ImmutableArray/api/splitAt.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api/splitWhere.mjs +13 -11
- package/_mjs/collection/immutable/ImmutableArray/api/splitWhere.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api.mjs +816 -629
- package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/derivations.mjs +9 -1
- package/_mjs/collection/immutable/ImmutableArray/derivations.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs +34 -34
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +301 -239
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs +12 -4
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs +2 -2
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs +13 -13
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/List/api/foldLeft.mjs +11 -9
- package/_mjs/collection/immutable/List/api/foldLeft.mjs.map +1 -1
- package/_mjs/collection/immutable/List/api.mjs +157 -133
- package/_mjs/collection/immutable/List/api.mjs.map +1 -1
- package/_mjs/collection/immutable/List.mjs.map +1 -1
- package/_mjs/collection/immutable/Queue/api.mjs +55 -39
- package/_mjs/collection/immutable/Queue/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Queue/definition.mjs +1 -1
- package/_mjs/collection/immutable/Queue/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/RoseTree/api.mjs +50 -36
- package/_mjs/collection/immutable/RoseTree/api.mjs.map +1 -1
- package/_mjs/collection/immutable/RoseTree/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/SortedMap/api.mjs +398 -358
- package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/api.mjs +650 -538
- package/_mjs/collection/immutable/Vector/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/definition.mjs +16 -14
- package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/internal.mjs +40 -39
- package/_mjs/collection/immutable/Vector/internal.mjs.map +1 -1
- package/_mjs/collection/mutable/HashMap.mjs +3 -5
- package/_mjs/collection/mutable/HashMap.mjs.map +1 -1
- package/_mjs/collection/mutable/HashSet.mjs.map +1 -1
- package/_mjs/collection/mutable/ListBuffer.mjs +2 -2
- package/_mjs/collection/mutable/ListBuffer.mjs.map +1 -1
- package/_mjs/collection/mutable/internal.mjs +0 -2
- package/_mjs/collection/mutable/internal.mjs.map +1 -1
- package/_mjs/collection/weak/IterableWeakMap.mjs +7 -7
- package/_mjs/collection/weak/IterableWeakMap.mjs.map +1 -1
- package/_mjs/collection/weak/IterableWeakSet.mjs +7 -7
- package/_mjs/collection/weak/IterableWeakSet.mjs.map +1 -1
- package/_mjs/control/Eval/api.mjs +40 -28
- package/_mjs/control/Eval/api.mjs.map +1 -1
- package/_mjs/control/Eval/instance.mjs +5 -5
- package/_mjs/control/Eval/instance.mjs.map +1 -1
- package/_mjs/control/Eval/run.mjs +1 -1
- package/_mjs/control/Eval/run.mjs.map +1 -1
- package/_mjs/control/Z/api.mjs +196 -128
- package/_mjs/control/Z/api.mjs.map +1 -1
- package/_mjs/control/Z/instances.mjs +4 -4
- package/_mjs/control/Z/instances.mjs.map +1 -1
- package/_mjs/control/Z/runtime.mjs +244 -234
- package/_mjs/control/Z/runtime.mjs.map +1 -1
- package/_mjs/data/Branded/definition.mjs.map +1 -1
- package/_mjs/data/Branded/derivations.mjs +3 -3
- package/_mjs/data/Branded/derivations.mjs.map +1 -1
- package/_mjs/data/CaseClass.mjs.map +1 -1
- package/_mjs/data/Cause/api/fold.mjs +19 -17
- package/_mjs/data/Cause/api/fold.mjs.map +1 -1
- package/_mjs/data/Cause/api/isEmpty.mjs +1 -1
- package/_mjs/data/Cause/api/isEmpty.mjs.map +1 -1
- package/_mjs/data/Cause/api/linearize.mjs +8 -8
- package/_mjs/data/Cause/api/linearize.mjs.map +1 -1
- package/_mjs/data/Cause/api/prettyPrint.mjs +1 -1
- package/_mjs/data/Cause/api/prettyPrint.mjs.map +1 -1
- package/_mjs/data/Cause/api.mjs +149 -129
- package/_mjs/data/Cause/api.mjs.map +1 -1
- package/_mjs/data/Cause/definition.mjs +18 -18
- package/_mjs/data/Cause/definition.mjs.map +1 -1
- package/_mjs/data/Cause.mjs.map +1 -1
- package/_mjs/data/Const/api.mjs +6 -4
- package/_mjs/data/Const/api.mjs.map +1 -1
- package/_mjs/data/Const/instances.mjs +4 -4
- package/_mjs/data/Const/instances.mjs.map +1 -1
- package/_mjs/data/Datum/api.mjs +220 -179
- package/_mjs/data/Datum/api.mjs.map +1 -1
- package/_mjs/data/Datum/definition.mjs.map +1 -1
- package/_mjs/data/DatumEither/api.mjs +163 -132
- package/_mjs/data/DatumEither/api.mjs.map +1 -1
- package/_mjs/data/DecodeError/definition.mjs +14 -14
- package/_mjs/data/DecodeError/definition.mjs.map +1 -1
- package/_mjs/data/Decoder/api.mjs +9 -7
- package/_mjs/data/Decoder/api.mjs.map +1 -1
- package/_mjs/data/Duration/api.mjs +16 -10
- package/_mjs/data/Duration/api.mjs.map +1 -1
- package/_mjs/data/Either/api/align.mjs +8 -2
- package/_mjs/data/Either/api/align.mjs.map +1 -1
- package/_mjs/data/Either/api/alignWith.mjs +13 -11
- package/_mjs/data/Either/api/alignWith.mjs.map +1 -1
- package/_mjs/data/Either/api.mjs +175 -136
- package/_mjs/data/Either/api.mjs.map +1 -1
- package/_mjs/data/Either/constructors.mjs +7 -5
- package/_mjs/data/Either/constructors.mjs.map +1 -1
- package/_mjs/data/Either/destructors.mjs +15 -13
- package/_mjs/data/Either/destructors.mjs.map +1 -1
- package/_mjs/data/Either/instances.mjs +9 -9
- package/_mjs/data/Either/instances.mjs.map +1 -1
- package/_mjs/data/EitherT/api.mjs +8 -8
- package/_mjs/data/EitherT/api.mjs.map +1 -1
- package/_mjs/data/Encoder/api.mjs +102 -0
- package/_mjs/data/Encoder/api.mjs.map +1 -0
- package/_mjs/data/Encoder/definition.mjs +15 -0
- package/_mjs/data/Encoder/definition.mjs.map +1 -0
- package/_mjs/data/Encoder.mjs +4 -0
- package/_mjs/data/Encoder.mjs.map +1 -0
- package/_mjs/data/Environment/api.mjs +45 -33
- package/_mjs/data/Environment/api.mjs.map +1 -1
- package/_mjs/data/EnvironmentPatch.mjs +17 -13
- package/_mjs/data/EnvironmentPatch.mjs.map +1 -1
- package/_mjs/data/ExecutionStrategy.mjs +19 -27
- package/_mjs/data/ExecutionStrategy.mjs.map +1 -1
- package/_mjs/data/Exit/api.mjs +140 -108
- package/_mjs/data/Exit/api.mjs.map +1 -1
- package/_mjs/data/Exit/constructors.mjs +3 -3
- package/_mjs/data/Exit/constructors.mjs.map +1 -1
- package/_mjs/data/FiberId/api.mjs +22 -20
- package/_mjs/data/FiberId/api.mjs.map +1 -1
- package/_mjs/data/FiberId/constructors.mjs.map +1 -1
- package/_mjs/data/Identity/api.mjs +21 -13
- package/_mjs/data/Identity/api.mjs.map +1 -1
- package/_mjs/data/Identity/instances.mjs +4 -4
- package/_mjs/data/Identity/instances.mjs.map +1 -1
- package/_mjs/data/Interval.mjs +38 -28
- package/_mjs/data/Interval.mjs.map +1 -1
- package/_mjs/data/Intervals.mjs +35 -27
- package/_mjs/data/Intervals.mjs.map +1 -1
- package/_mjs/data/Maybe/api.mjs +141 -106
- package/_mjs/data/Maybe/api.mjs.map +1 -1
- package/_mjs/data/Maybe/constructors.mjs +1 -1
- package/_mjs/data/Maybe/constructors.mjs.map +1 -1
- package/_mjs/data/Maybe/definition.mjs.map +1 -1
- package/_mjs/data/Maybe/destructors.mjs +8 -6
- package/_mjs/data/Maybe/destructors.mjs.map +1 -1
- package/_mjs/data/Maybe/instances.mjs +12 -12
- package/_mjs/data/Maybe/instances.mjs.map +1 -1
- package/_mjs/data/Predicate/api.mjs +10 -8
- package/_mjs/data/Predicate/api.mjs.map +1 -1
- package/_mjs/data/Refinement/api.mjs +15 -9
- package/_mjs/data/Refinement/api.mjs.map +1 -1
- package/_mjs/data/Struct/api.mjs +56 -44
- package/_mjs/data/Struct/api.mjs.map +1 -1
- package/_mjs/data/Tag/constructors.mjs +3 -2
- package/_mjs/data/Tag/constructors.mjs.map +1 -1
- package/_mjs/data/Tag/definition.mjs +0 -2
- package/_mjs/data/Tag/definition.mjs.map +1 -1
- package/_mjs/data/These/api.mjs +187 -169
- package/_mjs/data/These/api.mjs.map +1 -1
- package/_mjs/data/These/constructors.mjs +1 -1
- package/_mjs/data/These/constructors.mjs.map +1 -1
- package/_mjs/data/These/destructors.mjs +35 -31
- package/_mjs/data/These/destructors.mjs.map +1 -1
- package/_mjs/data/These/instances.mjs +1 -1
- package/_mjs/data/These/instances.mjs.map +1 -1
- package/_mjs/data/Trace/api.mjs +6 -4
- package/_mjs/data/Trace/api.mjs.map +1 -1
- package/_mjs/data/Zipped.mjs.map +1 -1
- package/_mjs/data/function/api.mjs +5 -3
- package/_mjs/data/function/api.mjs.map +1 -1
- package/_mjs/data/function/pipe.mjs +7 -0
- package/_mjs/data/function/pipe.mjs.map +1 -1
- package/_mjs/data/string/api.mjs +46 -66
- package/_mjs/data/string/api.mjs.map +1 -1
- package/_mjs/global/api.mjs +4 -2
- package/_mjs/global/api.mjs.map +1 -1
- package/_mjs/internal/AtomicBoolean.mjs.map +1 -1
- package/_mjs/internal/AtomicNumber.mjs.map +1 -1
- package/_mjs/internal/AtomicReference.mjs.map +1 -1
- package/_mjs/internal/Stack.mjs +1 -1
- package/_mjs/internal/Stack.mjs.map +1 -1
- package/_mjs/optics/At/api.mjs +1 -1
- package/_mjs/optics/At/api.mjs.map +1 -1
- package/_mjs/optics/At/definition.mjs +2 -2
- package/_mjs/optics/At/definition.mjs.map +1 -1
- package/_mjs/optics/Fold/definition.mjs +2 -3
- package/_mjs/optics/Fold/definition.mjs.map +1 -1
- package/_mjs/optics/Getter/definition.mjs +1 -2
- package/_mjs/optics/Getter/definition.mjs.map +1 -1
- package/_mjs/optics/Index/api.mjs +4 -4
- package/_mjs/optics/Index/api.mjs.map +1 -1
- package/_mjs/optics/Index/definition.mjs +1 -1
- package/_mjs/optics/Index/definition.mjs.map +1 -1
- package/_mjs/optics/Iso/api.mjs +8 -6
- package/_mjs/optics/Iso/api.mjs.map +1 -1
- package/_mjs/optics/Iso/definition.mjs +9 -9
- package/_mjs/optics/Iso/definition.mjs.map +1 -1
- package/_mjs/optics/Lens/api.mjs +49 -39
- package/_mjs/optics/Lens/api.mjs.map +1 -1
- package/_mjs/optics/Lens/definition.mjs +7 -7
- package/_mjs/optics/Lens/definition.mjs.map +1 -1
- package/_mjs/optics/Optional/api/compose.mjs +8 -6
- package/_mjs/optics/Optional/api/compose.mjs.map +1 -1
- package/_mjs/optics/Optional/definition.mjs +8 -10
- package/_mjs/optics/Optional/definition.mjs.map +1 -1
- package/_mjs/optics/Optional.mjs.map +1 -1
- package/_mjs/optics/Prism/api/compose.mjs +8 -6
- package/_mjs/optics/Prism/api/compose.mjs.map +1 -1
- package/_mjs/optics/Prism/api/fromNullable.mjs +2 -2
- package/_mjs/optics/Prism/api/fromNullable.mjs.map +1 -1
- package/_mjs/optics/Prism/api/just.mjs +2 -2
- package/_mjs/optics/Prism/api/just.mjs.map +1 -1
- package/_mjs/optics/Prism/definition.mjs +6 -6
- package/_mjs/optics/Prism/definition.mjs.map +1 -1
- package/_mjs/optics/Prism.mjs.map +1 -1
- package/_mjs/optics/Setter/definition.mjs +5 -10
- package/_mjs/optics/Setter/definition.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/compose.mjs +7 -5
- package/_mjs/optics/Traversal/api/compose.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/fromTraversable.mjs +2 -2
- package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -1
- package/_mjs/optics/Traversal/definition.mjs +9 -9
- package/_mjs/optics/Traversal/definition.mjs.map +1 -1
- package/_mjs/optics/Traversal.mjs.map +1 -1
- package/_mjs/typeclass/Align.mjs.map +1 -1
- package/_mjs/typeclass/Alt.mjs.map +1 -1
- package/_mjs/typeclass/Applicative.mjs.map +1 -1
- package/_mjs/typeclass/ApplicativeExcept.mjs +6 -10
- package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -1
- package/_mjs/typeclass/Apply.mjs +9 -9
- package/_mjs/typeclass/Apply.mjs.map +1 -1
- package/_mjs/typeclass/Chain.mjs +5 -5
- package/_mjs/typeclass/Chain.mjs.map +1 -1
- package/_mjs/typeclass/Eq/definition.mjs.map +1 -1
- package/_mjs/typeclass/Eq/derivations.mjs.map +1 -1
- package/_mjs/typeclass/Equatable/api.mjs.map +1 -1
- package/_mjs/typeclass/Equatable/definition.mjs.map +1 -1
- package/_mjs/typeclass/Equatable/fast-equals.mjs.map +1 -1
- package/_mjs/typeclass/Filterable.mjs.map +1 -1
- package/_mjs/typeclass/FilterableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Foldable.mjs +1 -1
- package/_mjs/typeclass/Foldable.mjs.map +1 -1
- package/_mjs/typeclass/FoldableWithIndex.mjs +1 -1
- package/_mjs/typeclass/FoldableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Functor.mjs.map +1 -1
- package/_mjs/typeclass/FunctorWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Guard/api.mjs +18 -10
- package/_mjs/typeclass/Guard/api.mjs.map +1 -1
- package/_mjs/typeclass/Guard/definition.mjs.map +1 -1
- package/_mjs/typeclass/Guard/derivations.mjs.map +1 -1
- package/_mjs/typeclass/Has.mjs +7 -5
- package/_mjs/typeclass/Has.mjs.map +1 -1
- package/_mjs/typeclass/HashEq.mjs.map +1 -1
- package/_mjs/typeclass/Hashable/definition.mjs.map +1 -1
- package/_mjs/typeclass/Hashable/hash.mjs.map +1 -1
- package/_mjs/typeclass/MonadExcept.mjs +1 -1
- package/_mjs/typeclass/MonadExcept.mjs.map +1 -1
- package/_mjs/typeclass/Ord/api/contramap.mjs +7 -5
- package/_mjs/typeclass/Ord/api/contramap.mjs.map +1 -1
- package/_mjs/typeclass/Ord/api/max.mjs.map +1 -1
- package/_mjs/typeclass/Ord/api/min.mjs.map +1 -1
- package/_mjs/typeclass/Ord/definition.mjs.map +1 -1
- package/_mjs/typeclass/Ord/instances.mjs.map +1 -1
- package/_mjs/typeclass/Ordering.mjs.map +1 -1
- package/_mjs/typeclass/Semialign.mjs +7 -7
- package/_mjs/typeclass/Semialign.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/api.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/definition.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/derivations.mjs.map +1 -1
- package/_mjs/typeclass/Semimonoidal.mjs.map +1 -1
- package/_mjs/typeclass/Showable/definition.mjs.map +1 -1
- package/_mjs/typeclass/Showable/show.mjs +107 -107
- package/_mjs/typeclass/Showable/show.mjs.map +1 -1
- package/_mjs/typeclass/Showable/styles.mjs.map +1 -1
- package/_mjs/typeclass/Showable/util.mjs +1 -1
- package/_mjs/typeclass/Showable/util.mjs.map +1 -1
- package/_mjs/typeclass/Traversable.mjs +1 -2
- package/_mjs/typeclass/Traversable.mjs.map +1 -1
- package/_mjs/typeclass/TraversableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Witherable.mjs +2 -1
- package/_mjs/typeclass/Witherable.mjs.map +1 -1
- package/_mjs/typeclass/WitherableWithIndex.mjs +2 -1
- package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -1
- package/_mjs/util/AnsiFormat.mjs +11 -11
- package/_mjs/util/AnsiFormat.mjs.map +1 -1
- package/_mjs/util/PCGRandom.mjs.map +1 -1
- package/_mjs/util/assert.mjs.map +1 -1
- package/_mjs/util/pattern.mjs.map +1 -1
- package/_mjs/util/predicates.mjs.map +1 -1
- package/_mjs/util/rand/Random.mjs.map +1 -1
- package/_mjs/util/rand/distribution/UniformArrayIntDistribution.mjs.map +1 -1
- package/_mjs/util/rand/distribution/UniformBigIntDistribution.mjs.map +1 -1
- package/_mjs/util/rand/distribution/UniformIntDistribution.mjs.map +1 -1
- package/_mjs/util/rand/distribution/internals/ArrayInt.mjs.map +1 -1
- package/_mjs/util/rand/distribution/internals/UniformArrayIntDistributionInternal.mjs.map +1 -1
- package/_mjs/util/rand/distribution/internals/UniformIntDistributionInternal.mjs.map +1 -1
- package/_mjs/util/rand/generator/MersenneTwister.mjs.map +1 -1
- package/_mjs/util/rand/generator/RandomGenerator.mjs.map +1 -1
- package/_mjs/util/rand.mjs.map +1 -1
- package/_src/collection/Iterable/api/traverseConc.ts +3 -3
- package/_src/collection/Iterable/api.ts +445 -408
- package/_src/collection/Iterable/constructors.ts +1 -1
- package/_src/collection/compat/Array/api.ts +16 -13
- package/_src/collection/compat/Array/derivations.ts +27 -1
- package/_src/collection/compat/Record/instances.ts +51 -2
- package/_src/collection/immutable/Conc/api.ts +716 -607
- package/_src/collection/immutable/Conc/definition.ts +60 -68
- package/_src/collection/immutable/Conc/derivations.ts +13 -0
- package/_src/collection/immutable/Conc.ts +0 -1
- package/_src/collection/immutable/Dictionary/api.ts +44 -32
- package/_src/collection/immutable/HashMap/api.ts +338 -224
- package/_src/collection/immutable/HashMap/internal.ts +3 -7
- package/_src/collection/immutable/HashSet/api.ts +193 -158
- package/_src/collection/immutable/ImmutableArray/api/chunksOf.ts +5 -3
- package/_src/collection/immutable/ImmutableArray/api/slice.ts +5 -3
- package/_src/collection/immutable/ImmutableArray/api/splitAt.ts +5 -3
- package/_src/collection/immutable/ImmutableArray/api/splitWhere.ts +13 -14
- package/_src/collection/immutable/ImmutableArray/api.ts +870 -722
- package/_src/collection/immutable/ImmutableArray/derivations.ts +13 -0
- package/_src/collection/immutable/ImmutableArray/instances.ts +54 -73
- package/_src/collection/immutable/ImmutableArray.ts +0 -1
- package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +311 -273
- package/_src/collection/immutable/ImmutableNonEmptyArray/constructors.ts +19 -4
- package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +0 -1
- package/_src/collection/immutable/ImmutableNonEmptyArray/derivations.ts +13 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/instances.ts +22 -23
- package/_src/collection/immutable/List/api/foldLeft.ts +11 -9
- package/_src/collection/immutable/List/api.ts +147 -133
- package/_src/collection/immutable/List.ts +0 -1
- package/_src/collection/immutable/Queue/api.ts +53 -37
- package/_src/collection/immutable/Queue/definition.ts +0 -1
- package/_src/collection/immutable/RoseTree/api.ts +38 -32
- package/_src/collection/immutable/RoseTree/definition.ts +2 -0
- package/_src/collection/immutable/SortedMap/api.ts +364 -332
- package/_src/collection/immutable/Vector/api.ts +608 -482
- package/_src/collection/immutable/Vector/definition.ts +11 -12
- package/_src/collection/immutable/Vector/internal.ts +37 -38
- package/_src/collection/mutable/HashMap.ts +1 -4
- package/_src/collection/mutable/HashSet.ts +1 -2
- package/_src/collection/mutable/ListBuffer.ts +1 -1
- package/_src/collection/mutable/internal.ts +0 -2
- package/_src/collection/weak/IterableWeakMap.ts +11 -7
- package/_src/collection/weak/IterableWeakSet.ts +10 -5
- package/_src/control/Eval/api.ts +35 -19
- package/_src/control/Eval/instance.ts +5 -5
- package/_src/control/Z/api.ts +191 -208
- package/_src/control/Z/instances.ts +4 -5
- package/_src/control/Z/runtime.ts +190 -189
- package/_src/data/Branded/definition.ts +11 -12
- package/_src/data/Branded/derivations.ts +2 -2
- package/_src/data/CaseClass.ts +4 -1
- package/_src/data/Cause/api/fold.ts +13 -14
- package/_src/data/Cause/api.ts +125 -105
- package/_src/data/Cause.ts +0 -1
- package/_src/data/Const/api.ts +6 -4
- package/_src/data/Const/instances.ts +3 -3
- package/_src/data/Datum/api.ts +229 -197
- package/_src/data/Datum/definition.ts +2 -5
- package/_src/data/DatumEither/api.ts +208 -193
- package/_src/data/Decoder/api.ts +5 -3
- package/_src/data/Duration/api.ts +19 -15
- package/_src/data/Either/api/align.ts +7 -2
- package/_src/data/Either/api/alignWith.ts +13 -15
- package/_src/data/Either/api.ts +141 -119
- package/_src/data/Either/constructors.ts +12 -10
- package/_src/data/Either/destructors.ts +11 -9
- package/_src/data/Either/instances.ts +24 -20
- package/_src/data/EitherT/api.ts +43 -49
- package/_src/data/Encoder/api.ts +123 -0
- package/_src/data/Encoder/definition.ts +12 -0
- package/_src/data/Encoder.ts +4 -0
- package/_src/data/Environment/api.ts +52 -44
- package/_src/data/EnvironmentPatch.ts +10 -9
- package/_src/data/ExecutionStrategy.ts +14 -24
- package/_src/data/Exit/api.ts +104 -73
- package/_src/data/Exit/constructors.ts +2 -2
- package/_src/data/FiberId/api.ts +19 -17
- package/_src/data/FiberId/constructors.ts +1 -2
- package/_src/data/Identity/api.ts +20 -12
- package/_src/data/Identity/instances.ts +4 -7
- package/_src/data/Interval.ts +39 -29
- package/_src/data/Intervals.ts +31 -23
- package/_src/data/Maybe/api.ts +112 -79
- package/_src/data/Maybe/constructors.ts +3 -3
- package/_src/data/Maybe/definition.ts +11 -1
- package/_src/data/Maybe/destructors.ts +6 -4
- package/_src/data/Maybe/instances.ts +10 -21
- package/_src/data/Predicate/api.ts +14 -8
- package/_src/data/Refinement/api.ts +19 -13
- package/_src/data/Struct/api.ts +75 -55
- package/_src/data/Tag/constructors.ts +1 -2
- package/_src/data/Tag/definition.ts +0 -1
- package/_src/data/These/api.ts +114 -114
- package/_src/data/These/destructors.ts +23 -24
- package/_src/data/Trace/api.ts +5 -3
- package/_src/data/Zipped.ts +3 -4
- package/_src/data/function/api.ts +6 -7
- package/_src/data/function/pipe.ts +9 -1
- package/_src/data/string/api.ts +40 -60
- package/_src/data.ts +1 -0
- package/_src/global/api.ts +7 -12
- package/_src/global.ts +4 -0
- package/_src/internal/AtomicBoolean.ts +0 -1
- package/_src/internal/AtomicNumber.ts +0 -7
- package/_src/internal/AtomicReference.ts +0 -4
- package/_src/internal/Stack.ts +1 -7
- package/_src/optics/At/definition.ts +5 -3
- package/_src/optics/Fold/definition.ts +3 -10
- package/_src/optics/Getter/definition.ts +1 -2
- package/_src/optics/Index/definition.ts +1 -1
- package/_src/optics/Iso/api.ts +8 -6
- package/_src/optics/Iso/definition.ts +3 -3
- package/_src/optics/Lens/api.ts +44 -42
- package/_src/optics/Lens/definition.ts +5 -5
- package/_src/optics/Optional/api/compose.ts +9 -9
- package/_src/optics/Optional/definition.ts +9 -16
- package/_src/optics/Optional.ts +0 -1
- package/_src/optics/Prism/api/compose.ts +9 -6
- package/_src/optics/Prism/definition.ts +3 -3
- package/_src/optics/Prism.ts +0 -1
- package/_src/optics/Setter/definition.ts +3 -23
- package/_src/optics/Traversal/api/compose.ts +7 -8
- package/_src/optics/Traversal/api/fromTraversable.ts +1 -1
- package/_src/optics/Traversal/definition.ts +10 -15
- package/_src/optics/Traversal.ts +0 -1
- package/_src/typeclass/Align.ts +0 -3
- package/_src/typeclass/Alt.ts +2 -1
- package/_src/typeclass/Applicative.ts +0 -1
- package/_src/typeclass/ApplicativeExcept.ts +15 -10
- package/_src/typeclass/Apply.ts +30 -33
- package/_src/typeclass/Chain.ts +9 -12
- package/_src/typeclass/Eq/definition.ts +0 -3
- package/_src/typeclass/Eq/derivations.ts +0 -2
- package/_src/typeclass/Equatable/api.ts +0 -2
- package/_src/typeclass/Equatable/definition.ts +0 -4
- package/_src/typeclass/Equatable/fast-equals.ts +11 -93
- package/_src/typeclass/Filterable.ts +19 -13
- package/_src/typeclass/FilterableWithIndex.ts +19 -13
- package/_src/typeclass/Foldable.ts +7 -10
- package/_src/typeclass/FoldableWithIndex.ts +7 -10
- package/_src/typeclass/Functor.ts +6 -4
- package/_src/typeclass/FunctorWithIndex.ts +3 -2
- package/_src/typeclass/Guard/api.ts +21 -16
- package/_src/typeclass/Guard/definition.ts +0 -3
- package/_src/typeclass/Guard/derivations.ts +5 -6
- package/_src/typeclass/Has.ts +6 -4
- package/_src/typeclass/HashEq.ts +0 -7
- package/_src/typeclass/Hashable/definition.ts +0 -4
- package/_src/typeclass/Hashable/hash.ts +0 -26
- package/_src/typeclass/MonadExcept.ts +1 -1
- package/_src/typeclass/Ord/api/contramap.ts +7 -6
- package/_src/typeclass/Ord/api/max.ts +0 -1
- package/_src/typeclass/Ord/api/min.ts +0 -1
- package/_src/typeclass/Ord/definition.ts +0 -4
- package/_src/typeclass/Ord/instances.ts +0 -2
- package/_src/typeclass/Ordering.ts +2 -0
- package/_src/typeclass/Semialign.ts +43 -32
- package/_src/typeclass/Semigroup/api.ts +0 -2
- package/_src/typeclass/Semigroup/definition.ts +0 -4
- package/_src/typeclass/Semigroup/derivations.ts +0 -2
- package/_src/typeclass/Semimonoidal.ts +3 -2
- package/_src/typeclass/Showable/definition.ts +0 -6
- package/_src/typeclass/Showable/show.ts +1 -57
- package/_src/typeclass/Showable/styles.ts +0 -8
- package/_src/typeclass/Showable/util.ts +22 -57
- package/_src/typeclass/Traversable.ts +13 -18
- package/_src/typeclass/TraversableWithIndex.ts +5 -7
- package/_src/typeclass/Witherable.ts +21 -13
- package/_src/typeclass/WitherableWithIndex.ts +26 -17
- package/_src/typeclass/builtin/Symbol.ts +0 -1
- package/_src/types/extractions.ts +12 -3
- package/_src/types/utility.ts +3 -5
- package/_src/util/AnsiFormat.ts +0 -25
- package/_src/util/PCGRandom.ts +4 -9
- package/_src/util/assert.ts +1 -2
- package/_src/util/pattern.ts +91 -12
- package/_src/util/predicates.ts +3 -1
- package/_src/util/rand/Random.ts +12 -16
- package/_src/util/rand/distribution/Distribution.ts +0 -1
- package/_src/util/rand/distribution/UniformArrayIntDistribution.ts +0 -3
- package/_src/util/rand/distribution/UniformBigIntDistribution.ts +0 -5
- package/_src/util/rand/distribution/UniformIntDistribution.ts +0 -7
- package/_src/util/rand/distribution/internals/ArrayInt.ts +3 -13
- package/_src/util/rand/distribution/internals/UniformArrayIntDistributionInternal.ts +0 -3
- package/_src/util/rand/distribution/internals/UniformIntDistributionInternal.ts +0 -4
- package/_src/util/rand/generator/MersenneTwister.ts +6 -29
- package/_src/util/rand/generator/RandomGenerator.ts +0 -3
- package/_src/util/rand.ts +0 -2
- package/collection/Iterable/api/traverseConc.d.ts +2 -2
- package/collection/Iterable/api.d.ts +64 -64
- package/collection/Iterable/constructors.d.ts +1 -1
- package/collection/compat/Array/api.d.ts +6 -6
- package/collection/compat/Array/derivations.d.ts +11 -0
- package/collection/compat/Record/instances.d.ts +30 -6
- package/collection/immutable/Conc/api.d.ts +108 -105
- package/collection/immutable/Conc/definition.d.ts +2 -2
- package/collection/immutable/Conc/derivations.d.ts +6 -0
- package/collection/immutable/Dictionary/api.d.ts +12 -12
- package/collection/immutable/HashMap/api.d.ts +76 -70
- package/collection/immutable/HashSet/api.d.ts +45 -41
- package/collection/immutable/ImmutableArray/api/chunksOf.d.ts +2 -2
- package/collection/immutable/ImmutableArray/api/slice.d.ts +2 -2
- package/collection/immutable/ImmutableArray/api/splitAt.d.ts +2 -2
- package/collection/immutable/ImmutableArray/api/splitWhere.d.ts +3 -3
- package/collection/immutable/ImmutableArray/api.d.ts +206 -206
- package/collection/immutable/ImmutableArray/derivations.d.ts +6 -0
- package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +64 -63
- package/collection/immutable/ImmutableNonEmptyArray/derivations.d.ts +6 -0
- package/collection/immutable/List/api/foldLeft.d.ts +2 -2
- package/collection/immutable/List/api.d.ts +24 -24
- package/collection/immutable/Queue/api.d.ts +16 -16
- package/collection/immutable/RoseTree/api.d.ts +14 -14
- package/collection/immutable/SortedMap/api.d.ts +41 -41
- package/collection/immutable/Vector/api.d.ts +121 -117
- package/collection/immutable/Vector/definition.d.ts +2 -2
- package/collection/immutable/Vector/internal.d.ts +2 -2
- package/collection/mutable/ListBuffer.d.ts +1 -1
- package/control/Eval/api.d.ts +12 -12
- package/control/Z/api.d.ts +68 -68
- package/control/Z/runtime.d.ts +10 -10
- package/data/Branded/derivations.d.ts +2 -2
- package/data/Cause/api/fold.d.ts +3 -3
- package/data/Cause/api.d.ts +20 -20
- package/data/Const/api.d.ts +3 -3
- package/data/Datum/api.d.ts +43 -41
- package/data/DatumEither/api.d.ts +48 -46
- package/data/Decoder/api.d.ts +2 -2
- package/data/Duration/api.d.ts +7 -7
- package/data/Either/api/align.d.ts +5 -1
- package/data/Either/api/alignWith.d.ts +2 -2
- package/data/Either/api.d.ts +40 -46
- package/data/Either/constructors.d.ts +6 -6
- package/data/Either/destructors.d.ts +2 -2
- package/data/EitherT/api.d.ts +6 -6
- package/data/Encoder/api.d.ts +73 -0
- package/data/Encoder/definition.d.ts +12 -0
- package/data/Encoder.d.ts +2 -0
- package/data/Environment/api.d.ts +14 -14
- package/data/EnvironmentPatch.d.ts +4 -4
- package/data/ExecutionStrategy.d.ts +1 -6
- package/data/Exit/api.d.ts +32 -32
- package/data/Exit/constructors.d.ts +2 -2
- package/data/FiberId/api.d.ts +2 -2
- package/data/Identity/api.d.ts +8 -8
- package/data/Interval.d.ts +11 -11
- package/data/Intervals.d.ts +11 -11
- package/data/Maybe/api.d.ts +36 -37
- package/data/Maybe/constructors.d.ts +2 -2
- package/data/Maybe/definition.d.ts +7 -3
- package/data/Maybe/destructors.d.ts +2 -2
- package/data/Predicate/api.d.ts +5 -5
- package/data/Refinement/api.d.ts +9 -9
- package/data/Struct/api.d.ts +13 -23
- package/data/Tag/constructors.d.ts +1 -2
- package/data/Tag/definition.d.ts +0 -1
- package/data/These/api.d.ts +18 -22
- package/data/These/destructors.d.ts +4 -4
- package/data/Trace/api.d.ts +2 -2
- package/data/function/api.d.ts +3 -3
- package/data/function/pipe.d.ts +7 -1
- package/data/string/api.d.ts +9 -49
- package/data.d.ts +1 -0
- package/global/api.d.ts +3 -3
- package/global.d.ts +4 -0
- package/internal/Stack.d.ts +1 -1
- package/optics/At/definition.d.ts +1 -1
- package/optics/Fold/definition.d.ts +2 -6
- package/optics/Getter/definition.d.ts +1 -1
- package/optics/Index/definition.d.ts +1 -1
- package/optics/Iso/api.d.ts +2 -2
- package/optics/Iso/definition.d.ts +2 -2
- package/optics/Lens/api.d.ts +10 -10
- package/optics/Lens/definition.d.ts +4 -4
- package/optics/Optional/api/compose.d.ts +2 -2
- package/optics/Optional/definition.d.ts +4 -8
- package/optics/Prism/api/compose.d.ts +2 -2
- package/optics/Prism/definition.d.ts +2 -2
- package/optics/Setter/definition.d.ts +2 -14
- package/optics/Traversal/api/compose.d.ts +2 -2
- package/optics/Traversal/definition.d.ts +4 -4
- package/package.json +1 -1
- package/typeclass/Alt.d.ts +1 -1
- package/typeclass/ApplicativeExcept.d.ts +2 -6
- package/typeclass/Apply.d.ts +5 -5
- package/typeclass/Chain.d.ts +4 -4
- package/typeclass/Filterable.d.ts +6 -6
- package/typeclass/FilterableWithIndex.d.ts +6 -6
- package/typeclass/Foldable.d.ts +4 -4
- package/typeclass/FoldableWithIndex.d.ts +4 -4
- package/typeclass/Functor.d.ts +2 -2
- package/typeclass/FunctorWithIndex.d.ts +1 -1
- package/typeclass/Guard/api.d.ts +7 -7
- package/typeclass/Has.d.ts +3 -3
- package/typeclass/Ord/api/contramap.d.ts +2 -2
- package/typeclass/Semialign.d.ts +14 -14
- package/typeclass/Semimonoidal.d.ts +1 -1
- package/typeclass/Traversable.d.ts +4 -6
- package/typeclass/TraversableWithIndex.d.ts +2 -2
- package/typeclass/Witherable.d.ts +3 -3
- package/typeclass/WitherableWithIndex.d.ts +5 -5
- package/types/extractions.d.ts +10 -6
- package/util/assert.d.ts +1 -1
|
@@ -3,77 +3,79 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
6
|
+
exports._traverse = _traverse;
|
|
7
|
+
exports.append = exports._traverseWithIndex = void 0;
|
|
8
|
+
exports.chunksOf = chunksOf;
|
|
9
|
+
exports.concat = void 0;
|
|
10
|
+
exports.contains = contains;
|
|
11
|
+
exports.drop = drop;
|
|
12
|
+
exports.dropLast = dropLast;
|
|
11
13
|
exports.dropRepeats = dropRepeats;
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.elem_ = elem_;
|
|
14
|
+
exports.dropRepeatsWith = void 0;
|
|
15
|
+
exports.dropWhile = dropWhile;
|
|
16
|
+
exports.elem = elem;
|
|
16
17
|
exports.emptyPushable = exports.empty = void 0;
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
18
|
+
exports.equals = equals;
|
|
19
|
+
exports.every = every;
|
|
20
|
+
exports.exists = void 0;
|
|
21
|
+
exports.find = find;
|
|
22
|
+
exports.findIndex = void 0;
|
|
23
|
+
exports.findLast = findLast;
|
|
24
|
+
exports.findLastIndex = findLastIndex;
|
|
25
|
+
exports.flatMap = flatMap;
|
|
26
|
+
exports.foldLeft = exports.flatten = void 0;
|
|
27
|
+
exports.foldLeftWhile = foldLeftWhile;
|
|
28
|
+
exports.foldLeftWithIndex = void 0;
|
|
29
|
+
exports.foldMap = foldMap;
|
|
30
|
+
exports.foldMapWithIndex = void 0;
|
|
31
|
+
exports.foldRight = foldRight;
|
|
32
|
+
exports.foldRightWhile = foldRightWhile;
|
|
33
|
+
exports.forEach = exports.foldRightWithIndex = void 0;
|
|
34
|
+
exports.forEachWithIndex = forEachWithIndex;
|
|
33
35
|
exports.from = from;
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
+
exports.get = get;
|
|
37
|
+
exports.groupWith = groupWith;
|
|
36
38
|
exports.head = head;
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
39
|
+
exports.indexOf = indexOf;
|
|
40
|
+
exports.insertAllAt = insertAllAt;
|
|
41
|
+
exports.insertAt = insertAt;
|
|
42
|
+
exports.intersperse = intersperse;
|
|
41
43
|
exports.isEmpty = isEmpty;
|
|
42
44
|
exports.isNonEmpty = isNonEmpty;
|
|
43
|
-
exports.
|
|
45
|
+
exports.join = join;
|
|
44
46
|
exports.last = last;
|
|
45
|
-
exports.
|
|
47
|
+
exports.lastIndexOf = lastIndexOf;
|
|
46
48
|
exports.makeBy = makeBy;
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
49
|
+
exports.map = void 0;
|
|
50
|
+
exports.mapAccum = mapAccum;
|
|
51
|
+
exports.mapWithIndex = void 0;
|
|
52
|
+
exports.modifyAt = modifyAt;
|
|
50
53
|
exports.mutableClone = void 0;
|
|
51
|
-
exports.
|
|
54
|
+
exports.none = none;
|
|
52
55
|
exports.pair = pair;
|
|
53
|
-
exports.pop = void 0;
|
|
56
|
+
exports.prepend = exports.pop = void 0;
|
|
54
57
|
exports.prependOperator = prependOperator;
|
|
55
|
-
exports.prepend_ = void 0;
|
|
56
58
|
exports.range = range;
|
|
57
|
-
exports.
|
|
59
|
+
exports.remove = remove;
|
|
58
60
|
exports.replicate = replicate;
|
|
59
61
|
exports.reverse = reverse;
|
|
60
|
-
exports.
|
|
62
|
+
exports.scanLeft = scanLeft;
|
|
61
63
|
exports.single = single;
|
|
62
|
-
exports.
|
|
63
|
-
exports.
|
|
64
|
-
exports.
|
|
65
|
-
exports.
|
|
64
|
+
exports.slice = void 0;
|
|
65
|
+
exports.sort = sort;
|
|
66
|
+
exports.splitAt = exports.sortWith = void 0;
|
|
67
|
+
exports.splitWhen = splitWhen;
|
|
66
68
|
exports.tail = tail;
|
|
67
|
-
exports.
|
|
68
|
-
exports.
|
|
69
|
-
exports.
|
|
70
|
-
exports.
|
|
69
|
+
exports.take = take;
|
|
70
|
+
exports.takeLast = takeLast;
|
|
71
|
+
exports.takeLastWhile = takeLastWhile;
|
|
72
|
+
exports.takeWhile = takeWhile;
|
|
71
73
|
exports.toArray = toArray;
|
|
72
74
|
exports.toList = toList;
|
|
73
75
|
exports.traverseWithIndex = exports.traverse = void 0;
|
|
74
76
|
exports.unfold = unfold;
|
|
75
77
|
exports.uniq = uniq;
|
|
76
|
-
exports.vector = exports.
|
|
78
|
+
exports.vector = exports.updateAt = exports.unsafeLast = exports.unsafeHead = exports.unsafeGet = exports.unsafeFindLast = exports.unsafeFind = void 0;
|
|
77
79
|
|
|
78
80
|
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Vector"));
|
|
79
81
|
|
|
@@ -87,68 +89,68 @@ var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require
|
|
|
87
89
|
|
|
88
90
|
var tsplus_module_6 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/mutable/ListBuffer"));
|
|
89
91
|
|
|
90
|
-
var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/
|
|
91
|
-
|
|
92
|
-
var tsplus_module_8 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/definition"));
|
|
92
|
+
var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/definition"));
|
|
93
93
|
|
|
94
94
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
95
95
|
|
|
96
96
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
97
97
|
|
|
98
|
-
const
|
|
99
|
-
exports.
|
|
100
|
-
const
|
|
101
|
-
exports.
|
|
102
|
-
const
|
|
103
|
-
exports.
|
|
98
|
+
const append = append_1;
|
|
99
|
+
exports.append = append;
|
|
100
|
+
const concat = concat_1;
|
|
101
|
+
exports.concat = concat;
|
|
102
|
+
const dropRepeatsWith = dropRepeatsWith_1;
|
|
103
|
+
exports.dropRepeatsWith = dropRepeatsWith;
|
|
104
104
|
const empty = empty_1;
|
|
105
105
|
exports.empty = empty;
|
|
106
106
|
const emptyPushable = emptyPushable_1;
|
|
107
107
|
exports.emptyPushable = emptyPushable;
|
|
108
|
-
const
|
|
109
|
-
exports.
|
|
110
|
-
const
|
|
111
|
-
exports.
|
|
108
|
+
const exists = exists_1;
|
|
109
|
+
exports.exists = exists;
|
|
110
|
+
const findIndex = findIndex_1;
|
|
111
|
+
exports.findIndex = findIndex;
|
|
112
112
|
const flatten = flatten_1;
|
|
113
113
|
exports.flatten = flatten;
|
|
114
|
-
const
|
|
115
|
-
exports.
|
|
116
|
-
const
|
|
117
|
-
exports.
|
|
118
|
-
const
|
|
119
|
-
exports.
|
|
120
|
-
const
|
|
121
|
-
exports.
|
|
122
|
-
const
|
|
123
|
-
exports.
|
|
124
|
-
const
|
|
125
|
-
exports.
|
|
126
|
-
const
|
|
127
|
-
exports.
|
|
114
|
+
const foldLeft = foldLeft_1;
|
|
115
|
+
exports.foldLeft = foldLeft;
|
|
116
|
+
const foldLeftWithIndex = foldLeftWithIndex_1;
|
|
117
|
+
exports.foldLeftWithIndex = foldLeftWithIndex;
|
|
118
|
+
const foldMapWithIndex = foldMapWithIndex_1;
|
|
119
|
+
exports.foldMapWithIndex = foldMapWithIndex;
|
|
120
|
+
const foldRightWithIndex = foldRightWithIndex_1;
|
|
121
|
+
exports.foldRightWithIndex = foldRightWithIndex;
|
|
122
|
+
const forEach = forEach_1;
|
|
123
|
+
exports.forEach = forEach;
|
|
124
|
+
const map = map_1;
|
|
125
|
+
exports.map = map;
|
|
126
|
+
const mapWithIndex = mapWithIndex_1;
|
|
127
|
+
exports.mapWithIndex = mapWithIndex;
|
|
128
128
|
const mutableClone = mutableClone_1;
|
|
129
129
|
exports.mutableClone = mutableClone;
|
|
130
130
|
const pop = pop_1;
|
|
131
131
|
exports.pop = pop;
|
|
132
|
-
const
|
|
133
|
-
exports.
|
|
134
|
-
const
|
|
135
|
-
exports.
|
|
136
|
-
const
|
|
137
|
-
exports.
|
|
138
|
-
const
|
|
139
|
-
exports.
|
|
140
|
-
const
|
|
141
|
-
exports.
|
|
142
|
-
const
|
|
143
|
-
exports.
|
|
144
|
-
const
|
|
145
|
-
exports.
|
|
132
|
+
const prepend = prepend_1;
|
|
133
|
+
exports.prepend = prepend;
|
|
134
|
+
const slice = slice_1;
|
|
135
|
+
exports.slice = slice;
|
|
136
|
+
const sortWith = sortWith_1;
|
|
137
|
+
exports.sortWith = sortWith;
|
|
138
|
+
const splitAt = splitAt_1;
|
|
139
|
+
exports.splitAt = splitAt;
|
|
140
|
+
const _traverseWithIndex = _traverseWithIndex_1;
|
|
141
|
+
exports._traverseWithIndex = _traverseWithIndex;
|
|
142
|
+
const unsafeFind = unsafeFind_1;
|
|
143
|
+
exports.unsafeFind = unsafeFind;
|
|
144
|
+
const unsafeFindLast = unsafeFindLast_1;
|
|
145
|
+
exports.unsafeFindLast = unsafeFindLast;
|
|
146
|
+
const unsafeGet = unsafeGet_1;
|
|
147
|
+
exports.unsafeGet = unsafeGet;
|
|
146
148
|
const unsafeHead = unsafeHead_1;
|
|
147
149
|
exports.unsafeHead = unsafeHead;
|
|
148
150
|
const unsafeLast = unsafeLast_1;
|
|
149
151
|
exports.unsafeLast = unsafeLast;
|
|
150
|
-
const
|
|
151
|
-
exports.
|
|
152
|
+
const updateAt = updateAt_1;
|
|
153
|
+
exports.updateAt = updateAt;
|
|
152
154
|
const vector = vector_1;
|
|
153
155
|
exports.vector = vector;
|
|
154
156
|
|
|
@@ -157,116 +159,124 @@ exports.vector = vector;
|
|
|
157
159
|
*
|
|
158
160
|
* @complexity O(n)
|
|
159
161
|
*
|
|
160
|
-
* @tsplus
|
|
161
|
-
* @tsplus operator fncts.Vector +
|
|
162
|
+
* @tsplus pipeable fncts.Vector append
|
|
163
|
+
* @tsplus pipeable-operator fncts.Vector +
|
|
162
164
|
*/
|
|
163
|
-
function append_1(
|
|
164
|
-
|
|
165
|
+
function append_1(a) {
|
|
166
|
+
return as => {
|
|
167
|
+
const suffixSize = (0, tsplus_module_2.getSuffixSize)(as);
|
|
165
168
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
+
if (suffixSize < 32) {
|
|
170
|
+
return new tsplus_module_1.Vector((0, tsplus_module_2.incrementSuffix)(as.bits), as.offset, as.length + 1, as.prefix, as.root, (0, tsplus_module_2.affixPush)(a, as.suffix, suffixSize));
|
|
171
|
+
}
|
|
169
172
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
const newSuffix = [a];
|
|
174
|
+
const newVector = mutableClone_1(as);
|
|
175
|
+
(0, tsplus_module_2.appendNodeToTree)(newVector, as.suffix);
|
|
176
|
+
newVector.suffix = newSuffix;
|
|
177
|
+
newVector.length++;
|
|
178
|
+
newVector.bits = (0, tsplus_module_2.setSuffix)(1, newVector.bits);
|
|
179
|
+
return newVector;
|
|
180
|
+
};
|
|
177
181
|
}
|
|
178
182
|
/**
|
|
179
183
|
* Maps a function over a Vector and concatenates all the resulting
|
|
180
184
|
* Vectors together.
|
|
181
185
|
*
|
|
182
|
-
* @tsplus
|
|
186
|
+
* @tsplus pipeable fncts.Vector flatMap
|
|
183
187
|
*/
|
|
184
188
|
|
|
185
189
|
|
|
186
|
-
function
|
|
187
|
-
return
|
|
190
|
+
function flatMap(f) {
|
|
191
|
+
return ma => {
|
|
192
|
+
return flatten_1(map_1(f)(ma));
|
|
193
|
+
};
|
|
188
194
|
}
|
|
189
195
|
/**
|
|
190
196
|
* Splits the Vector into chunks of the given size.
|
|
191
197
|
*
|
|
192
|
-
* @tsplus
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
function
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
198
|
+
* @tsplus pipeable fncts.Vector chunksOf
|
|
199
|
+
*/
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
function chunksOf(size) {
|
|
203
|
+
return as => {
|
|
204
|
+
const {
|
|
205
|
+
buffer,
|
|
206
|
+
l2
|
|
207
|
+
} = foldLeft_1({
|
|
208
|
+
l2: emptyPushable_1(),
|
|
209
|
+
buffer: emptyPushable_1()
|
|
210
|
+
}, ({
|
|
211
|
+
buffer,
|
|
212
|
+
l2
|
|
213
|
+
}, elem) => {
|
|
214
|
+
tsplus_module_2.push(elem)(buffer);
|
|
215
|
+
|
|
216
|
+
if (buffer.length === size) {
|
|
217
|
+
return {
|
|
218
|
+
l2: tsplus_module_2.push(buffer)(l2),
|
|
219
|
+
buffer: emptyPushable_1()
|
|
220
|
+
};
|
|
221
|
+
} else {
|
|
222
|
+
return {
|
|
223
|
+
l2,
|
|
224
|
+
buffer
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
})(as);
|
|
228
|
+
return buffer.length === 0 ? l2 : tsplus_module_2.push(buffer)(l2);
|
|
229
|
+
};
|
|
230
|
+
}
|
|
208
231
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
return {
|
|
216
|
-
l2,
|
|
217
|
-
buffer
|
|
218
|
-
};
|
|
232
|
+
function concat_1(that) {
|
|
233
|
+
return self => {
|
|
234
|
+
if (self.length === 0) {
|
|
235
|
+
return that;
|
|
236
|
+
} else if (that.length === 0) {
|
|
237
|
+
return self;
|
|
219
238
|
}
|
|
220
|
-
});
|
|
221
|
-
return buffer.length === 0 ? l2 : tsplus_module_2.push(l2, buffer);
|
|
222
|
-
}
|
|
223
239
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
} else if (that.length === 0) {
|
|
228
|
-
return self;
|
|
229
|
-
}
|
|
240
|
+
const newSize = self.length + that.length;
|
|
241
|
+
const rightSuffixSize = (0, tsplus_module_2.getSuffixSize)(that);
|
|
242
|
+
let newVector = mutableClone_1(self);
|
|
230
243
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
244
|
+
if (that.root === undefined) {
|
|
245
|
+
// right is nothing but a prefix and a suffix
|
|
246
|
+
const nrOfAffixes = (0, tsplus_module_2.concatAffixes)(self, that);
|
|
234
247
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
248
|
+
for (let i = 0; i < nrOfAffixes; ++i) {
|
|
249
|
+
newVector = (0, tsplus_module_2.appendNodeToTree)(newVector, tsplus_module_2.concatBuffer[i]);
|
|
250
|
+
newVector.length += tsplus_module_2.concatBuffer[i].length; // wipe pointer, otherwise it might end up keeping the array alive
|
|
238
251
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
newVector.length += tsplus_module_2.concatBuffer[i].length; // wipe pointer, otherwise it might end up keeping the array alive
|
|
252
|
+
tsplus_module_2.concatBuffer[i] = undefined;
|
|
253
|
+
}
|
|
242
254
|
|
|
243
|
-
|
|
244
|
-
|
|
255
|
+
newVector.length = newSize;
|
|
256
|
+
newVector.suffix = tsplus_module_2.concatBuffer[nrOfAffixes];
|
|
257
|
+
newVector.bits = (0, tsplus_module_2.setSuffix)(tsplus_module_2.concatBuffer[nrOfAffixes].length, newVector.bits);
|
|
258
|
+
tsplus_module_2.concatBuffer[nrOfAffixes] = undefined;
|
|
259
|
+
return newVector;
|
|
260
|
+
} else {
|
|
261
|
+
const leftSuffixSize = (0, tsplus_module_2.getSuffixSize)(self);
|
|
245
262
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
return newVector;
|
|
251
|
-
} else {
|
|
252
|
-
const leftSuffixSize = (0, tsplus_module_2.getSuffixSize)(self);
|
|
263
|
+
if (leftSuffixSize > 0) {
|
|
264
|
+
newVector = (0, tsplus_module_2.appendNodeToTree)(newVector, self.suffix.slice(0, leftSuffixSize));
|
|
265
|
+
newVector.length += leftSuffixSize;
|
|
266
|
+
}
|
|
253
267
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
268
|
+
newVector = (0, tsplus_module_2.appendNodeToTree)(newVector, that.prefix.slice(0, (0, tsplus_module_2.getPrefixSize)(that)).reverse());
|
|
269
|
+
const newNode = (0, tsplus_module_2.concatSubTree)(newVector.root, (0, tsplus_module_2.getDepth)(newVector), that.root, (0, tsplus_module_2.getDepth)(that), true);
|
|
270
|
+
const newDepth = (0, tsplus_module_2.getHeight)(newNode);
|
|
271
|
+
(0, tsplus_module_2.setSizes)(newNode, newDepth);
|
|
272
|
+
newVector.root = newNode;
|
|
273
|
+
newVector.offset &= ~(tsplus_module_2.mask << (0, tsplus_module_2.getDepth)(self) * tsplus_module_2.branchBits);
|
|
274
|
+
newVector.length = newSize;
|
|
275
|
+
newVector.bits = (0, tsplus_module_2.setSuffix)(rightSuffixSize, (0, tsplus_module_2.setDepth)(newDepth, newVector.bits));
|
|
276
|
+
newVector.suffix = that.suffix;
|
|
277
|
+
return newVector;
|
|
257
278
|
}
|
|
258
|
-
|
|
259
|
-
newVector = (0, tsplus_module_2.appendNodeToTree)(newVector, that.prefix.slice(0, (0, tsplus_module_2.getPrefixSize)(that)).reverse());
|
|
260
|
-
const newNode = (0, tsplus_module_2.concatSubTree)(newVector.root, (0, tsplus_module_2.getDepth)(newVector), that.root, (0, tsplus_module_2.getDepth)(that), true);
|
|
261
|
-
const newDepth = (0, tsplus_module_2.getHeight)(newNode);
|
|
262
|
-
(0, tsplus_module_2.setSizes)(newNode, newDepth);
|
|
263
|
-
newVector.root = newNode;
|
|
264
|
-
newVector.offset &= ~(tsplus_module_2.mask << (0, tsplus_module_2.getDepth)(self) * tsplus_module_2.branchBits);
|
|
265
|
-
newVector.length = newSize;
|
|
266
|
-
newVector.bits = (0, tsplus_module_2.setSuffix)(rightSuffixSize, (0, tsplus_module_2.setDepth)(newDepth, newVector.bits));
|
|
267
|
-
newVector.suffix = that.suffix;
|
|
268
|
-
return newVector;
|
|
269
|
-
}
|
|
279
|
+
};
|
|
270
280
|
}
|
|
271
281
|
|
|
272
282
|
const containsState = {
|
|
@@ -282,36 +292,42 @@ function containsCb(value, state) {
|
|
|
282
292
|
* Otherwise it returns `false`.
|
|
283
293
|
*
|
|
284
294
|
* @complexity O(n)
|
|
285
|
-
* @tsplus
|
|
295
|
+
* @tsplus pipeable fncts.Vector contains
|
|
286
296
|
*/
|
|
287
297
|
|
|
288
298
|
|
|
289
|
-
function
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
299
|
+
function contains(element) {
|
|
300
|
+
return as => {
|
|
301
|
+
containsState.element = element;
|
|
302
|
+
containsState.result = false;
|
|
303
|
+
return (0, tsplus_module_2.foldLeftCb)(containsCb, containsState, as).result;
|
|
304
|
+
};
|
|
293
305
|
}
|
|
294
306
|
/**
|
|
295
307
|
* Returns a new Vector without the first `n` elements.
|
|
296
308
|
*
|
|
297
309
|
* @complexity `O(log(n))`
|
|
298
|
-
* @tsplus
|
|
310
|
+
* @tsplus pipeable fncts.Vector drop
|
|
299
311
|
*/
|
|
300
312
|
|
|
301
313
|
|
|
302
|
-
function
|
|
303
|
-
return
|
|
314
|
+
function drop(n) {
|
|
315
|
+
return as => {
|
|
316
|
+
return slice_1(n, as.length)(as);
|
|
317
|
+
};
|
|
304
318
|
}
|
|
305
319
|
/**
|
|
306
320
|
* Returns a new Vector without the last `n` elements.
|
|
307
321
|
*
|
|
308
322
|
* @complexity `O(log(n))`
|
|
309
|
-
* @tsplus
|
|
323
|
+
* @tsplus pipeable fncts.Vector dropLast
|
|
310
324
|
*/
|
|
311
325
|
|
|
312
326
|
|
|
313
|
-
function
|
|
314
|
-
return
|
|
327
|
+
function dropLast(n) {
|
|
328
|
+
return as => {
|
|
329
|
+
return slice_1(0, as.length - n)(as);
|
|
330
|
+
};
|
|
315
331
|
}
|
|
316
332
|
/**
|
|
317
333
|
* Returns a new Vector without repeated elements.
|
|
@@ -322,19 +338,21 @@ function dropLast_(as, n) {
|
|
|
322
338
|
|
|
323
339
|
|
|
324
340
|
function dropRepeats(as) {
|
|
325
|
-
return dropRepeatsWith_1(
|
|
341
|
+
return dropRepeatsWith_1(tsplus_module_3.strictEquals)(as);
|
|
326
342
|
}
|
|
327
343
|
/**
|
|
328
344
|
* Returns a new Vector without repeated elements by using the given
|
|
329
345
|
* function to determine when elements are equal.
|
|
330
346
|
*
|
|
331
347
|
* @complexity `O(n)`
|
|
332
|
-
* @tsplus
|
|
348
|
+
* @tsplus pipeable fncts.Vector dropRepeatsWith
|
|
333
349
|
*/
|
|
334
350
|
|
|
335
351
|
|
|
336
|
-
function dropRepeatsWith_1(
|
|
337
|
-
return
|
|
352
|
+
function dropRepeatsWith_1(predicate) {
|
|
353
|
+
return as => {
|
|
354
|
+
return foldLeft_1(emptyPushable_1(), (acc, a) => acc.length !== 0 && predicate(unsafeLast_1(acc), a) ? acc : tsplus_module_2.push(a)(acc))(as);
|
|
355
|
+
};
|
|
338
356
|
}
|
|
339
357
|
|
|
340
358
|
function findNotIndexCb(value, state) {
|
|
@@ -351,62 +369,68 @@ function findNotIndexCb(value, state) {
|
|
|
351
369
|
*
|
|
352
370
|
* @complexity `O(k + log(n))` where `k` is the number of elements
|
|
353
371
|
* satisfying the predicate.
|
|
354
|
-
* @tsplus
|
|
372
|
+
* @tsplus pipeable fncts.Vector dropWhile
|
|
355
373
|
*/
|
|
356
374
|
|
|
357
375
|
|
|
358
|
-
function
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
376
|
+
function dropWhile(predicate) {
|
|
377
|
+
return as => {
|
|
378
|
+
const {
|
|
379
|
+
index
|
|
380
|
+
} = (0, tsplus_module_2.foldLeftCb)(findNotIndexCb, {
|
|
381
|
+
predicate,
|
|
382
|
+
index: 0
|
|
383
|
+
}, as);
|
|
384
|
+
return slice_1(index, as.length)(as);
|
|
385
|
+
};
|
|
366
386
|
}
|
|
367
387
|
|
|
368
388
|
function elemCb(value, state) {
|
|
369
389
|
return !(state.result = state.equals(value, state.element));
|
|
370
390
|
}
|
|
371
391
|
/**
|
|
372
|
-
* @tsplus
|
|
392
|
+
* @tsplus pipeable fncts.Vector elem
|
|
373
393
|
*/
|
|
374
394
|
|
|
375
395
|
|
|
376
|
-
function
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
396
|
+
function elem(a,
|
|
397
|
+
/** @tsplus auto */
|
|
398
|
+
E) {
|
|
399
|
+
const elemState = {
|
|
400
|
+
equals: E.equals,
|
|
401
|
+
element: undefined,
|
|
402
|
+
result: false
|
|
403
|
+
};
|
|
404
|
+
return self => {
|
|
405
|
+
elemState.element = a;
|
|
406
|
+
return (0, tsplus_module_2.foldLeftCb)(elemCb, elemState, self).result;
|
|
387
407
|
};
|
|
388
408
|
}
|
|
389
409
|
/**
|
|
390
410
|
* Returns true if the two Vectors are equivalent.
|
|
391
411
|
*
|
|
392
412
|
* @complexity O(n)
|
|
393
|
-
* @tsplus
|
|
413
|
+
* @tsplus pipeable fncts.Vector equals
|
|
394
414
|
*/
|
|
395
415
|
|
|
396
416
|
|
|
397
|
-
function
|
|
398
|
-
return
|
|
417
|
+
function equals(that) {
|
|
418
|
+
return self => {
|
|
419
|
+
return tsplus_module_4.corresponds(that, tsplus_module_3.strictEquals)(self);
|
|
420
|
+
};
|
|
399
421
|
}
|
|
400
422
|
|
|
401
423
|
function everyCb(value, state) {
|
|
402
424
|
return state.result = state.predicate(value);
|
|
403
425
|
}
|
|
404
426
|
|
|
405
|
-
function
|
|
406
|
-
return
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
427
|
+
function every(predicate) {
|
|
428
|
+
return as => {
|
|
429
|
+
return (0, tsplus_module_2.foldLeftCb)(everyCb, {
|
|
430
|
+
predicate,
|
|
431
|
+
result: true
|
|
432
|
+
}, as).result;
|
|
433
|
+
};
|
|
410
434
|
}
|
|
411
435
|
/**
|
|
412
436
|
* Creates an empty Vector.
|
|
@@ -437,27 +461,31 @@ function existsCb(value, state) {
|
|
|
437
461
|
*
|
|
438
462
|
* @complexity O(n)
|
|
439
463
|
*
|
|
440
|
-
* @tsplus
|
|
464
|
+
* @tsplus pipeable fncts.Vector exists
|
|
441
465
|
*/
|
|
442
466
|
|
|
443
467
|
|
|
444
|
-
function exists_1(
|
|
445
|
-
return
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
468
|
+
function exists_1(predicate) {
|
|
469
|
+
return as => {
|
|
470
|
+
return (0, tsplus_module_2.foldLeftCb)(existsCb, {
|
|
471
|
+
predicate,
|
|
472
|
+
result: false
|
|
473
|
+
}, as).result;
|
|
474
|
+
};
|
|
449
475
|
}
|
|
450
476
|
/**
|
|
451
477
|
* Returns the _first_ element for which the predicate returns `true`.
|
|
452
478
|
* If no such element is found the function returns `undefined`.
|
|
453
479
|
*
|
|
454
480
|
* @complexity O(n)
|
|
455
|
-
* @tsplus
|
|
481
|
+
* @tsplus pipeable fncts.Vector find
|
|
456
482
|
*/
|
|
457
483
|
|
|
458
484
|
|
|
459
|
-
function
|
|
460
|
-
return
|
|
485
|
+
function find(predicate) {
|
|
486
|
+
return as => {
|
|
487
|
+
return tsplus_module_5.fromNullable(unsafeFind_1(predicate)(as));
|
|
488
|
+
};
|
|
461
489
|
}
|
|
462
490
|
|
|
463
491
|
function findIndexCb(value, state) {
|
|
@@ -470,32 +498,36 @@ function findIndexCb(value, state) {
|
|
|
470
498
|
* `-1`.
|
|
471
499
|
*
|
|
472
500
|
* @complexity O(n)
|
|
473
|
-
* @tsplus
|
|
501
|
+
* @tsplus pipeable fncts.Vector findIndex
|
|
474
502
|
*/
|
|
475
503
|
|
|
476
504
|
|
|
477
|
-
function findIndex_1(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
505
|
+
function findIndex_1(predicate) {
|
|
506
|
+
return as => {
|
|
507
|
+
const {
|
|
508
|
+
found,
|
|
509
|
+
index
|
|
510
|
+
} = (0, tsplus_module_2.foldLeftCb)(findIndexCb, {
|
|
511
|
+
predicate,
|
|
512
|
+
found: false,
|
|
513
|
+
index: -1
|
|
514
|
+
}, as);
|
|
515
|
+
return found ? index : -1;
|
|
516
|
+
};
|
|
487
517
|
}
|
|
488
518
|
/**
|
|
489
519
|
* Returns the _last_ element for which the predicate returns `true`.
|
|
490
520
|
* If no such element is found the function returns `undefined`.
|
|
491
521
|
*
|
|
492
522
|
* @complexity O(n)
|
|
493
|
-
* @tsplus
|
|
523
|
+
* @tsplus pipeable fncts.Vector findLast
|
|
494
524
|
*/
|
|
495
525
|
|
|
496
526
|
|
|
497
|
-
function
|
|
498
|
-
return
|
|
527
|
+
function findLast(predicate) {
|
|
528
|
+
return as => {
|
|
529
|
+
return tsplus_module_5.fromNullable(unsafeFindLast_1(predicate)(as));
|
|
530
|
+
};
|
|
499
531
|
}
|
|
500
532
|
/**
|
|
501
533
|
* Returns the index of the `last` element for which the predicate
|
|
@@ -503,20 +535,22 @@ function findLast_(as, predicate) {
|
|
|
503
535
|
* `-1`.
|
|
504
536
|
*
|
|
505
537
|
* @complexity O(n)
|
|
506
|
-
* @tsplus
|
|
538
|
+
* @tsplus pipeable fncts.Vector findLastIndex
|
|
507
539
|
*/
|
|
508
540
|
|
|
509
541
|
|
|
510
|
-
function
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
542
|
+
function findLastIndex(predicate) {
|
|
543
|
+
return as => {
|
|
544
|
+
const {
|
|
545
|
+
found,
|
|
546
|
+
index
|
|
547
|
+
} = (0, tsplus_module_2.foldRightCb)(findIndexCb, {
|
|
548
|
+
predicate,
|
|
549
|
+
found: false,
|
|
550
|
+
index: -0
|
|
551
|
+
}, as);
|
|
552
|
+
return found ? index : -1;
|
|
553
|
+
};
|
|
520
554
|
}
|
|
521
555
|
/**
|
|
522
556
|
* Flattens a Vector of Vectors into a Vector. Note that this function does
|
|
@@ -529,7 +563,7 @@ function findLastIndex_(as, predicate) {
|
|
|
529
563
|
|
|
530
564
|
|
|
531
565
|
function flatten_1(mma) {
|
|
532
|
-
return foldLeft_1(
|
|
566
|
+
return foldLeft_1(empty_1(), (acc, a) => concat_1(a)(acc))(mma);
|
|
533
567
|
}
|
|
534
568
|
|
|
535
569
|
function from(sequence) {
|
|
@@ -537,14 +571,14 @@ function from(sequence) {
|
|
|
537
571
|
|
|
538
572
|
if (sequence.length > 0 && (sequence[0] !== undefined || 0 in sequence)) {
|
|
539
573
|
for (let i = 0; i < sequence.length; ++i) {
|
|
540
|
-
tsplus_module_2.push(
|
|
574
|
+
tsplus_module_2.push(sequence[i])(l);
|
|
541
575
|
}
|
|
542
576
|
} else if (Symbol.iterator in sequence) {
|
|
543
577
|
const iterator = sequence[Symbol.iterator]();
|
|
544
578
|
let cur;
|
|
545
579
|
|
|
546
580
|
while (!(cur = iterator.next()).done) {
|
|
547
|
-
tsplus_module_2.push(
|
|
581
|
+
tsplus_module_2.push(cur.value)(l);
|
|
548
582
|
}
|
|
549
583
|
}
|
|
550
584
|
|
|
@@ -553,28 +587,32 @@ function from(sequence) {
|
|
|
553
587
|
/**
|
|
554
588
|
* Folds a function over a Vector. Left-associative.
|
|
555
589
|
*
|
|
556
|
-
* @tsplus
|
|
590
|
+
* @tsplus pipeable fncts.Vector foldLeft
|
|
557
591
|
*/
|
|
558
592
|
|
|
559
593
|
|
|
560
|
-
function foldLeft_1(
|
|
561
|
-
return
|
|
594
|
+
function foldLeft_1(initial, f) {
|
|
595
|
+
return fa => {
|
|
596
|
+
return foldLeftWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
|
|
597
|
+
};
|
|
562
598
|
}
|
|
563
599
|
/**
|
|
564
|
-
* @tsplus
|
|
600
|
+
* @tsplus pipeable fncts.Vector foldLeftWithIndex
|
|
565
601
|
*/
|
|
566
602
|
|
|
567
603
|
|
|
568
|
-
function foldLeftWithIndex_1(
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
604
|
+
function foldLeftWithIndex_1(b, f) {
|
|
605
|
+
return fa => {
|
|
606
|
+
const suffixSize = (0, tsplus_module_2.getSuffixSize)(fa);
|
|
607
|
+
const prefixSize = (0, tsplus_module_2.getPrefixSize)(fa);
|
|
608
|
+
let [acc, index] = (0, tsplus_module_2.foldLeftPrefix)(f, b, fa.prefix, prefixSize);
|
|
572
609
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
610
|
+
if (fa.root !== undefined) {
|
|
611
|
+
[acc, index] = (0, tsplus_module_2.foldLeftNode)(f, acc, fa.root, (0, tsplus_module_2.getDepth)(fa), index);
|
|
612
|
+
}
|
|
576
613
|
|
|
577
|
-
|
|
614
|
+
return (0, tsplus_module_2.foldLeftSuffix)(f, acc, fa.suffix, suffixSize, index)[0];
|
|
615
|
+
};
|
|
578
616
|
}
|
|
579
617
|
/**
|
|
580
618
|
* Similar to `foldl`. But, for each element it calls the predicate function
|
|
@@ -601,82 +639,94 @@ function foldWhileCb(a, state, i) {
|
|
|
601
639
|
return true;
|
|
602
640
|
}
|
|
603
641
|
/**
|
|
604
|
-
* @tsplus
|
|
642
|
+
* @tsplus pipeable fncts.Vector foldLeftWhile
|
|
605
643
|
*/
|
|
606
644
|
|
|
607
645
|
|
|
608
|
-
function
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
646
|
+
function foldLeftWhile(b, cont, f) {
|
|
647
|
+
return fa => {
|
|
648
|
+
if (!cont(b)) {
|
|
649
|
+
return b;
|
|
650
|
+
}
|
|
612
651
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
652
|
+
return (0, tsplus_module_2.foldLeftCb)(foldWhileCb, {
|
|
653
|
+
predicate: cont,
|
|
654
|
+
f,
|
|
655
|
+
result: b
|
|
656
|
+
}, fa).result;
|
|
657
|
+
};
|
|
618
658
|
}
|
|
619
659
|
/**
|
|
620
|
-
* @tsplus
|
|
660
|
+
* @tsplus pipeable fncts.Vector foldRightWhile
|
|
621
661
|
*/
|
|
622
662
|
|
|
623
663
|
|
|
624
|
-
function
|
|
625
|
-
return
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
664
|
+
function foldRightWhile(b, cont, f) {
|
|
665
|
+
return fa => {
|
|
666
|
+
return (0, tsplus_module_2.foldRightCb)(foldWhileCb, {
|
|
667
|
+
predicate: cont,
|
|
668
|
+
result: b,
|
|
669
|
+
f: (i, b, a) => f(i, a, b)
|
|
670
|
+
}, fa).result;
|
|
671
|
+
};
|
|
630
672
|
}
|
|
631
673
|
/**
|
|
632
|
-
* @tsplus
|
|
674
|
+
* @tsplus pipeable fncts.Vector foldMap
|
|
633
675
|
*/
|
|
634
676
|
|
|
635
677
|
|
|
636
|
-
function
|
|
678
|
+
function foldMap(f,
|
|
637
679
|
/** @tsplus auto */
|
|
638
680
|
M) {
|
|
639
|
-
return
|
|
681
|
+
return self => {
|
|
682
|
+
return foldMapWithIndex_1((_, a) => f(a), M)(self);
|
|
683
|
+
};
|
|
640
684
|
}
|
|
641
685
|
/**
|
|
642
|
-
* @tsplus
|
|
686
|
+
* @tsplus pipeable fncts.Vector foldMapWithIndex
|
|
643
687
|
*/
|
|
644
688
|
|
|
645
689
|
|
|
646
|
-
function foldMapWithIndex_1(
|
|
690
|
+
function foldMapWithIndex_1(f,
|
|
647
691
|
/** @tsplus auto */
|
|
648
692
|
M) {
|
|
649
|
-
return
|
|
693
|
+
return self => {
|
|
694
|
+
return foldLeftWithIndex_1(M.nat, (i, b, a) => M.combine(b, f(i, a)))(self);
|
|
695
|
+
};
|
|
650
696
|
}
|
|
651
697
|
/**
|
|
652
698
|
* Folds a function over a Vector. Right-associative.
|
|
653
699
|
*
|
|
654
700
|
* @complexity O(n)
|
|
655
|
-
* @tsplus
|
|
701
|
+
* @tsplus pipeable fncts.Vector foldRight
|
|
656
702
|
*/
|
|
657
703
|
|
|
658
704
|
|
|
659
|
-
function
|
|
660
|
-
return
|
|
705
|
+
function foldRight(initial, f) {
|
|
706
|
+
return fa => {
|
|
707
|
+
return foldRightWithIndex_1(initial, (_, a, b) => f(a, b))(fa);
|
|
708
|
+
};
|
|
661
709
|
}
|
|
662
710
|
/**
|
|
663
711
|
* Folds a function over a Vector. Right-associative.
|
|
664
712
|
*
|
|
665
713
|
* @complexity O(n)
|
|
666
|
-
* @tsplus
|
|
714
|
+
* @tsplus pipeable fncts.Vector foldRightWithIndex
|
|
667
715
|
*/
|
|
668
716
|
|
|
669
717
|
|
|
670
|
-
function foldRightWithIndex_1(
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
718
|
+
function foldRightWithIndex_1(b, f) {
|
|
719
|
+
return fa => {
|
|
720
|
+
const suffixSize = (0, tsplus_module_2.getSuffixSize)(fa);
|
|
721
|
+
const prefixSize = (0, tsplus_module_2.getPrefixSize)(fa);
|
|
722
|
+
let [acc, j] = (0, tsplus_module_2.foldRightSuffix)(f, b, fa.suffix, suffixSize, fa.length - 1);
|
|
674
723
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
724
|
+
if (fa.root !== undefined) {
|
|
725
|
+
[acc, j] = (0, tsplus_module_2.foldRightNode)(f, acc, fa.root, (0, tsplus_module_2.getDepth)(fa), j);
|
|
726
|
+
}
|
|
678
727
|
|
|
679
|
-
|
|
728
|
+
return (0, tsplus_module_2.foldRightPrefix)(f, acc, fa.prefix, prefixSize, j)[0];
|
|
729
|
+
};
|
|
680
730
|
}
|
|
681
731
|
/**
|
|
682
732
|
* Invokes a given callback for each element in the Vector from left to
|
|
@@ -688,32 +738,38 @@ function foldRightWithIndex_1(fa, b, f) {
|
|
|
688
738
|
* makes `forEach` faster when the new Vector is unneeded.
|
|
689
739
|
*
|
|
690
740
|
* @complexity O(n)
|
|
691
|
-
* @tsplus
|
|
741
|
+
* @tsplus pipeable fncts.Vector forEach
|
|
692
742
|
*/
|
|
693
743
|
|
|
694
744
|
|
|
695
|
-
function forEach_1(
|
|
696
|
-
|
|
745
|
+
function forEach_1(f) {
|
|
746
|
+
return as => {
|
|
747
|
+
foldLeft_1(undefined, (_, element) => f(element))(as);
|
|
748
|
+
};
|
|
697
749
|
}
|
|
698
750
|
/**
|
|
699
|
-
* @tsplus
|
|
751
|
+
* @tsplus pipeable fncts.Vector forEachWithIndex
|
|
700
752
|
*/
|
|
701
753
|
|
|
702
754
|
|
|
703
|
-
function
|
|
704
|
-
|
|
755
|
+
function forEachWithIndex(f) {
|
|
756
|
+
return as => {
|
|
757
|
+
foldLeftWithIndex_1(undefined, (index, _, element) => f(index, element))(as);
|
|
758
|
+
};
|
|
705
759
|
}
|
|
706
760
|
/**
|
|
707
761
|
* Gets the nth element of the Vector. If `n` is out of bounds
|
|
708
762
|
* `undefined` is returned.
|
|
709
763
|
*
|
|
710
764
|
* @complexity O(log(n))
|
|
711
|
-
* @tsplus
|
|
765
|
+
* @tsplus pipeable fncts.Vector get
|
|
712
766
|
*/
|
|
713
767
|
|
|
714
768
|
|
|
715
|
-
function
|
|
716
|
-
return
|
|
769
|
+
function get(index) {
|
|
770
|
+
return self => {
|
|
771
|
+
return tsplus_module_5.fromNullable(unsafeGet_1(index)(self));
|
|
772
|
+
};
|
|
717
773
|
}
|
|
718
774
|
/**
|
|
719
775
|
* Returns a Vector of Vectors where each subvector's elements are pairwise
|
|
@@ -723,22 +779,24 @@ function get_(self, index) {
|
|
|
723
779
|
* equal elements should be grouped together the Vector should be sorted
|
|
724
780
|
* before grouping.
|
|
725
781
|
*
|
|
726
|
-
* @tsplus
|
|
782
|
+
* @tsplus pipeable fncts.Vector groupWith
|
|
727
783
|
*/
|
|
728
784
|
|
|
729
785
|
|
|
730
|
-
function
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
786
|
+
function groupWith(f) {
|
|
787
|
+
return as => {
|
|
788
|
+
const result = emptyPushable_1();
|
|
789
|
+
let buffer = emptyPushable_1();
|
|
790
|
+
forEach_1(a => {
|
|
791
|
+
if (buffer.length !== 0 && !f(unsafeLast_1(buffer), a)) {
|
|
792
|
+
tsplus_module_2.push(buffer)(result);
|
|
793
|
+
buffer = emptyPushable_1();
|
|
794
|
+
}
|
|
738
795
|
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
796
|
+
tsplus_module_2.push(a)(buffer);
|
|
797
|
+
})(as);
|
|
798
|
+
return buffer.length === 0 ? result : tsplus_module_2.push(buffer)(result);
|
|
799
|
+
};
|
|
742
800
|
}
|
|
743
801
|
/**
|
|
744
802
|
* Returns the first element of the Vector.
|
|
@@ -761,50 +819,58 @@ function indexOfCb(value, state) {
|
|
|
761
819
|
* to the given element. If no such element is found `-1` is returned.
|
|
762
820
|
*
|
|
763
821
|
* @complexity O(n)
|
|
764
|
-
* @tsplus
|
|
822
|
+
* @tsplus pipeable fncts.Vector indexOf
|
|
765
823
|
*/
|
|
766
824
|
|
|
767
825
|
|
|
768
|
-
function
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
826
|
+
function indexOf(element) {
|
|
827
|
+
return as => {
|
|
828
|
+
const state = {
|
|
829
|
+
element,
|
|
830
|
+
found: false,
|
|
831
|
+
index: -1
|
|
832
|
+
};
|
|
833
|
+
(0, tsplus_module_2.foldLeftCb)(indexOfCb, state, as);
|
|
834
|
+
return state.found ? state.index : -1;
|
|
773
835
|
};
|
|
774
|
-
(0, tsplus_module_2.foldLeftCb)(indexOfCb, state, as);
|
|
775
|
-
return state.found ? state.index : -1;
|
|
776
836
|
}
|
|
777
837
|
/**
|
|
778
838
|
* Inserts the given element at the given index in the Vector.
|
|
779
839
|
*
|
|
780
840
|
* @complexity O(log(n))
|
|
781
|
-
* @tsplus
|
|
841
|
+
* @tsplus pipeable fncts.Vector insertAt
|
|
782
842
|
*/
|
|
783
843
|
|
|
784
844
|
|
|
785
|
-
function
|
|
786
|
-
return
|
|
845
|
+
function insertAt(index, element) {
|
|
846
|
+
return as => {
|
|
847
|
+
return concat_1(slice_1(index, as.length)(as))(append_1(element)(slice_1(0, index)(as)));
|
|
848
|
+
};
|
|
787
849
|
}
|
|
788
850
|
/**
|
|
789
851
|
* Inserts the given Vector of elements at the given index in the Vector.
|
|
790
852
|
*
|
|
791
853
|
* @complexity `O(log(n))`
|
|
792
|
-
* @tsplus
|
|
854
|
+
* @tsplus pipeable fncts.Vector insertAllAt
|
|
793
855
|
*/
|
|
794
856
|
|
|
795
857
|
|
|
796
|
-
function
|
|
797
|
-
return
|
|
858
|
+
function insertAllAt(index, elements) {
|
|
859
|
+
return as => {
|
|
860
|
+
return concat_1(slice_1(index, as.length)(as))(concat_1(elements)(slice_1(0, index)(as)));
|
|
861
|
+
};
|
|
798
862
|
}
|
|
799
863
|
/**
|
|
800
864
|
* Inserts a separator between each element in a Vector.
|
|
801
865
|
*
|
|
802
|
-
* @tsplus
|
|
866
|
+
* @tsplus pipeable fncts.Vector intersperse
|
|
803
867
|
*/
|
|
804
868
|
|
|
805
869
|
|
|
806
|
-
function
|
|
807
|
-
return
|
|
870
|
+
function intersperse(separator) {
|
|
871
|
+
return as => {
|
|
872
|
+
return pop_1(foldLeft_1(emptyPushable_1(), (l2, a) => tsplus_module_2.push(separator)(tsplus_module_2.push(a)(l2)))(as));
|
|
873
|
+
};
|
|
808
874
|
}
|
|
809
875
|
/**
|
|
810
876
|
* @tsplus fluent fncts.Vector isEmpty
|
|
@@ -825,12 +891,14 @@ function isNonEmpty(l) {
|
|
|
825
891
|
/**
|
|
826
892
|
* Concatenates the strings in the Vector separated by a specified separator.
|
|
827
893
|
*
|
|
828
|
-
* @tsplus
|
|
894
|
+
* @tsplus pipeable fncts.Vector join
|
|
829
895
|
*/
|
|
830
896
|
|
|
831
897
|
|
|
832
|
-
function
|
|
833
|
-
return
|
|
898
|
+
function join(separator) {
|
|
899
|
+
return as => {
|
|
900
|
+
return foldLeft_1("", (a, b) => a.length === 0 ? b : a + separator + b)(as);
|
|
901
|
+
};
|
|
834
902
|
}
|
|
835
903
|
/**
|
|
836
904
|
* Returns the last element of the Vector.
|
|
@@ -848,18 +916,20 @@ function last(l) {
|
|
|
848
916
|
* to the given element. If no such element is found `-1` is returned.
|
|
849
917
|
*
|
|
850
918
|
* @complexity O(n)
|
|
851
|
-
* @tsplus
|
|
919
|
+
* @tsplus pipeable fncts.Vector lastIndexOf
|
|
852
920
|
*/
|
|
853
921
|
|
|
854
922
|
|
|
855
|
-
function
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
923
|
+
function lastIndexOf(element) {
|
|
924
|
+
return as => {
|
|
925
|
+
const state = {
|
|
926
|
+
element,
|
|
927
|
+
found: false,
|
|
928
|
+
index: 0
|
|
929
|
+
};
|
|
930
|
+
(0, tsplus_module_2.foldRightCb)(indexOfCb, state, as);
|
|
931
|
+
return state.found ? as.length - state.index : -1;
|
|
860
932
|
};
|
|
861
|
-
(0, tsplus_module_2.foldRightCb)(indexOfCb, state, as);
|
|
862
|
-
return state.found ? as.length - state.index : -1;
|
|
863
933
|
}
|
|
864
934
|
/**
|
|
865
935
|
* Generates a new Vector by calling a function with the current index
|
|
@@ -874,46 +944,52 @@ function makeBy(n, f) {
|
|
|
874
944
|
const l = emptyPushable_1();
|
|
875
945
|
|
|
876
946
|
for (let i = 0; i < n; i++) {
|
|
877
|
-
tsplus_module_2.push(
|
|
947
|
+
tsplus_module_2.push(f(i))(l);
|
|
878
948
|
}
|
|
879
949
|
|
|
880
950
|
return l;
|
|
881
951
|
}
|
|
882
952
|
/**
|
|
883
|
-
* @tsplus
|
|
953
|
+
* @tsplus pipeable fncts.Vector mapAccum
|
|
884
954
|
*/
|
|
885
955
|
|
|
886
956
|
|
|
887
|
-
function
|
|
888
|
-
return
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
957
|
+
function mapAccum(s, f) {
|
|
958
|
+
return fa => {
|
|
959
|
+
return foldLeft_1([emptyPushable_1(), s], ([acc, s], a) => {
|
|
960
|
+
const r = f(s, a);
|
|
961
|
+
tsplus_module_2.push(r[0])(acc);
|
|
962
|
+
return [acc, r[1]];
|
|
963
|
+
})(fa);
|
|
964
|
+
};
|
|
893
965
|
}
|
|
894
966
|
/**
|
|
895
967
|
* Applies a function to each element in the given Vector and returns a
|
|
896
968
|
* new Vector of the values that the function return.
|
|
897
969
|
*
|
|
898
970
|
* @complexity O(n)
|
|
899
|
-
* @tsplus
|
|
971
|
+
* @tsplus pipeable fncts.Vector map
|
|
900
972
|
*/
|
|
901
973
|
|
|
902
974
|
|
|
903
|
-
function map_1(
|
|
904
|
-
return
|
|
975
|
+
function map_1(f) {
|
|
976
|
+
return fa => {
|
|
977
|
+
return mapWithIndex_1((_, a) => f(a))(fa);
|
|
978
|
+
};
|
|
905
979
|
}
|
|
906
980
|
/**
|
|
907
981
|
* Applies a function to each element in the given Vector and returns a
|
|
908
982
|
* new Vector of the values that the function return.
|
|
909
983
|
*
|
|
910
984
|
* @complexity O(n)
|
|
911
|
-
* @tsplus
|
|
985
|
+
* @tsplus pipeable fncts.Vector mapWithIndex
|
|
912
986
|
*/
|
|
913
987
|
|
|
914
988
|
|
|
915
|
-
function mapWithIndex_1(
|
|
916
|
-
return
|
|
989
|
+
function mapWithIndex_1(f) {
|
|
990
|
+
return fa => {
|
|
991
|
+
return new tsplus_module_1.Vector(fa.bits, fa.offset, fa.length, (0, tsplus_module_2.mapPrefix)(f, fa.prefix, (0, tsplus_module_2.getPrefixSize)(fa)), fa.root === undefined ? undefined : (0, tsplus_module_2.mapNode)(f, fa.root, (0, tsplus_module_2.getDepth)(fa), (0, tsplus_module_2.getPrefixSize)(fa), 1)[0], (0, tsplus_module_2.mapAffix)(f, fa.suffix, (0, tsplus_module_2.getSuffixSize)(fa), fa.length));
|
|
992
|
+
};
|
|
917
993
|
}
|
|
918
994
|
/**
|
|
919
995
|
* @tsplus getter fncts.Vector mutableClone
|
|
@@ -932,16 +1008,18 @@ function mutableClone_1(as) {
|
|
|
932
1008
|
*
|
|
933
1009
|
* @complexity `O(log(n))`
|
|
934
1010
|
*
|
|
935
|
-
* @tsplus
|
|
1011
|
+
* @tsplus pipeable fncts.Vector modifyAt
|
|
936
1012
|
*/
|
|
937
1013
|
|
|
938
1014
|
|
|
939
|
-
function
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1015
|
+
function modifyAt(i, f) {
|
|
1016
|
+
return as => {
|
|
1017
|
+
if (i < 0 || as.length <= i) {
|
|
1018
|
+
return as;
|
|
1019
|
+
}
|
|
943
1020
|
|
|
944
|
-
|
|
1021
|
+
return updateAt_1(i, f(unsafeGet_1(i)(as)))(as);
|
|
1022
|
+
};
|
|
945
1023
|
}
|
|
946
1024
|
/**
|
|
947
1025
|
* Returns `true` if and only if the predicate function returns
|
|
@@ -949,12 +1027,14 @@ function modifyAt_(as, i, f) {
|
|
|
949
1027
|
*
|
|
950
1028
|
* @complexity O(n)
|
|
951
1029
|
*
|
|
952
|
-
* @tsplus
|
|
1030
|
+
* @tsplus pipeable fncts.Vector none
|
|
953
1031
|
*/
|
|
954
1032
|
|
|
955
1033
|
|
|
956
|
-
function
|
|
957
|
-
return
|
|
1034
|
+
function none(predicate) {
|
|
1035
|
+
return as => {
|
|
1036
|
+
return !exists_1(predicate)(as);
|
|
1037
|
+
};
|
|
958
1038
|
}
|
|
959
1039
|
/**
|
|
960
1040
|
* Takes two arguments and returns a Vector that contains them.
|
|
@@ -977,31 +1057,33 @@ function pair(first, second) {
|
|
|
977
1057
|
|
|
978
1058
|
|
|
979
1059
|
function pop_1(as) {
|
|
980
|
-
return slice_1(
|
|
1060
|
+
return slice_1(0, -1)(as);
|
|
981
1061
|
}
|
|
982
1062
|
/**
|
|
983
1063
|
* Prepends an element to the front of a Vector and returns the new Vector.
|
|
984
1064
|
*
|
|
985
1065
|
* @complexity O(1)
|
|
986
1066
|
*
|
|
987
|
-
* @tsplus
|
|
1067
|
+
* @tsplus pipeable fncts.Vector prepend
|
|
988
1068
|
*/
|
|
989
1069
|
|
|
990
1070
|
|
|
991
|
-
function prepend_1(
|
|
992
|
-
|
|
1071
|
+
function prepend_1(a) {
|
|
1072
|
+
return as => {
|
|
1073
|
+
const prefixSize = (0, tsplus_module_2.getPrefixSize)(as);
|
|
993
1074
|
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1075
|
+
if (prefixSize < 32) {
|
|
1076
|
+
return new tsplus_module_1.Vector((0, tsplus_module_2.incrementPrefix)(as.bits), as.offset, as.length + 1, (0, tsplus_module_2.affixPush)(a, as.prefix, prefixSize), as.root, as.suffix);
|
|
1077
|
+
} else {
|
|
1078
|
+
const newVector = mutableClone_1(as);
|
|
1079
|
+
(0, tsplus_module_2.prependNodeToTree)(newVector, (0, tsplus_module_2.reverseArray)(as.prefix));
|
|
1080
|
+
const newPrefix = [a];
|
|
1081
|
+
newVector.prefix = newPrefix;
|
|
1082
|
+
newVector.length++;
|
|
1083
|
+
newVector.bits = (0, tsplus_module_2.setPrefix)(1, newVector.bits);
|
|
1084
|
+
return newVector;
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
1005
1087
|
}
|
|
1006
1088
|
/**
|
|
1007
1089
|
* @tsplus operator fncts.Vector +
|
|
@@ -1009,7 +1091,7 @@ function prepend_1(as, a) {
|
|
|
1009
1091
|
|
|
1010
1092
|
|
|
1011
1093
|
function prependOperator(a, as) {
|
|
1012
|
-
return prepend_1(
|
|
1094
|
+
return prepend_1(a)(as);
|
|
1013
1095
|
}
|
|
1014
1096
|
/**
|
|
1015
1097
|
* Returns a Vector of numbers between an inclusive lower bound and an exclusive upper bound.
|
|
@@ -1023,7 +1105,7 @@ function range(start, end) {
|
|
|
1023
1105
|
const vec = emptyPushable_1();
|
|
1024
1106
|
|
|
1025
1107
|
for (let i = start; i < end; ++i) {
|
|
1026
|
-
tsplus_module_2.push(
|
|
1108
|
+
tsplus_module_2.push(i)(vec);
|
|
1027
1109
|
}
|
|
1028
1110
|
|
|
1029
1111
|
return vec;
|
|
@@ -1035,12 +1117,14 @@ function range(start, end) {
|
|
|
1035
1117
|
*
|
|
1036
1118
|
* @complexity `O(log(n))`
|
|
1037
1119
|
*
|
|
1038
|
-
* @tsplus
|
|
1120
|
+
* @tsplus pipeable fncts.Vector remove
|
|
1039
1121
|
*/
|
|
1040
1122
|
|
|
1041
1123
|
|
|
1042
|
-
function
|
|
1043
|
-
return
|
|
1124
|
+
function remove(from, amount) {
|
|
1125
|
+
return as => {
|
|
1126
|
+
return concat_1(slice_1(from + amount, as.length)(as))(slice_1(0, from)(as));
|
|
1127
|
+
};
|
|
1044
1128
|
}
|
|
1045
1129
|
/**
|
|
1046
1130
|
* Returns a Vector of a given length that contains the specified value
|
|
@@ -1056,7 +1140,7 @@ function replicate(n, a) {
|
|
|
1056
1140
|
const l = emptyPushable_1();
|
|
1057
1141
|
|
|
1058
1142
|
while (--t >= 0) {
|
|
1059
|
-
tsplus_module_2.push(
|
|
1143
|
+
tsplus_module_2.push(a)(l);
|
|
1060
1144
|
}
|
|
1061
1145
|
|
|
1062
1146
|
return l;
|
|
@@ -1067,18 +1151,20 @@ function replicate(n, a) {
|
|
|
1067
1151
|
|
|
1068
1152
|
|
|
1069
1153
|
function reverse(self) {
|
|
1070
|
-
return foldLeft_1(
|
|
1154
|
+
return foldLeft_1(empty_1(), (vec, elem) => prepend_1(elem)(vec))(self);
|
|
1071
1155
|
}
|
|
1072
1156
|
/**
|
|
1073
1157
|
* Folds a function over a Vector from left to right while collecting
|
|
1074
1158
|
* all the intermediate steps in a resulting Vector.
|
|
1075
1159
|
*
|
|
1076
|
-
* @tsplus
|
|
1160
|
+
* @tsplus pipeable fncts.Vector scanLeft
|
|
1077
1161
|
*/
|
|
1078
1162
|
|
|
1079
1163
|
|
|
1080
|
-
function
|
|
1081
|
-
return
|
|
1164
|
+
function scanLeft(initial, f) {
|
|
1165
|
+
return as => {
|
|
1166
|
+
return foldLeft_1(tsplus_module_2.push(initial)(emptyPushable_1()), (l2, a) => tsplus_module_2.push(f(unsafeLast_1(l2), a))(l2))(as);
|
|
1167
|
+
};
|
|
1082
1168
|
}
|
|
1083
1169
|
/**
|
|
1084
1170
|
* Takes a single arguments and returns a singleton Vector that contains it.
|
|
@@ -1097,115 +1183,119 @@ function single(a) {
|
|
|
1097
1183
|
* from the right end of the Vector.
|
|
1098
1184
|
*
|
|
1099
1185
|
* @complexity `O(log(n))`
|
|
1100
|
-
* @tsplus
|
|
1186
|
+
* @tsplus pipeable fncts.Vector slice
|
|
1101
1187
|
*/
|
|
1102
1188
|
|
|
1103
1189
|
|
|
1104
|
-
function slice_1(
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1190
|
+
function slice_1(from, to) {
|
|
1191
|
+
return as => {
|
|
1192
|
+
let {
|
|
1193
|
+
bits,
|
|
1194
|
+
length
|
|
1195
|
+
} = as;
|
|
1196
|
+
let _to = to;
|
|
1197
|
+
let _from = from;
|
|
1198
|
+
_to = Math.min(length, to); // Handle negative indices
|
|
1112
1199
|
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1200
|
+
if (_from < 0) {
|
|
1201
|
+
_from = length + from;
|
|
1202
|
+
}
|
|
1116
1203
|
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1204
|
+
if (_to < 0) {
|
|
1205
|
+
_to = length + to;
|
|
1206
|
+
} // Should we just return the empty Vector?
|
|
1120
1207
|
|
|
1121
1208
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1209
|
+
if (_to <= _from || _to <= 0 || length <= _from) {
|
|
1210
|
+
return empty_1();
|
|
1211
|
+
} // Return Vector unchanged if we are slicing nothing off
|
|
1125
1212
|
|
|
1126
1213
|
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1214
|
+
if (_from <= 0 && length <= _to) {
|
|
1215
|
+
return as;
|
|
1216
|
+
}
|
|
1130
1217
|
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1218
|
+
const newLength = _to - _from;
|
|
1219
|
+
let prefixSize = (0, tsplus_module_2.getPrefixSize)(as);
|
|
1220
|
+
const suffixSize = (0, tsplus_module_2.getSuffixSize)(as); // Both indices lie in the prefix
|
|
1134
1221
|
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1222
|
+
if (_to <= prefixSize) {
|
|
1223
|
+
return new tsplus_module_1.Vector((0, tsplus_module_2.setPrefix)(newLength, 0), 0, newLength, as.prefix.slice(prefixSize - _to, prefixSize - _from), undefined, tsplus_module_2.emptyAffix);
|
|
1224
|
+
}
|
|
1138
1225
|
|
|
1139
|
-
|
|
1226
|
+
const suffixStart = length - suffixSize; // Both indices lie in the suffix
|
|
1140
1227
|
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1228
|
+
if (suffixStart <= _from) {
|
|
1229
|
+
return new tsplus_module_1.Vector((0, tsplus_module_2.setSuffix)(newLength, 0), 0, newLength, tsplus_module_2.emptyAffix, undefined, as.suffix.slice(_from - suffixStart, _to - suffixStart));
|
|
1230
|
+
}
|
|
1144
1231
|
|
|
1145
|
-
|
|
1146
|
-
|
|
1232
|
+
const newVector = mutableClone_1(as);
|
|
1233
|
+
newVector.length = newLength; // Both indices lie in the tree
|
|
1147
1234
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1235
|
+
if (prefixSize <= _from && _to <= suffixStart) {
|
|
1236
|
+
(0, tsplus_module_2.sliceTreeVector)(_from - prefixSize + as.offset, _to - prefixSize + as.offset - 1, as.root, (0, tsplus_module_2.getDepth)(as), as.offset, newVector);
|
|
1237
|
+
return newVector;
|
|
1238
|
+
}
|
|
1152
1239
|
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1240
|
+
if (0 < _from) {
|
|
1241
|
+
// we need _to slice something off of the left
|
|
1242
|
+
if (_from < prefixSize) {
|
|
1243
|
+
// shorten the prefix even though it's not strictly needed,
|
|
1244
|
+
// so that referenced items can be GC'd
|
|
1245
|
+
newVector.prefix = as.prefix.slice(0, prefixSize - _from);
|
|
1246
|
+
bits = (0, tsplus_module_2.setPrefix)(prefixSize - _from, bits);
|
|
1247
|
+
} else {
|
|
1248
|
+
// if we're here `_to` can't lie in the tree, so we can set the
|
|
1249
|
+
// root
|
|
1250
|
+
(0, tsplus_module_2.zeroOffset)();
|
|
1251
|
+
newVector.root = (0, tsplus_module_2.sliceLeft)(newVector.root, (0, tsplus_module_2.getDepth)(as), _from - prefixSize, as.offset, true);
|
|
1252
|
+
newVector.offset = tsplus_module_2.newOffset;
|
|
1253
|
+
|
|
1254
|
+
if (newVector.root === undefined) {
|
|
1255
|
+
bits = (0, tsplus_module_2.setDepth)(0, bits);
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
bits = (0, tsplus_module_2.setPrefix)(tsplus_module_2.newAffix.length, bits);
|
|
1259
|
+
prefixSize = tsplus_module_2.newAffix.length;
|
|
1260
|
+
newVector.prefix = tsplus_module_2.newAffix;
|
|
1169
1261
|
}
|
|
1170
|
-
|
|
1171
|
-
bits = (0, tsplus_module_2.setPrefix)(tsplus_module_2.newAffix.length, bits);
|
|
1172
|
-
prefixSize = tsplus_module_2.newAffix.length;
|
|
1173
|
-
newVector.prefix = tsplus_module_2.newAffix;
|
|
1174
1262
|
}
|
|
1175
|
-
}
|
|
1176
1263
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1264
|
+
if (_to < length) {
|
|
1265
|
+
// we need _to slice something off of the right
|
|
1266
|
+
if (length - _to < suffixSize) {
|
|
1267
|
+
bits = (0, tsplus_module_2.setSuffix)(suffixSize - (length - _to), bits); // slice the suffix even though it's not strictly needed,
|
|
1268
|
+
// _to allow the removed items _to be GC'd
|
|
1182
1269
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1270
|
+
newVector.suffix = as.suffix.slice(0, suffixSize - (length - _to));
|
|
1271
|
+
} else {
|
|
1272
|
+
newVector.root = (0, tsplus_module_2.sliceRight)(newVector.root, (0, tsplus_module_2.getDepth)(as), _to - prefixSize - 1, newVector.offset);
|
|
1186
1273
|
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1274
|
+
if (newVector.root === undefined) {
|
|
1275
|
+
bits = (0, tsplus_module_2.setDepth)(0, bits);
|
|
1276
|
+
newVector.offset = 0;
|
|
1277
|
+
}
|
|
1191
1278
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1279
|
+
bits = (0, tsplus_module_2.setSuffix)(tsplus_module_2.newAffix.length, bits);
|
|
1280
|
+
newVector.suffix = tsplus_module_2.newAffix;
|
|
1281
|
+
}
|
|
1194
1282
|
}
|
|
1195
|
-
}
|
|
1196
1283
|
|
|
1197
|
-
|
|
1198
|
-
|
|
1284
|
+
newVector.bits = bits;
|
|
1285
|
+
return newVector;
|
|
1286
|
+
};
|
|
1199
1287
|
}
|
|
1200
1288
|
/**
|
|
1201
|
-
* @tsplus
|
|
1289
|
+
* @tsplus pipeable fncts.Vector sort
|
|
1202
1290
|
*/
|
|
1203
1291
|
|
|
1204
1292
|
|
|
1205
|
-
function
|
|
1293
|
+
function sort(
|
|
1206
1294
|
/** @tsplus auto */
|
|
1207
1295
|
O) {
|
|
1208
|
-
return
|
|
1296
|
+
return self => {
|
|
1297
|
+
return sortWith_1(O.compare)(self);
|
|
1298
|
+
};
|
|
1209
1299
|
}
|
|
1210
1300
|
/**
|
|
1211
1301
|
* Sort the given Vector by comparing values using the given function.
|
|
@@ -1216,34 +1306,36 @@ O) {
|
|
|
1216
1306
|
*
|
|
1217
1307
|
* @complexity O(n * log(n))
|
|
1218
1308
|
*
|
|
1219
|
-
* @tsplus
|
|
1220
|
-
*/
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
function sortWith_1(
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1309
|
+
* @tsplus pipeable fncts.Vector sortWith
|
|
1310
|
+
*/
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
function sortWith_1(compare) {
|
|
1314
|
+
return as => {
|
|
1315
|
+
const arr = [];
|
|
1316
|
+
let i = 0;
|
|
1317
|
+
forEach_1(elm => arr.push({
|
|
1318
|
+
idx: i++,
|
|
1319
|
+
elm
|
|
1320
|
+
}))(as);
|
|
1321
|
+
arr.sort(({
|
|
1322
|
+
elm: a,
|
|
1323
|
+
idx: i
|
|
1324
|
+
}, {
|
|
1325
|
+
elm: b,
|
|
1326
|
+
idx: j
|
|
1327
|
+
}) => {
|
|
1328
|
+
const c = compare(a, b);
|
|
1329
|
+
return c !== 0 ? c : i < j ? -1 : 1;
|
|
1330
|
+
});
|
|
1331
|
+
const newL = emptyPushable_1();
|
|
1332
|
+
|
|
1333
|
+
for (let i = 0; i < arr.length; ++i) {
|
|
1334
|
+
tsplus_module_2.push(arr[i].elm)(newL);
|
|
1335
|
+
}
|
|
1245
1336
|
|
|
1246
|
-
|
|
1337
|
+
return newL;
|
|
1338
|
+
};
|
|
1247
1339
|
}
|
|
1248
1340
|
/**
|
|
1249
1341
|
* Splits a Vector at the given index and return the two sides in a pair.
|
|
@@ -1253,12 +1345,14 @@ function sortWith_1(as, compare) {
|
|
|
1253
1345
|
*
|
|
1254
1346
|
* @complexity `O(log(n))`
|
|
1255
1347
|
*
|
|
1256
|
-
* @tsplus
|
|
1348
|
+
* @tsplus pipeable fncts.Vector splitAt
|
|
1257
1349
|
*/
|
|
1258
1350
|
|
|
1259
1351
|
|
|
1260
|
-
function splitAt_1(
|
|
1261
|
-
return
|
|
1352
|
+
function splitAt_1(index) {
|
|
1353
|
+
return as => {
|
|
1354
|
+
return [slice_1(0, index)(as), slice_1(index, as.length)(as)];
|
|
1355
|
+
};
|
|
1262
1356
|
}
|
|
1263
1357
|
/**
|
|
1264
1358
|
* Splits a Vector at the first element in the Vector for which the given
|
|
@@ -1266,13 +1360,15 @@ function splitAt_1(as, index) {
|
|
|
1266
1360
|
*
|
|
1267
1361
|
* @complexity `O(n)`
|
|
1268
1362
|
*
|
|
1269
|
-
* @tsplus
|
|
1363
|
+
* @tsplus pipeable fncts.Vector splitWhen
|
|
1270
1364
|
*/
|
|
1271
1365
|
|
|
1272
1366
|
|
|
1273
|
-
function
|
|
1274
|
-
|
|
1275
|
-
|
|
1367
|
+
function splitWhen(predicate) {
|
|
1368
|
+
return as => {
|
|
1369
|
+
const idx = findIndex_1(predicate)(as);
|
|
1370
|
+
return idx === -1 ? [as, empty_1()] : splitAt_1(idx)(as);
|
|
1371
|
+
};
|
|
1276
1372
|
}
|
|
1277
1373
|
/**
|
|
1278
1374
|
* Returns a new Vector with the first element removed. If the Vector is
|
|
@@ -1285,18 +1381,20 @@ function splitWhen_(as, predicate) {
|
|
|
1285
1381
|
|
|
1286
1382
|
|
|
1287
1383
|
function tail(as) {
|
|
1288
|
-
return slice_1(
|
|
1384
|
+
return slice_1(1, as.length)(as);
|
|
1289
1385
|
}
|
|
1290
1386
|
/**
|
|
1291
1387
|
* Takes the first `n` elements from a Vector and returns them in a new Vector.
|
|
1292
1388
|
*
|
|
1293
1389
|
* @complexity `O(log(n))`
|
|
1294
|
-
* @tsplus
|
|
1390
|
+
* @tsplus pipeable fncts.Vector take
|
|
1295
1391
|
*/
|
|
1296
1392
|
|
|
1297
1393
|
|
|
1298
|
-
function
|
|
1299
|
-
return
|
|
1394
|
+
function take(n) {
|
|
1395
|
+
return as => {
|
|
1396
|
+
return slice_1(0, n)(as);
|
|
1397
|
+
};
|
|
1300
1398
|
}
|
|
1301
1399
|
/**
|
|
1302
1400
|
* Takes the first elements in the Vector for which the predicate returns
|
|
@@ -1305,30 +1403,34 @@ function take_(as, n) {
|
|
|
1305
1403
|
* @complexity `O(k + log(n))` where `k` is the number of elements satisfying
|
|
1306
1404
|
* the predicate.
|
|
1307
1405
|
*
|
|
1308
|
-
* @tsplus
|
|
1406
|
+
* @tsplus pipeable fncts.Vector takeWhile
|
|
1309
1407
|
*/
|
|
1310
1408
|
|
|
1311
1409
|
|
|
1312
|
-
function
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1410
|
+
function takeWhile(predicate) {
|
|
1411
|
+
return as => {
|
|
1412
|
+
const {
|
|
1413
|
+
index
|
|
1414
|
+
} = (0, tsplus_module_2.foldLeftCb)(findNotIndexCb, {
|
|
1415
|
+
predicate,
|
|
1416
|
+
index: 0
|
|
1417
|
+
}, as);
|
|
1418
|
+
return slice_1(0, index)(as);
|
|
1419
|
+
};
|
|
1320
1420
|
}
|
|
1321
1421
|
/**
|
|
1322
1422
|
* Takes the last `n` elements from a Vector and returns them in a new
|
|
1323
1423
|
* Vector.
|
|
1324
1424
|
*
|
|
1325
1425
|
* @complexity `O(log(n))`
|
|
1326
|
-
* @tsplus
|
|
1426
|
+
* @tsplus pipeable fncts.Vector takeLast
|
|
1327
1427
|
*/
|
|
1328
1428
|
|
|
1329
1429
|
|
|
1330
|
-
function
|
|
1331
|
-
return
|
|
1430
|
+
function takeLast(n) {
|
|
1431
|
+
return as => {
|
|
1432
|
+
return slice_1(as.length - n, as.length)(as);
|
|
1433
|
+
};
|
|
1332
1434
|
}
|
|
1333
1435
|
/**
|
|
1334
1436
|
* Takes the last elements in the Vector for which the predicate returns
|
|
@@ -1337,18 +1439,20 @@ function takeLast_(as, n) {
|
|
|
1337
1439
|
* @complexity `O(k + log(n))` where `k` is the number of elements
|
|
1338
1440
|
* satisfying the predicate.
|
|
1339
1441
|
*
|
|
1340
|
-
* @tsplus
|
|
1442
|
+
* @tsplus pipeable fncts.Vector takeLastWhile
|
|
1341
1443
|
*/
|
|
1342
1444
|
|
|
1343
1445
|
|
|
1344
|
-
function
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1446
|
+
function takeLastWhile(predicate) {
|
|
1447
|
+
return as => {
|
|
1448
|
+
const {
|
|
1449
|
+
index
|
|
1450
|
+
} = (0, tsplus_module_2.foldRightCb)(findNotIndexCb, {
|
|
1451
|
+
predicate,
|
|
1452
|
+
index: 0
|
|
1453
|
+
}, as);
|
|
1454
|
+
return slice_1(as.length - index, as.length)(as);
|
|
1455
|
+
};
|
|
1352
1456
|
}
|
|
1353
1457
|
/**
|
|
1354
1458
|
* Converts a Vector into an array.
|
|
@@ -1359,7 +1463,7 @@ function takeLastWhile_(as, predicate) {
|
|
|
1359
1463
|
|
|
1360
1464
|
|
|
1361
1465
|
function toArray(self) {
|
|
1362
|
-
return foldLeft_1(
|
|
1466
|
+
return foldLeft_1([], tsplus_module_2.arrayPush)(self);
|
|
1363
1467
|
}
|
|
1364
1468
|
/**
|
|
1365
1469
|
* Converts a Vector into a List.
|
|
@@ -1371,30 +1475,32 @@ function toArray(self) {
|
|
|
1371
1475
|
|
|
1372
1476
|
function toList(self) {
|
|
1373
1477
|
const buffer = new tsplus_module_6.ListBuffer();
|
|
1374
|
-
forEach_1(
|
|
1478
|
+
forEach_1(a => {
|
|
1375
1479
|
buffer.append(a);
|
|
1376
|
-
});
|
|
1480
|
+
})(self);
|
|
1377
1481
|
return buffer.toList;
|
|
1378
1482
|
}
|
|
1379
|
-
/**
|
|
1380
|
-
* @tsplus getter fncts.Vector traverseWithIndex
|
|
1381
|
-
*/
|
|
1382
|
-
|
|
1383
1483
|
|
|
1384
|
-
|
|
1385
|
-
return foldLeftWithIndex_1(
|
|
1386
|
-
|
|
1484
|
+
function _traverseWithIndex_1(self) {
|
|
1485
|
+
return G => f => foldLeftWithIndex_1(G.pure(emptyPushable_1()), (i, b, a) => G.zipWith(f(i, a), (v, b) => {
|
|
1486
|
+
tsplus_module_2.push(b)(v);
|
|
1387
1487
|
return v;
|
|
1388
|
-
}));
|
|
1389
|
-
}
|
|
1390
|
-
const traverseWithIndex = traverseWithIndex_1;
|
|
1488
|
+
})(b))(self);
|
|
1489
|
+
}
|
|
1391
1490
|
/**
|
|
1392
1491
|
* @tsplus getter fncts.Vector traverse
|
|
1393
1492
|
*/
|
|
1394
1493
|
|
|
1494
|
+
|
|
1495
|
+
function _traverse(self) {
|
|
1496
|
+
return G => f => _traverseWithIndex_1(self)(G)((_, a) => f(a));
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
const traverseWithIndex = G => f => self => _traverseWithIndex_1(self)(G)(f);
|
|
1500
|
+
|
|
1395
1501
|
exports.traverseWithIndex = traverseWithIndex;
|
|
1396
1502
|
|
|
1397
|
-
const traverse =
|
|
1503
|
+
const traverse = G => f => self => _traverseWithIndex_1(self)(G)((_, a) => f(a));
|
|
1398
1504
|
/**
|
|
1399
1505
|
* Returns a new Vector without repeated elements by using the given
|
|
1400
1506
|
* Eq instance to determine when elements are equal
|
|
@@ -1407,7 +1513,7 @@ const traverse = self => G => f => traverseWithIndex_1(self)(G)((_, a) => f(a));
|
|
|
1407
1513
|
exports.traverse = traverse;
|
|
1408
1514
|
|
|
1409
1515
|
function uniq(as) {
|
|
1410
|
-
return E => dropRepeatsWith_1(
|
|
1516
|
+
return E => dropRepeatsWith_1(E.equals)(as);
|
|
1411
1517
|
}
|
|
1412
1518
|
/**
|
|
1413
1519
|
* @tsplus static fncts.VectorOps unfold
|
|
@@ -1421,9 +1527,9 @@ function unfold(b, f) {
|
|
|
1421
1527
|
while (true) {
|
|
1422
1528
|
const mt = f(state);
|
|
1423
1529
|
|
|
1424
|
-
if (
|
|
1530
|
+
if (tsplus_module_7.isJust(mt)) {
|
|
1425
1531
|
const [a, b] = mt.value;
|
|
1426
|
-
tsplus_module_2.push(
|
|
1532
|
+
tsplus_module_2.push(a)(out);
|
|
1427
1533
|
state = b;
|
|
1428
1534
|
} else {
|
|
1429
1535
|
break;
|
|
@@ -1446,59 +1552,66 @@ function findCb(value, state) {
|
|
|
1446
1552
|
* If no such element is found the function returns `undefined`.
|
|
1447
1553
|
*
|
|
1448
1554
|
* @complexity O(n)
|
|
1449
|
-
* @tsplus
|
|
1555
|
+
* @tsplus pipeable fncts.Vector unsafeFind
|
|
1450
1556
|
*/
|
|
1451
1557
|
|
|
1452
1558
|
|
|
1453
|
-
function unsafeFind_1(
|
|
1454
|
-
return
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1559
|
+
function unsafeFind_1(predicate) {
|
|
1560
|
+
return as => {
|
|
1561
|
+
return (0, tsplus_module_2.foldLeftCb)(findCb, {
|
|
1562
|
+
predicate,
|
|
1563
|
+
result: undefined
|
|
1564
|
+
}, as).result;
|
|
1565
|
+
};
|
|
1458
1566
|
}
|
|
1459
1567
|
/**
|
|
1460
1568
|
* Returns the _last_ element for which the predicate returns `true`.
|
|
1461
1569
|
* If no such element is found the function returns `undefined`.
|
|
1462
1570
|
*
|
|
1463
1571
|
* @complexity O(n)
|
|
1464
|
-
* @tsplus
|
|
1572
|
+
* @tsplus pipeable fncts.Vector unsafeFindLast
|
|
1465
1573
|
*/
|
|
1466
1574
|
|
|
1467
1575
|
|
|
1468
|
-
function unsafeFindLast_1(
|
|
1469
|
-
return
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1576
|
+
function unsafeFindLast_1(predicate) {
|
|
1577
|
+
return as => {
|
|
1578
|
+
return (0, tsplus_module_2.foldRightCb)(findCb, {
|
|
1579
|
+
predicate,
|
|
1580
|
+
result: undefined
|
|
1581
|
+
}, as).result;
|
|
1582
|
+
};
|
|
1473
1583
|
}
|
|
1474
1584
|
/**
|
|
1475
1585
|
* Gets the nth element of the Vector. If `n` is out of bounds
|
|
1476
1586
|
* `undefined` is returned.
|
|
1477
1587
|
*
|
|
1478
1588
|
* @complexity O(log(n))
|
|
1479
|
-
* @tsplus
|
|
1589
|
+
* @tsplus pipeable fncts.Vector unsafeGet
|
|
1590
|
+
* @tsplus pipeable-index fncts.Vector
|
|
1480
1591
|
*/
|
|
1481
1592
|
|
|
1482
1593
|
|
|
1483
|
-
function unsafeGet_1(
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1594
|
+
function unsafeGet_1(index) {
|
|
1595
|
+
return l => {
|
|
1596
|
+
if (index < 0 || l.length <= index) {
|
|
1597
|
+
return undefined;
|
|
1598
|
+
}
|
|
1487
1599
|
|
|
1488
|
-
|
|
1489
|
-
|
|
1600
|
+
const prefixSize = (0, tsplus_module_2.getPrefixSize)(l);
|
|
1601
|
+
const suffixSize = (0, tsplus_module_2.getSuffixSize)(l);
|
|
1490
1602
|
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1603
|
+
if (index < prefixSize) {
|
|
1604
|
+
return l.prefix[prefixSize - index - 1];
|
|
1605
|
+
} else if (index >= l.length - suffixSize) {
|
|
1606
|
+
return l.suffix[index - (l.length - suffixSize)];
|
|
1607
|
+
}
|
|
1496
1608
|
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1609
|
+
const {
|
|
1610
|
+
offset
|
|
1611
|
+
} = l;
|
|
1612
|
+
const depth = (0, tsplus_module_2.getDepth)(l);
|
|
1613
|
+
return l.root.sizes === undefined ? (0, tsplus_module_2.nodeNthDense)(l.root, depth, offset === 0 ? index - prefixSize : (0, tsplus_module_2.handleOffset)(depth, offset, index - prefixSize)) : (0, tsplus_module_2.nodeNth)(l.root, depth, offset, index - prefixSize);
|
|
1614
|
+
};
|
|
1502
1615
|
}
|
|
1503
1616
|
/**
|
|
1504
1617
|
* Returns the first element of the Vector. If the Vector is empty the
|
|
@@ -1532,32 +1645,34 @@ function unsafeLast_1(l) {
|
|
|
1532
1645
|
* If the index is out of bounds the given Vector is returned unchanged.
|
|
1533
1646
|
*
|
|
1534
1647
|
* @complexity O(log(n))
|
|
1535
|
-
* @tsplus
|
|
1648
|
+
* @tsplus pipeable fncts.Vector updateAt
|
|
1536
1649
|
*/
|
|
1537
1650
|
|
|
1538
1651
|
|
|
1539
|
-
function updateAt_1(
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1652
|
+
function updateAt_1(i, a) {
|
|
1653
|
+
return as => {
|
|
1654
|
+
if (i < 0 || as.length <= i) {
|
|
1655
|
+
return as;
|
|
1656
|
+
}
|
|
1543
1657
|
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
if (i < prefixSize) {
|
|
1549
|
-
const newPrefix = (0, tsplus_module_2.copyArray)(newVector.prefix);
|
|
1550
|
-
newPrefix[newPrefix.length - i - 1] = a;
|
|
1551
|
-
newVector.prefix = newPrefix;
|
|
1552
|
-
} else if (i >= as.length - suffixSize) {
|
|
1553
|
-
const newSuffix = (0, tsplus_module_2.copyArray)(newVector.suffix);
|
|
1554
|
-
newSuffix[i - (as.length - suffixSize)] = a;
|
|
1555
|
-
newVector.suffix = newSuffix;
|
|
1556
|
-
} else {
|
|
1557
|
-
newVector.root = (0, tsplus_module_2.updateNode)(as.root, (0, tsplus_module_2.getDepth)(as), i - prefixSize, as.offset, a);
|
|
1558
|
-
}
|
|
1658
|
+
const prefixSize = (0, tsplus_module_2.getPrefixSize)(as);
|
|
1659
|
+
const suffixSize = (0, tsplus_module_2.getSuffixSize)(as);
|
|
1660
|
+
const newVector = mutableClone_1(as);
|
|
1559
1661
|
|
|
1560
|
-
|
|
1662
|
+
if (i < prefixSize) {
|
|
1663
|
+
const newPrefix = (0, tsplus_module_2.copyArray)(newVector.prefix);
|
|
1664
|
+
newPrefix[newPrefix.length - i - 1] = a;
|
|
1665
|
+
newVector.prefix = newPrefix;
|
|
1666
|
+
} else if (i >= as.length - suffixSize) {
|
|
1667
|
+
const newSuffix = (0, tsplus_module_2.copyArray)(newVector.suffix);
|
|
1668
|
+
newSuffix[i - (as.length - suffixSize)] = a;
|
|
1669
|
+
newVector.suffix = newSuffix;
|
|
1670
|
+
} else {
|
|
1671
|
+
newVector.root = (0, tsplus_module_2.updateNode)(as.root, (0, tsplus_module_2.getDepth)(as), i - prefixSize, as.offset, a);
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
return newVector;
|
|
1675
|
+
};
|
|
1561
1676
|
}
|
|
1562
1677
|
/**
|
|
1563
1678
|
* @tsplus static fncts.VectorOps __call
|
|
@@ -1568,7 +1683,7 @@ function vector_1(...elements) {
|
|
|
1568
1683
|
const v = emptyPushable_1();
|
|
1569
1684
|
|
|
1570
1685
|
for (const element of elements) {
|
|
1571
|
-
tsplus_module_2.push(
|
|
1686
|
+
tsplus_module_2.push(element)(v);
|
|
1572
1687
|
}
|
|
1573
1688
|
|
|
1574
1689
|
return v;
|