@fncts/base 0.0.40 → 0.0.41
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/AsyncIterable/api.cjs +384 -0
- package/_cjs/collection/AsyncIterable/api.cjs.map +1 -0
- package/_cjs/collection/AsyncIterable/definition.cjs +2 -0
- package/_cjs/collection/AsyncIterable/definition.cjs.map +1 -0
- package/_cjs/collection/{compat/Array.cjs → AsyncIterable.cjs} +3 -3
- package/_cjs/collection/AsyncIterable.cjs.map +1 -0
- package/_cjs/collection/Iterable/api/traverseConc.cjs +1 -2
- package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -1
- package/_cjs/collection/Iterable/api.cjs +180 -137
- package/_cjs/collection/Iterable/api.cjs.map +1 -1
- package/_cjs/collection/Iterable/constructors.cjs.map +1 -1
- package/_cjs/collection/compat/ArrayLike/api.cjs +1 -2
- package/_cjs/collection/compat/ArrayLike/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/api/makeBy.cjs +1 -2
- package/_cjs/collection/immutable/Conc/api/makeBy.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/api/replicate.cjs +1 -2
- package/_cjs/collection/immutable/Conc/api/replicate.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/api.cjs +1 -2
- package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/constructors.cjs +3 -4
- package/_cjs/collection/immutable/Conc/constructors.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/definition.cjs +3 -3
- package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Dictionary/api.cjs +1 -2
- package/_cjs/collection/immutable/Dictionary/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Dictionary/definition.cjs +1 -2
- package/_cjs/collection/immutable/Dictionary/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/api.cjs +1 -2
- package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/definition.cjs +1 -2
- package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/internal.cjs +1 -2
- package/_cjs/collection/immutable/HashMap/internal.cjs.map +1 -1
- package/_cjs/collection/immutable/HashSet/api.cjs +1 -2
- package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashSet/definition.cjs +1 -2
- package/_cjs/collection/immutable/HashSet/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/List/api/foldLeft.cjs +1 -2
- package/_cjs/collection/immutable/List/api/foldLeft.cjs.map +1 -1
- package/_cjs/collection/immutable/List/api/unsafeTail.cjs +1 -2
- package/_cjs/collection/immutable/List/api/unsafeTail.cjs.map +1 -1
- package/_cjs/collection/immutable/List/api.cjs +3 -4
- package/_cjs/collection/immutable/List/api.cjs.map +1 -1
- package/_cjs/collection/immutable/List/constructors.cjs +1 -2
- package/_cjs/collection/immutable/List/constructors.cjs.map +1 -1
- package/_cjs/collection/immutable/List/definition.cjs +1 -2
- package/_cjs/collection/immutable/List/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Queue/api.cjs +1 -2
- package/_cjs/collection/immutable/Queue/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Queue/constructors.cjs +1 -2
- package/_cjs/collection/immutable/Queue/constructors.cjs.map +1 -1
- package/_cjs/collection/immutable/Queue/definition.cjs +1 -2
- package/_cjs/collection/immutable/Queue/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Queue/guards.cjs +1 -2
- package/_cjs/collection/immutable/Queue/guards.cjs.map +1 -1
- package/_cjs/collection/immutable/ReadonlyArray/api/chunksOf.cjs +18 -0
- package/_cjs/collection/immutable/ReadonlyArray/api/chunksOf.cjs.map +1 -0
- package/_cjs/collection/immutable/ReadonlyArray/api/splitAt.cjs +15 -0
- package/_cjs/collection/immutable/ReadonlyArray/api/splitAt.cjs.map +1 -0
- package/_cjs/collection/immutable/ReadonlyArray/api/splitWhere.cjs +26 -0
- package/_cjs/collection/immutable/ReadonlyArray/api/splitWhere.cjs.map +1 -0
- package/_cjs/collection/immutable/{ImmutableArray → ReadonlyArray}/api.cjs +562 -538
- package/_cjs/collection/immutable/ReadonlyArray/api.cjs.map +1 -0
- package/_cjs/collection/immutable/ReadonlyArray/constructors.cjs +55 -0
- package/_cjs/collection/immutable/ReadonlyArray/constructors.cjs.map +1 -0
- package/_cjs/collection/immutable/ReadonlyArray/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/{ImmutableArray → ReadonlyArray}/instances.cjs +5 -7
- package/_cjs/collection/immutable/ReadonlyArray/instances.cjs.map +1 -0
- package/_cjs/collection/immutable/{ImmutableArray.cjs → ReadonlyArray.cjs} +8 -19
- package/_cjs/collection/immutable/ReadonlyArray.cjs.map +1 -0
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray/api.cjs +472 -0
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray/api.cjs.map +1 -0
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray/constructors.cjs +79 -0
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray/constructors.cjs.map +1 -0
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray/definition.cjs +2 -0
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray/destructors.cjs +49 -0
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray/destructors.cjs.map +1 -0
- package/_cjs/collection/immutable/{ImmutableNonEmptyArray → ReadonlyNonEmptyArray}/instances.cjs +3 -4
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray/instances.cjs.map +1 -0
- package/_cjs/collection/immutable/{ImmutableNonEmptyArray.cjs → ReadonlyNonEmptyArray.cjs} +6 -6
- package/_cjs/collection/immutable/ReadonlyNonEmptyArray.cjs.map +1 -0
- package/_cjs/collection/immutable/RoseTree/api.cjs +1 -2
- package/_cjs/collection/immutable/RoseTree/api.cjs.map +1 -1
- package/_cjs/collection/immutable/RoseTree/definition.cjs +1 -2
- package/_cjs/collection/immutable/RoseTree/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/SortedMap/api.cjs +1 -2
- package/_cjs/collection/immutable/SortedMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/SortedMap/iterator.cjs +1 -2
- package/_cjs/collection/immutable/SortedMap/iterator.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/api.cjs +229 -230
- package/_cjs/collection/immutable/Vector/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/definition.cjs +1 -2
- package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -1
- package/_cjs/collection/mutable/ArrayDeque.cjs +1 -2
- package/_cjs/collection/mutable/ArrayDeque.cjs.map +1 -1
- package/_cjs/collection/mutable/HashMap.cjs +1 -2
- package/_cjs/collection/mutable/HashMap.cjs.map +1 -1
- package/_cjs/collection/mutable/HashSet.cjs +1 -2
- package/_cjs/collection/mutable/HashSet.cjs.map +1 -1
- package/_cjs/collection/mutable/ListBuffer.cjs +1 -2
- package/_cjs/collection/mutable/ListBuffer.cjs.map +1 -1
- package/_cjs/collection/weak/IterableWeakMap.cjs +1 -2
- package/_cjs/collection/weak/IterableWeakMap.cjs.map +1 -1
- package/_cjs/control/Eval/api.cjs +89 -41
- package/_cjs/control/Eval/api.cjs.map +1 -1
- package/_cjs/control/Eval/constructors.cjs +5 -1
- package/_cjs/control/Eval/constructors.cjs.map +1 -1
- package/_cjs/control/Eval/instance.cjs +1 -2
- package/_cjs/control/Eval/instance.cjs.map +1 -1
- package/_cjs/control/Eval/run.cjs +1 -2
- package/_cjs/control/Eval/run.cjs.map +1 -1
- package/_cjs/control/Pure/api.cjs +1 -2
- package/_cjs/control/Pure/api.cjs.map +1 -1
- package/_cjs/control/Pure/definition.cjs +1 -2
- package/_cjs/control/Pure/definition.cjs.map +1 -1
- package/_cjs/control/Pure/instances.cjs +1 -2
- package/_cjs/control/Pure/instances.cjs.map +1 -1
- package/_cjs/control/Pure/runtime.cjs +15 -10
- package/_cjs/control/Pure/runtime.cjs.map +1 -1
- package/_cjs/data/CaseClass.cjs +11 -14
- package/_cjs/data/CaseClass.cjs.map +1 -1
- package/_cjs/data/Cause/api/fold.cjs +33 -34
- package/_cjs/data/Cause/api/fold.cjs.map +1 -1
- package/_cjs/data/Cause/api/isEmpty.cjs +1 -2
- package/_cjs/data/Cause/api/isEmpty.cjs.map +1 -1
- package/_cjs/data/Cause/api/linearize.cjs +1 -2
- package/_cjs/data/Cause/api/linearize.cjs.map +1 -1
- package/_cjs/data/Cause/api/prettyPrint.cjs +1 -2
- package/_cjs/data/Cause/api/prettyPrint.cjs.map +1 -1
- package/_cjs/data/Cause/api/unified.cjs +1 -2
- package/_cjs/data/Cause/api/unified.cjs.map +1 -1
- package/_cjs/data/Cause/api.cjs +1 -2
- package/_cjs/data/Cause/api.cjs.map +1 -1
- package/_cjs/data/Cause/definition.cjs +1 -2
- package/_cjs/data/Cause/definition.cjs.map +1 -1
- package/_cjs/data/Const/api.cjs +7 -7
- package/_cjs/data/Const/api.cjs.map +1 -1
- package/_cjs/data/Const/instances.cjs +12 -13
- package/_cjs/data/Const/instances.cjs.map +1 -1
- package/_cjs/data/Data.cjs +1 -2
- package/_cjs/data/Data.cjs.map +1 -1
- package/_cjs/data/Datum/api.cjs +110 -113
- package/_cjs/data/Datum/api.cjs.map +1 -1
- package/_cjs/data/Datum/definition.cjs +1 -2
- package/_cjs/data/Datum/definition.cjs.map +1 -1
- package/_cjs/data/Datum/instances.cjs +1 -2
- package/_cjs/data/Datum/instances.cjs.map +1 -1
- package/_cjs/data/Datum.cjs +39 -0
- package/_cjs/data/Datum.cjs.map +1 -0
- package/_cjs/data/DatumEither/api.cjs +56 -57
- package/_cjs/data/DatumEither/api.cjs.map +1 -1
- package/_cjs/data/Duration/api.cjs +1 -2
- package/_cjs/data/Duration/api.cjs.map +1 -1
- package/_cjs/data/Duration/definition.cjs +1 -2
- package/_cjs/data/Duration/definition.cjs.map +1 -1
- package/_cjs/data/Either/api/align.cjs +1 -2
- package/_cjs/data/Either/api/align.cjs.map +1 -1
- package/_cjs/data/Either/api/alignWith.cjs +1 -2
- package/_cjs/data/Either/api/alignWith.cjs.map +1 -1
- package/_cjs/data/Either/api.cjs +53 -55
- package/_cjs/data/Either/api.cjs.map +1 -1
- package/_cjs/data/Either/constructors.cjs +21 -22
- package/_cjs/data/Either/constructors.cjs.map +1 -1
- package/_cjs/data/Either/definition.cjs +1 -2
- package/_cjs/data/Either/definition.cjs.map +1 -1
- package/_cjs/data/Either/instances.cjs +1 -2
- package/_cjs/data/Either/instances.cjs.map +1 -1
- package/_cjs/data/EitherT/api.cjs +28 -29
- package/_cjs/data/EitherT/api.cjs.map +1 -1
- package/_cjs/data/Environment/api.cjs +1 -2
- package/_cjs/data/Environment/api.cjs.map +1 -1
- package/_cjs/data/Environment/definition.cjs +1 -2
- package/_cjs/data/Environment/definition.cjs.map +1 -1
- package/_cjs/data/EnvironmentPatch.cjs +2 -3
- package/_cjs/data/EnvironmentPatch.cjs.map +1 -1
- package/_cjs/data/Eq/api.cjs +189 -5
- package/_cjs/data/Eq/api.cjs.map +1 -1
- package/_cjs/data/Eq/derivations.cjs +10 -21
- package/_cjs/data/Eq/derivations.cjs.map +1 -1
- package/_cjs/data/Equatable/api.cjs +1 -2
- package/_cjs/data/Equatable/api.cjs.map +1 -1
- package/_cjs/data/Equatable/definition.cjs +1 -2
- package/_cjs/data/Equatable/definition.cjs.map +1 -1
- package/_cjs/data/Exit/api.cjs +90 -80
- package/_cjs/data/Exit/api.cjs.map +1 -1
- package/_cjs/data/Exit/constructors.cjs +1 -2
- package/_cjs/data/Exit/constructors.cjs.map +1 -1
- package/_cjs/data/Exit/definition.cjs +1 -2
- package/_cjs/data/Exit/definition.cjs.map +1 -1
- package/_cjs/data/FiberId/api.cjs +1 -2
- package/_cjs/data/FiberId/api.cjs.map +1 -1
- package/_cjs/data/FiberId/definition.cjs +1 -2
- package/_cjs/data/FiberId/definition.cjs.map +1 -1
- package/_cjs/data/Guard/api.cjs +13 -17
- package/_cjs/data/Guard/api.cjs.map +1 -1
- package/_cjs/data/HashEq.cjs +1 -2
- package/_cjs/data/HashEq.cjs.map +1 -1
- package/_cjs/data/Hashable/definition.cjs +1 -2
- package/_cjs/data/Hashable/definition.cjs.map +1 -1
- package/_cjs/data/Hashable/hash.cjs +1 -2
- package/_cjs/data/Hashable/hash.cjs.map +1 -1
- package/_cjs/data/Identity/api.cjs +1 -2
- package/_cjs/data/Identity/api.cjs.map +1 -1
- package/_cjs/data/Identity/definition.cjs +1 -2
- package/_cjs/data/Identity/definition.cjs.map +1 -1
- package/_cjs/data/Identity/instances.cjs +1 -2
- package/_cjs/data/Identity/instances.cjs.map +1 -1
- package/_cjs/data/Interval.cjs +1 -2
- package/_cjs/data/Interval.cjs.map +1 -1
- package/_cjs/data/Intervals.cjs +1 -2
- package/_cjs/data/Intervals.cjs.map +1 -1
- package/_cjs/data/Maybe/api.cjs +73 -60
- package/_cjs/data/Maybe/api.cjs.map +1 -1
- package/_cjs/data/Maybe/constructors.cjs +37 -38
- package/_cjs/data/Maybe/constructors.cjs.map +1 -1
- package/_cjs/data/Maybe/definition.cjs +1 -2
- package/_cjs/data/Maybe/definition.cjs.map +1 -1
- package/_cjs/data/Maybe/instances.cjs +1 -2
- package/_cjs/data/Maybe/instances.cjs.map +1 -1
- package/_cjs/data/Newtype.cjs +1 -2
- package/_cjs/data/Newtype.cjs.map +1 -1
- package/_cjs/data/Ord/api.cjs +1 -2
- package/_cjs/data/Ord/api.cjs.map +1 -1
- package/_cjs/data/Ord/definition.cjs +1 -2
- package/_cjs/data/Ord/definition.cjs.map +1 -1
- package/_cjs/data/Ord/instances.cjs +1 -2
- package/_cjs/data/Ord/instances.cjs.map +1 -1
- package/_cjs/data/Showable/definition.cjs +1 -2
- package/_cjs/data/Showable/definition.cjs.map +1 -1
- package/_cjs/data/Showable/show.cjs +1 -2
- package/_cjs/data/Showable/show.cjs.map +1 -1
- package/_cjs/data/Showable/styles.cjs +1 -2
- package/_cjs/data/Showable/styles.cjs.map +1 -1
- package/_cjs/data/Showable/util.cjs +1 -2
- package/_cjs/data/Showable/util.cjs.map +1 -1
- package/_cjs/data/Struct/api.cjs +5 -7
- package/_cjs/data/Struct/api.cjs.map +1 -1
- package/_cjs/data/Struct/definition.cjs +1 -2
- package/_cjs/data/Struct/definition.cjs.map +1 -1
- package/_cjs/data/Tag/constructors.cjs +1 -2
- package/_cjs/data/Tag/constructors.cjs.map +1 -1
- package/_cjs/data/Tag/definition.cjs +1 -2
- package/_cjs/data/Tag/definition.cjs.map +1 -1
- package/_cjs/data/These/api.cjs +86 -87
- package/_cjs/data/These/api.cjs.map +1 -1
- package/_cjs/data/These/constructors.cjs +1 -2
- package/_cjs/data/These/constructors.cjs.map +1 -1
- package/_cjs/data/These/definition.cjs +1 -2
- package/_cjs/data/These/definition.cjs.map +1 -1
- package/_cjs/data/These/destructors.cjs +1 -2
- package/_cjs/data/These/destructors.cjs.map +1 -1
- package/_cjs/data/These/instances.cjs +1 -2
- package/_cjs/data/These/instances.cjs.map +1 -1
- package/_cjs/data/Trace/api.cjs +1 -2
- package/_cjs/data/Trace/api.cjs.map +1 -1
- package/_cjs/data/Trace/constructors.cjs +1 -2
- package/_cjs/data/Trace/constructors.cjs.map +1 -1
- package/_cjs/data/Zipped.cjs +1 -2
- package/_cjs/data/Zipped.cjs.map +1 -1
- package/_cjs/data/bigint/instances.cjs +1 -2
- package/_cjs/data/bigint/instances.cjs.map +1 -1
- package/_cjs/data/boolean/instances.cjs +1 -2
- package/_cjs/data/boolean/instances.cjs.map +1 -1
- package/_cjs/data/exceptions/IOError.cjs +1 -2
- package/_cjs/data/exceptions/IOError.cjs.map +1 -1
- package/_cjs/data/exceptions/InterruptedException.cjs +1 -2
- package/_cjs/data/exceptions/InterruptedException.cjs.map +1 -1
- package/_cjs/data/number/instances.cjs +1 -2
- package/_cjs/data/number/instances.cjs.map +1 -1
- package/_cjs/data/object/instances.cjs +1 -2
- package/_cjs/data/object/instances.cjs.map +1 -1
- package/_cjs/data/string/api.cjs +1 -2
- package/_cjs/data/string/api.cjs.map +1 -1
- package/_cjs/data/string/instances.cjs +1 -2
- package/_cjs/data/string/instances.cjs.map +1 -1
- package/_cjs/internal/Stack.cjs +7 -2
- package/_cjs/internal/Stack.cjs.map +1 -1
- package/_cjs/optics/At/api.cjs +1 -2
- package/_cjs/optics/At/api.cjs.map +1 -1
- package/_cjs/optics/At/definition.cjs +1 -2
- package/_cjs/optics/At/definition.cjs.map +1 -1
- package/_cjs/optics/Index/api.cjs +3 -4
- package/_cjs/optics/Index/api.cjs.map +1 -1
- package/_cjs/optics/Iso/api.cjs +1 -2
- package/_cjs/optics/Iso/api.cjs.map +1 -1
- package/_cjs/optics/Iso/definition.cjs +1 -2
- package/_cjs/optics/Iso/definition.cjs.map +1 -1
- package/_cjs/optics/Lens/api.cjs +2 -3
- package/_cjs/optics/Lens/api.cjs.map +1 -1
- package/_cjs/optics/Lens/definition.cjs +1 -2
- package/_cjs/optics/Lens/definition.cjs.map +1 -1
- package/_cjs/optics/Optional/api/compose.cjs +1 -2
- package/_cjs/optics/Optional/api/compose.cjs.map +1 -1
- package/_cjs/optics/Optional/api/focus.cjs +1 -2
- package/_cjs/optics/Optional/api/focus.cjs.map +1 -1
- package/_cjs/optics/Optional/api.cjs +1 -2
- package/_cjs/optics/Optional/api.cjs.map +1 -1
- package/_cjs/optics/Optional/definition.cjs +1 -2
- package/_cjs/optics/Optional/definition.cjs.map +1 -1
- package/_cjs/optics/Prism/api/compose.cjs +1 -2
- package/_cjs/optics/Prism/api/compose.cjs.map +1 -1
- package/_cjs/optics/Prism/api/focus.cjs +1 -2
- package/_cjs/optics/Prism/api/focus.cjs.map +1 -1
- package/_cjs/optics/Prism/api/fromNullable.cjs +1 -2
- package/_cjs/optics/Prism/api/fromNullable.cjs.map +1 -1
- package/_cjs/optics/Prism/api/just.cjs +1 -2
- package/_cjs/optics/Prism/api/just.cjs.map +1 -1
- package/_cjs/optics/Prism/definition.cjs +1 -2
- package/_cjs/optics/Prism/definition.cjs.map +1 -1
- package/_cjs/optics/Traversal/api/compose.cjs +1 -2
- package/_cjs/optics/Traversal/api/compose.cjs.map +1 -1
- package/_cjs/optics/Traversal/api/focus.cjs +1 -2
- package/_cjs/optics/Traversal/api/focus.cjs.map +1 -1
- package/_cjs/optics/Traversal/api/fromTraversable.cjs +1 -2
- package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -1
- package/_cjs/optics/Traversal/definition.cjs +1 -2
- package/_cjs/optics/Traversal/definition.cjs.map +1 -1
- package/_cjs/typeclass/ApplicativeExcept.cjs +1 -2
- package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -1
- package/_cjs/typeclass/Apply.cjs +1 -2
- package/_cjs/typeclass/Apply.cjs.map +1 -1
- package/_cjs/typeclass/Chain.cjs +1 -2
- package/_cjs/typeclass/Chain.cjs.map +1 -1
- package/_cjs/typeclass/MonadExcept.cjs +1 -2
- package/_cjs/typeclass/MonadExcept.cjs.map +1 -1
- package/_cjs/typeclass/Monoid.cjs +1 -2
- package/_cjs/typeclass/Monoid.cjs.map +1 -1
- package/_cjs/typeclass/Semialign.cjs +1 -2
- package/_cjs/typeclass/Semialign.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/api.cjs +1 -2
- package/_cjs/typeclass/Semigroup/api.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/derivations.cjs +1 -2
- package/_cjs/typeclass/Semigroup/derivations.cjs.map +1 -1
- package/_cjs/typeclass/Witherable.cjs +1 -2
- package/_cjs/typeclass/Witherable.cjs.map +1 -1
- package/_cjs/typeclass/WitherableWithIndex.cjs +1 -2
- package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -1
- package/_cjs/util/AnsiFormat.cjs +1 -2
- package/_cjs/util/AnsiFormat.cjs.map +1 -1
- package/_cjs/util/assert.cjs +1 -1
- package/_cjs/util/assert.cjs.map +1 -1
- package/_cjs/util/pattern.cjs.map +1 -1
- package/_cjs/util/rand/generator/RandomGenerator.cjs.map +1 -1
- package/_mjs/collection/AsyncIterable/api.mjs +366 -0
- package/_mjs/collection/AsyncIterable/api.mjs.map +1 -0
- package/_mjs/collection/AsyncIterable/definition.mjs +2 -0
- package/_mjs/collection/AsyncIterable/definition.mjs.map +1 -0
- package/_mjs/collection/AsyncIterable.mjs +4 -0
- package/_mjs/collection/AsyncIterable.mjs.map +1 -0
- package/_mjs/collection/Iterable/api.mjs +175 -134
- package/_mjs/collection/Iterable/api.mjs.map +1 -1
- package/_mjs/collection/Iterable/constructors.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/constructors.mjs +2 -2
- package/_mjs/collection/immutable/Conc/constructors.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/definition.mjs +1 -1
- package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/List/api.mjs +2 -2
- package/_mjs/collection/immutable/List/api.mjs.map +1 -1
- package/_mjs/collection/immutable/{ImmutableArray → ReadonlyArray}/api/chunksOf.mjs +3 -3
- package/_mjs/collection/immutable/ReadonlyArray/api/chunksOf.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyArray/api/splitAt.mjs +9 -0
- package/_mjs/collection/immutable/ReadonlyArray/api/splitAt.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyArray/api/splitWhere.mjs +19 -0
- package/_mjs/collection/immutable/ReadonlyArray/api/splitWhere.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyArray/api.mjs +1302 -0
- package/_mjs/collection/immutable/ReadonlyArray/api.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyArray/constructors.mjs +44 -0
- package/_mjs/collection/immutable/ReadonlyArray/constructors.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyArray/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/{ImmutableArray → ReadonlyArray}/instances.mjs +4 -5
- package/_mjs/collection/immutable/ReadonlyArray/instances.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyArray.mjs +11 -0
- package/_mjs/collection/immutable/ReadonlyArray.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray/api.mjs +433 -0
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray/api.mjs.map +1 -0
- package/_mjs/collection/immutable/{ImmutableNonEmptyArray → ReadonlyNonEmptyArray}/constructors.mjs +16 -15
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray/constructors.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray/definition.mjs +2 -0
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray/destructors.mjs +41 -0
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray/destructors.mjs.map +1 -0
- package/_mjs/collection/immutable/{ImmutableNonEmptyArray → ReadonlyNonEmptyArray}/instances.mjs +2 -2
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray/instances.mjs.map +1 -0
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray.mjs +7 -0
- package/_mjs/collection/immutable/ReadonlyNonEmptyArray.mjs.map +1 -0
- package/_mjs/collection/immutable/Vector/api.mjs +224 -224
- package/_mjs/collection/immutable/Vector/api.mjs.map +1 -1
- package/_mjs/control/Eval/api.mjs +83 -15
- package/_mjs/control/Eval/api.mjs.map +1 -1
- package/_mjs/control/Eval/constructors.mjs +4 -0
- package/_mjs/control/Eval/constructors.mjs.map +1 -1
- package/_mjs/control/Pure/runtime.mjs +14 -8
- package/_mjs/control/Pure/runtime.mjs.map +1 -1
- package/_mjs/data/CaseClass.mjs +10 -12
- package/_mjs/data/CaseClass.mjs.map +1 -1
- package/_mjs/data/Cause/api/fold.mjs +32 -32
- package/_mjs/data/Cause/api/fold.mjs.map +1 -1
- package/_mjs/data/Const/api.mjs +7 -7
- package/_mjs/data/Const/api.mjs.map +1 -1
- package/_mjs/data/Const/instances.mjs +11 -11
- package/_mjs/data/Const/instances.mjs.map +1 -1
- package/_mjs/data/Datum/api.mjs +107 -108
- package/_mjs/data/Datum/api.mjs.map +1 -1
- package/_mjs/data/Datum.mjs +5 -0
- package/_mjs/data/Datum.mjs.map +1 -0
- package/_mjs/data/DatumEither/api.mjs +53 -53
- package/_mjs/data/DatumEither/api.mjs.map +1 -1
- package/_mjs/data/Either/api.mjs +42 -42
- package/_mjs/data/Either/api.mjs.map +1 -1
- package/_mjs/data/Either/constructors.mjs +20 -20
- package/_mjs/data/Either/constructors.mjs.map +1 -1
- package/_mjs/data/EitherT/api.mjs +27 -27
- package/_mjs/data/EitherT/api.mjs.map +1 -1
- package/_mjs/data/Environment/api.mjs.map +1 -1
- package/_mjs/data/EnvironmentPatch.mjs +1 -1
- package/_mjs/data/Eq/api.mjs +175 -3
- package/_mjs/data/Eq/api.mjs.map +1 -1
- package/_mjs/data/Eq/derivations.mjs +8 -19
- package/_mjs/data/Eq/derivations.mjs.map +1 -1
- package/_mjs/data/Exit/api.mjs +88 -78
- package/_mjs/data/Exit/api.mjs.map +1 -1
- package/_mjs/data/Guard/api.mjs +12 -15
- package/_mjs/data/Guard/api.mjs.map +1 -1
- package/_mjs/data/Maybe/api.mjs +71 -58
- package/_mjs/data/Maybe/api.mjs.map +1 -1
- package/_mjs/data/Maybe/constructors.mjs +36 -36
- package/_mjs/data/Maybe/constructors.mjs.map +1 -1
- package/_mjs/data/Struct/api.mjs +4 -5
- package/_mjs/data/Struct/api.mjs.map +1 -1
- package/_mjs/data/These/api.mjs +85 -85
- package/_mjs/data/These/api.mjs.map +1 -1
- package/_mjs/internal/Stack.mjs +7 -2
- package/_mjs/internal/Stack.mjs.map +1 -1
- package/_mjs/optics/Index/api.mjs +2 -2
- package/_mjs/optics/Index/api.mjs.map +1 -1
- package/_mjs/optics/Lens/api.mjs +1 -1
- package/_mjs/util/assert.mjs +1 -1
- package/_mjs/util/assert.mjs.map +1 -1
- package/_mjs/util/pattern.mjs.map +1 -1
- package/_mjs/util/rand/generator/RandomGenerator.mjs.map +1 -1
- package/_src/collection/AsyncIterable/api.ts +369 -0
- package/_src/collection/AsyncIterable/definition.ts +7 -0
- package/_src/collection/AsyncIterable.ts +4 -0
- package/_src/collection/Iterable/api.ts +215 -162
- package/_src/collection/Iterable/constructors.ts +0 -2
- package/_src/collection/compat/ArrayLike/definition.ts +2 -2
- package/_src/collection/compat.ts +0 -1
- package/_src/collection/immutable/Conc/constructors.ts +1 -2
- package/_src/collection/immutable/Conc/definition.ts +7 -6
- package/_src/collection/immutable/List/api.ts +2 -2
- package/_src/collection/immutable/ReadonlyArray/api/chunksOf.ts +8 -0
- package/_src/collection/immutable/ReadonlyArray/api/splitAt.ts +8 -0
- package/_src/collection/immutable/{ImmutableArray → ReadonlyArray}/api/splitWhere.ts +3 -3
- package/_src/collection/immutable/ReadonlyArray/api.ts +1536 -0
- package/_src/collection/immutable/ReadonlyArray/constructors.ts +47 -0
- package/_src/collection/{compat/Array → immutable/ReadonlyArray}/definition.ts +8 -0
- package/_src/collection/immutable/{ImmutableArray → ReadonlyArray}/instances.ts +22 -22
- package/_src/collection/immutable/ReadonlyArray.ts +12 -0
- package/_src/collection/immutable/ReadonlyNonEmptyArray/api.ts +481 -0
- package/_src/collection/immutable/ReadonlyNonEmptyArray/constructors.ts +76 -0
- package/_src/collection/immutable/ReadonlyNonEmptyArray/definition.ts +22 -0
- package/_src/collection/immutable/ReadonlyNonEmptyArray/destructors.ts +41 -0
- package/_src/collection/immutable/{ImmutableNonEmptyArray → ReadonlyNonEmptyArray}/instances.ts +13 -13
- package/_src/collection/immutable/ReadonlyNonEmptyArray.ts +7 -0
- package/_src/collection/immutable/Vector/api.ts +310 -309
- package/_src/collection/immutable.ts +11 -11
- package/_src/collection.ts +6 -5
- package/_src/control/Eval/api.ts +109 -16
- package/_src/control/Eval/constructors.ts +5 -0
- package/_src/control/Pure/runtime.ts +8 -2
- package/_src/data/CaseClass.ts +5 -5
- package/_src/data/Cause/api/fold.ts +2 -2
- package/_src/data/Const/api.ts +8 -8
- package/_src/data/Const/instances.ts +10 -10
- package/_src/data/Datum/api.ts +113 -113
- package/_src/data/Datum.ts +5 -0
- package/_src/data/DatumEither/api.ts +41 -43
- package/_src/data/Either/api.ts +47 -47
- package/_src/data/Either/constructors.ts +14 -16
- package/_src/data/EitherT/api.ts +111 -110
- package/_src/data/Environment/api.ts +6 -3
- package/_src/data/Eq/api.ts +193 -4
- package/_src/data/Eq/derivations.ts +12 -19
- package/_src/data/Exit/api.ts +89 -77
- package/_src/data/Guard/api.ts +11 -11
- package/_src/data/Maybe/api.ts +82 -73
- package/_src/data/Maybe/constructors.ts +34 -36
- package/_src/data/Struct/api.ts +1 -1
- package/_src/data/These/api.ts +93 -92
- package/_src/data.ts +1 -0
- package/_src/global.ts +7 -12
- package/_src/internal/Stack.ts +6 -2
- package/_src/optics/Index/api.ts +1 -1
- package/_src/util/assert.ts +2 -2
- package/_src/util/pattern.ts +8 -90
- package/_src/util/rand/generator/RandomGenerator.ts +1 -0
- package/collection/AsyncIterable/api.d.ts +71 -0
- package/collection/AsyncIterable/definition.d.ts +9 -0
- package/collection/AsyncIterable.d.ts +2 -0
- package/collection/Iterable/api.d.ts +40 -25
- package/collection/compat/ArrayLike/definition.d.ts +2 -2
- package/collection/compat.d.ts +0 -1
- package/collection/immutable/Conc/definition.d.ts +1 -1
- package/collection/immutable/ReadonlyArray/api/chunksOf.d.ts +5 -0
- package/collection/immutable/ReadonlyArray/api/splitAt.d.ts +5 -0
- package/collection/immutable/ReadonlyArray/api/splitWhere.d.ts +6 -0
- package/collection/immutable/ReadonlyArray/api.d.ts +614 -0
- package/collection/immutable/ReadonlyArray/constructors.d.ts +30 -0
- package/collection/{compat/Array → immutable/ReadonlyArray}/definition.d.ts +8 -0
- package/collection/immutable/ReadonlyArray/instances.d.ts +87 -0
- package/collection/immutable/ReadonlyArray.d.ts +7 -0
- package/collection/immutable/ReadonlyNonEmptyArray/api.d.ts +186 -0
- package/collection/immutable/ReadonlyNonEmptyArray/constructors.d.ts +45 -0
- package/collection/immutable/ReadonlyNonEmptyArray/definition.d.ts +21 -0
- package/collection/immutable/ReadonlyNonEmptyArray/destructors.d.ts +31 -0
- package/collection/immutable/ReadonlyNonEmptyArray/instances.d.ts +52 -0
- package/collection/immutable/ReadonlyNonEmptyArray.d.ts +5 -0
- package/collection/immutable/Vector/api.d.ts +93 -93
- package/collection/immutable.d.ts +2 -2
- package/collection.d.ts +1 -0
- package/control/Eval/api.d.ts +27 -5
- package/control/Eval/constructors.d.ts +5 -0
- package/data/CaseClass.d.ts +2 -3
- package/data/Const/api.d.ts +5 -5
- package/data/Const/instances.d.ts +4 -4
- package/data/Datum/api.d.ts +64 -64
- package/data/Datum.d.ts +3 -0
- package/data/DatumEither/api.d.ts +25 -25
- package/data/Either/api.d.ts +24 -24
- package/data/Either/constructors.d.ts +12 -12
- package/data/EitherT/api.d.ts +16 -16
- package/data/Environment/api.d.ts +4 -2
- package/data/Eq/api.d.ts +89 -2
- package/data/Eq/derivations.d.ts +7 -0
- package/data/Exit/api.d.ts +43 -37
- package/data/Guard/api.d.ts +7 -8
- package/data/Maybe/api.d.ts +38 -33
- package/data/Maybe/constructors.d.ts +16 -16
- package/data/These/api.d.ts +26 -26
- package/data.d.ts +1 -0
- package/global.d.ts +4 -8
- package/internal/Stack.d.ts +2 -0
- package/optics/Lens/api.d.ts +1 -1
- package/package.json +3 -3
- package/util/assert.d.ts +1 -1
- package/_cjs/collection/compat/Array/api.cjs +0 -142
- package/_cjs/collection/compat/Array/api.cjs.map +0 -1
- package/_cjs/collection/compat/Array/definition.cjs.map +0 -1
- package/_cjs/collection/compat/Array.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableArray/api/chunksOf.cjs +0 -19
- package/_cjs/collection/immutable/ImmutableArray/api/chunksOf.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableArray/api/slice.cjs +0 -18
- package/_cjs/collection/immutable/ImmutableArray/api/slice.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableArray/api/splitAt.cjs +0 -18
- package/_cjs/collection/immutable/ImmutableArray/api/splitAt.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableArray/api/splitWhere.cjs +0 -28
- package/_cjs/collection/immutable/ImmutableArray/api/splitWhere.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableArray/constructors.cjs +0 -59
- package/_cjs/collection/immutable/ImmutableArray/constructors.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs +0 -44
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableArray.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +0 -474
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs +0 -79
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs +0 -36
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs +0 -53
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +0 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs.map +0 -1
- package/_cjs/control/Eval/api/sequenceArray.cjs +0 -17
- package/_cjs/control/Eval/api/sequenceArray.cjs.map +0 -1
- package/_mjs/collection/compat/Array/api.mjs +0 -125
- package/_mjs/collection/compat/Array/api.mjs.map +0 -1
- package/_mjs/collection/compat/Array/definition.mjs.map +0 -1
- package/_mjs/collection/compat/Array.mjs +0 -4
- package/_mjs/collection/compat/Array.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableArray/api/chunksOf.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableArray/api/slice.mjs +0 -10
- package/_mjs/collection/immutable/ImmutableArray/api/slice.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableArray/api/splitAt.mjs +0 -10
- package/_mjs/collection/immutable/ImmutableArray/api/splitAt.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableArray/api/splitWhere.mjs +0 -20
- package/_mjs/collection/immutable/ImmutableArray/api/splitWhere.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableArray/api.mjs +0 -1284
- package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableArray/constructors.mjs +0 -46
- package/_mjs/collection/immutable/ImmutableArray/constructors.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs +0 -35
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableArray.mjs +0 -12
- package/_mjs/collection/immutable/ImmutableArray.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +0 -437
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs +0 -25
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs +0 -43
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +0 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs +0 -7
- package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs.map +0 -1
- package/_mjs/control/Eval/api/sequenceArray.mjs +0 -9
- package/_mjs/control/Eval/api/sequenceArray.mjs.map +0 -1
- package/_src/collection/compat/Array/api.ts +0 -134
- package/_src/collection/compat/Array.ts +0 -4
- package/_src/collection/immutable/ImmutableArray/api/chunksOf.ts +0 -8
- package/_src/collection/immutable/ImmutableArray/api/slice.ts +0 -8
- package/_src/collection/immutable/ImmutableArray/api/splitAt.ts +0 -8
- package/_src/collection/immutable/ImmutableArray/api.ts +0 -1526
- package/_src/collection/immutable/ImmutableArray/constructors.ts +0 -47
- package/_src/collection/immutable/ImmutableArray/definition.ts +0 -48
- package/_src/collection/immutable/ImmutableArray.ts +0 -13
- package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +0 -483
- package/_src/collection/immutable/ImmutableNonEmptyArray/constructors.ts +0 -83
- package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +0 -47
- package/_src/collection/immutable/ImmutableNonEmptyArray/destructors.ts +0 -41
- package/_src/collection/immutable/ImmutableNonEmptyArray.ts +0 -7
- package/_src/control/Eval/api/sequenceArray.ts +0 -6
- package/collection/compat/Array/api.d.ts +0 -62
- package/collection/compat/Array.d.ts +0 -2
- package/collection/immutable/ImmutableArray/api/chunksOf.d.ts +0 -6
- package/collection/immutable/ImmutableArray/api/slice.d.ts +0 -6
- package/collection/immutable/ImmutableArray/api/splitAt.d.ts +0 -6
- package/collection/immutable/ImmutableArray/api/splitWhere.d.ts +0 -7
- package/collection/immutable/ImmutableArray/api.d.ts +0 -602
- package/collection/immutable/ImmutableArray/constructors.d.ts +0 -32
- package/collection/immutable/ImmutableArray/definition.d.ts +0 -34
- package/collection/immutable/ImmutableArray/instances.d.ts +0 -87
- package/collection/immutable/ImmutableArray.d.ts +0 -8
- package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +0 -186
- package/collection/immutable/ImmutableNonEmptyArray/constructors.d.ts +0 -46
- package/collection/immutable/ImmutableNonEmptyArray/definition.d.ts +0 -40
- package/collection/immutable/ImmutableNonEmptyArray/destructors.d.ts +0 -32
- package/collection/immutable/ImmutableNonEmptyArray/instances.d.ts +0 -52
- package/collection/immutable/ImmutableNonEmptyArray.d.ts +0 -5
- package/control/Eval/api/sequenceArray.d.ts +0 -6
- /package/_cjs/collection/{compat/Array → immutable/ReadonlyArray}/definition.cjs +0 -0
- /package/_mjs/collection/{compat/Array → immutable/ReadonlyArray}/definition.mjs +0 -0
@@ -1,1284 +0,0 @@
|
|
1
|
-
const fileName_1 = "(@fncts/base) src/collection/immutable/ImmutableArray/api.ts";
|
2
|
-
import * as tsplus_module_1 from "@fncts/base/data/These/constructors";
|
3
|
-
import * as tsplus_module_2 from "@fncts/base/collection/immutable/ImmutableArray/constructors";
|
4
|
-
import * as tsplus_module_3 from "@fncts/base/data/Zipped";
|
5
|
-
import * as tsplus_module_4 from "@fncts/base/collection/immutable/ImmutableArray/api/slice";
|
6
|
-
import * as tsplus_module_5 from "@fncts/base/collection/immutable/ImmutableNonEmptyArray/definition";
|
7
|
-
import * as tsplus_module_6 from "@fncts/base/data/Maybe/definition";
|
8
|
-
import * as tsplus_module_7 from "@fncts/base/control/Eval/constructors";
|
9
|
-
import * as tsplus_module_8 from "@fncts/base/control/Eval/instance";
|
10
|
-
import * as tsplus_module_9 from "@fncts/base/control/Eval/api";
|
11
|
-
import * as tsplus_module_10 from "@fncts/base/control/Eval/run";
|
12
|
-
import * as tsplus_module_11 from "@fncts/base/data/Maybe/constructors";
|
13
|
-
import * as tsplus_module_12 from "@fncts/base/collection/immutable/ImmutableNonEmptyArray/constructors";
|
14
|
-
import * as tsplus_module_13 from "@fncts/base/collection/immutable/Dictionary/definition";
|
15
|
-
import * as tsplus_module_14 from "@fncts/base/collection/immutable/Dictionary/api";
|
16
|
-
import * as tsplus_module_15 from "@fncts/base/data/Ord/instances";
|
17
|
-
import * as tsplus_module_16 from "@fncts/base/data/Either/destructors";
|
18
|
-
export const alignWith = alignWith_1;
|
19
|
-
export const append = append_1;
|
20
|
-
export const crossWith = crossWith_1;
|
21
|
-
export const flatMapWithIndex = flatMapWithIndex_1;
|
22
|
-
export const flatMap = flatMap_1;
|
23
|
-
export const flatten = flatten_1;
|
24
|
-
export const chop = chop_1;
|
25
|
-
export const concat = concat_1;
|
26
|
-
export const elem = elem_1;
|
27
|
-
export const everyWithIndex = everyWithIndex_1;
|
28
|
-
export const filter = filter_1;
|
29
|
-
export const filterWithIndex = filterWithIndex_1;
|
30
|
-
export const filterMapWithIndex = filterMapWithIndex_1;
|
31
|
-
export const findWithIndex = findWithIndex_1;
|
32
|
-
export const findMapWithIndex = findMapWithIndex_1;
|
33
|
-
export const findLastMapWithIndex = findLastMapWithIndex_1;
|
34
|
-
export const foldLeftWithIndex = foldLeftWithIndex_1;
|
35
|
-
export const foldLeft = foldLeft_1;
|
36
|
-
export const foldLeftWithIndexWhile = foldLeftWithIndexWhile_1;
|
37
|
-
export const fold = fold_1;
|
38
|
-
export const foldMapWithIndex = foldMapWithIndex_1;
|
39
|
-
export const foldRightWithIndex = foldRightWithIndex_1;
|
40
|
-
export const foldRightWithIndexWhile = foldRightWithIndexWhile_1;
|
41
|
-
export const forEach = forEach_1;
|
42
|
-
export const get = get_1;
|
43
|
-
export const isEmpty = isEmpty_1;
|
44
|
-
export const isOutOfBound = isOutOfBound_1;
|
45
|
-
export const length = length_1;
|
46
|
-
export const map = map_1;
|
47
|
-
export const mapWithIndex = mapWithIndex_1;
|
48
|
-
export const mutate = mutate_1;
|
49
|
-
export const mutableClone = mutableClone_1;
|
50
|
-
export const partitionWithIndex = partitionWithIndex_1;
|
51
|
-
export const partitionMapWithIndex = partitionMapWithIndex_1;
|
52
|
-
export const prepend = prepend_1;
|
53
|
-
export const prependAll = prependAll_1;
|
54
|
-
export const rotate = rotate_1;
|
55
|
-
export const sort = sort_1;
|
56
|
-
export const spanIndexLeft = spanIndexLeft_1;
|
57
|
-
export const spanIndexRight = spanIndexRight_1;
|
58
|
-
export const _traverseWithIndex = _traverseWithIndex_1;
|
59
|
-
export const _traverse = _traverse_1;
|
60
|
-
export const unsafeGet = unsafeGet_1;
|
61
|
-
export const unsafeAsMutable = unsafeAsMutable_1;
|
62
|
-
export const unsafeDeleteAt = unsafeDeleteAt_1;
|
63
|
-
export const unsafeInsertAt = unsafeInsertAt_1;
|
64
|
-
export const unsafeModifyAt = unsafeModifyAt_1;
|
65
|
-
export const unsafeUpdateAt = unsafeUpdateAt_1;
|
66
|
-
export const _wiltWithIndex = _wiltWithIndex_1;
|
67
|
-
export const _witherWithIndex = _witherWithIndex_1;
|
68
|
-
export const zipWith = zipWith_1;
|
69
|
-
import { identity, pipe, tuple } from "@fncts/base/data/function";
|
70
|
-
import * as P from "@fncts/base/typeclass";
|
71
|
-
/**
|
72
|
-
* @tsplus pipeable fncts.ImmutableArray alignWith
|
73
|
-
*/
|
74
|
-
function alignWith_1(fb, f) {
|
75
|
-
return self => {
|
76
|
-
const selfArray = self._array;
|
77
|
-
const thatArray = fb._array;
|
78
|
-
const minlen = Math.min(selfArray.length, thatArray.length);
|
79
|
-
const maxlen = Math.max(selfArray.length, thatArray.length);
|
80
|
-
const ret = Array(maxlen);
|
81
|
-
for (let i = 0; i < minlen; i++) {
|
82
|
-
ret[i] = f(tsplus_module_1.both(selfArray[i], thatArray[i]));
|
83
|
-
}
|
84
|
-
if (minlen === maxlen) {
|
85
|
-
return tsplus_module_2.asImmutableArray(ret);
|
86
|
-
} else if (selfArray.length > thatArray.length) {
|
87
|
-
for (let i = minlen; i < maxlen; i++) {
|
88
|
-
ret[i] = f(tsplus_module_1.left(selfArray[i]));
|
89
|
-
}
|
90
|
-
} else {
|
91
|
-
for (let i = minlen; i < maxlen; i++) {
|
92
|
-
ret[i] = f(tsplus_module_1.right(thatArray[i]));
|
93
|
-
}
|
94
|
-
}
|
95
|
-
return tsplus_module_2.asImmutableArray(ret);
|
96
|
-
};
|
97
|
-
}
|
98
|
-
/**
|
99
|
-
* @tsplus pipeable fncts.ImmutableArray align
|
100
|
-
*/
|
101
|
-
export function align(fb) {
|
102
|
-
return self => {
|
103
|
-
return alignWith_1(fb, identity)(self);
|
104
|
-
};
|
105
|
-
}
|
106
|
-
/**
|
107
|
-
* @tsplus pipeable fncts.ImmutableArray alt
|
108
|
-
*/
|
109
|
-
export function alt(that) {
|
110
|
-
return self => {
|
111
|
-
return concat_1(that())(self);
|
112
|
-
};
|
113
|
-
}
|
114
|
-
/**
|
115
|
-
* @tsplus pipeable fncts.ImmutableArray ap
|
116
|
-
*/
|
117
|
-
export function ap(fa) {
|
118
|
-
return self => {
|
119
|
-
return flatMap_1(f => map_1(f)(fa))(self);
|
120
|
-
};
|
121
|
-
}
|
122
|
-
/**
|
123
|
-
* @tsplus pipeable fncts.ImmutableArray append
|
124
|
-
*/
|
125
|
-
function append_1(last) {
|
126
|
-
return self => {
|
127
|
-
const selfArray = self._array;
|
128
|
-
const len = selfArray.length;
|
129
|
-
const r = Array(len + 1);
|
130
|
-
r[len] = last;
|
131
|
-
for (let i = 0; i < len; i++) {
|
132
|
-
r[i] = selfArray[i];
|
133
|
-
}
|
134
|
-
return tsplus_module_2.asImmutableArray(r);
|
135
|
-
};
|
136
|
-
}
|
137
|
-
/**
|
138
|
-
* @tsplus pipeable fncts.ImmutableArray crossWith
|
139
|
-
*/
|
140
|
-
function crossWith_1(fb, f) {
|
141
|
-
return self => {
|
142
|
-
return flatMap_1(a => map_1(b => f(a, b))(fb))(self);
|
143
|
-
};
|
144
|
-
}
|
145
|
-
/**
|
146
|
-
* @tsplus pipeable fncts.ImmutableArray cross
|
147
|
-
*/
|
148
|
-
export function cross(fb) {
|
149
|
-
return self => {
|
150
|
-
return crossWith_1(fb, (a, b) => tsplus_module_3.make(a, b))(self);
|
151
|
-
};
|
152
|
-
}
|
153
|
-
/**
|
154
|
-
* @tsplus static fncts.ImmutableArrayOps chainRecDepthFirst
|
155
|
-
*/
|
156
|
-
export function chainRecDepthFirst(a, f) {
|
157
|
-
const buffer = unsafeAsMutable_1(tsplus_module_4.slice()(f(a)));
|
158
|
-
const out = [];
|
159
|
-
while (buffer.length > 0) {
|
160
|
-
const e = buffer.shift();
|
161
|
-
void 0;
|
162
|
-
if (e._tag === "Left" /* EitherTag.Left */) {
|
163
|
-
buffer.unshift(...f(e.left));
|
164
|
-
} else {
|
165
|
-
out.push(e.right);
|
166
|
-
}
|
167
|
-
}
|
168
|
-
return tsplus_module_2.asImmutableArray(out);
|
169
|
-
}
|
170
|
-
/**
|
171
|
-
* @tsplus static fncts.ImmutableArrayOps chainRecBreadthFirst
|
172
|
-
*/
|
173
|
-
export function chainRecBreadthFirst(a, f) {
|
174
|
-
const initial = f(a);
|
175
|
-
const buffer = [];
|
176
|
-
const out = [];
|
177
|
-
function go(e) {
|
178
|
-
void 0;
|
179
|
-
if (e._tag === "Left") {
|
180
|
-
forEach_1(v => buffer.push(v))(f(e.left));
|
181
|
-
} else {
|
182
|
-
out.push(e.right);
|
183
|
-
}
|
184
|
-
}
|
185
|
-
for (const e of initial) {
|
186
|
-
go(e);
|
187
|
-
}
|
188
|
-
while (buffer.length > 0) {
|
189
|
-
go(buffer.shift());
|
190
|
-
}
|
191
|
-
return tsplus_module_2.asImmutableArray(out);
|
192
|
-
}
|
193
|
-
/**
|
194
|
-
* @tsplus pipeable fncts.ImmutableArray flatMapWithIndex
|
195
|
-
*/
|
196
|
-
function flatMapWithIndex_1(f) {
|
197
|
-
return self => {
|
198
|
-
let outLen = 0;
|
199
|
-
const selfArray = self._array;
|
200
|
-
const len = selfArray.length;
|
201
|
-
const temp = Array(len);
|
202
|
-
for (let i = 0; i < len; i++) {
|
203
|
-
const e = selfArray[i];
|
204
|
-
const arr = f(i, e)._array;
|
205
|
-
outLen += arr.length;
|
206
|
-
temp[i] = arr;
|
207
|
-
}
|
208
|
-
const out = Array(outLen);
|
209
|
-
let start = 0;
|
210
|
-
for (let i = 0; i < len; i++) {
|
211
|
-
const arr = temp[i];
|
212
|
-
const l = arr.length;
|
213
|
-
for (let j = 0; j < l; j++) {
|
214
|
-
out[j + start] = arr[j];
|
215
|
-
}
|
216
|
-
start += l;
|
217
|
-
}
|
218
|
-
return tsplus_module_2.asImmutableArray(out);
|
219
|
-
};
|
220
|
-
}
|
221
|
-
/**
|
222
|
-
* @tsplus pipeable fncts.ImmutableArray flatMap
|
223
|
-
*/
|
224
|
-
function flatMap_1(f) {
|
225
|
-
return self => {
|
226
|
-
return flatMapWithIndex_1((_, a) => f(a))(self);
|
227
|
-
};
|
228
|
-
}
|
229
|
-
/**
|
230
|
-
* @tsplus getter fncts.ImmutableArray flatten
|
231
|
-
*/
|
232
|
-
function flatten_1(self) {
|
233
|
-
return flatMap_1(identity)(self);
|
234
|
-
}
|
235
|
-
/**
|
236
|
-
* A useful recursion pattern for processing a `Array` to produce a new `Array`,
|
237
|
-
* often used for "chopping" up the input `Array`. Typically chop is called with some function
|
238
|
-
* that will consume an initial prefix of the `Array` and produce a value and the rest of the `Array`.
|
239
|
-
*
|
240
|
-
* @tsplus pipeable fncts.ImmutableArray chop
|
241
|
-
*/
|
242
|
-
function chop_1(f) {
|
243
|
-
return as => {
|
244
|
-
const result = [];
|
245
|
-
let cs = as;
|
246
|
-
while (tsplus_module_5.isNonEmpty(cs)) {
|
247
|
-
const [b, c] = f(cs);
|
248
|
-
result.push(b);
|
249
|
-
cs = c;
|
250
|
-
}
|
251
|
-
return tsplus_module_2.asImmutableArray(result);
|
252
|
-
};
|
253
|
-
}
|
254
|
-
/**
|
255
|
-
* @tsplus pipeable fncts.ImmutableArray collectWhile
|
256
|
-
*/
|
257
|
-
export function collectWhile(f) {
|
258
|
-
return as => {
|
259
|
-
const result = [];
|
260
|
-
for (let i = 0; i < length_1(as); i++) {
|
261
|
-
const o = f(as._array[i]);
|
262
|
-
if (tsplus_module_6.isJust(o)) {
|
263
|
-
result.push(o.value);
|
264
|
-
} else {
|
265
|
-
break;
|
266
|
-
}
|
267
|
-
}
|
268
|
-
return tsplus_module_2.asImmutableArray(result);
|
269
|
-
};
|
270
|
-
}
|
271
|
-
function comprehensionLoop(scope, input, f, g) {
|
272
|
-
if (input.length === 0) {
|
273
|
-
return g(...scope) ? tsplus_module_7.now(tsplus_module_2.make(f(...scope))) : tsplus_module_7.now(tsplus_module_2.empty());
|
274
|
-
} else {
|
275
|
-
return tsplus_module_9.map(rs => flatten_1(rs))(_traverse_1(input[0])(tsplus_module_8.Applicative)(a => comprehensionLoop(append_1(a)(scope), input.slice(1), f, g)));
|
276
|
-
}
|
277
|
-
}
|
278
|
-
export function comprehension(input, f, g = () => true) {
|
279
|
-
return tsplus_module_10.run(comprehensionLoop(tsplus_module_2.empty(), input, f, g));
|
280
|
-
}
|
281
|
-
/**
|
282
|
-
* @tsplus pipeable fncts.ImmutableArray concat
|
283
|
-
* @tsplus pipeable-operator fncts.ImmutableArray +
|
284
|
-
*/
|
285
|
-
function concat_1(that) {
|
286
|
-
return self => {
|
287
|
-
const lenx = self._array.length;
|
288
|
-
if (lenx === 0) {
|
289
|
-
return that;
|
290
|
-
}
|
291
|
-
const leny = that._array.length;
|
292
|
-
if (leny === 0) {
|
293
|
-
return self;
|
294
|
-
}
|
295
|
-
const r = Array(lenx + leny);
|
296
|
-
for (let i = 0; i < lenx; i++) {
|
297
|
-
r[i] = self._array[i];
|
298
|
-
}
|
299
|
-
for (let i = 0; i < leny; i++) {
|
300
|
-
r[i + lenx] = that._array[i];
|
301
|
-
}
|
302
|
-
return tsplus_module_2.asImmutableArray(r);
|
303
|
-
};
|
304
|
-
}
|
305
|
-
/**
|
306
|
-
* @tsplus pipeable fncts.ImmutableArray deleteAt
|
307
|
-
*/
|
308
|
-
export function deleteAt(i) {
|
309
|
-
return as => {
|
310
|
-
return isOutOfBound_1(i)(as) ? tsplus_module_11.nothing(fileName_1 + ":304:40") : tsplus_module_11.just(unsafeDeleteAt_1(i)(as), fileName_1 + ":304:49");
|
311
|
-
};
|
312
|
-
}
|
313
|
-
/**
|
314
|
-
* @tsplus pipeable fncts.ImmutableArray difference
|
315
|
-
*/
|
316
|
-
export function difference(ys, /** @tsplus auto */E) {
|
317
|
-
return self => {
|
318
|
-
return filter_1(a => !elem_1(a, E)(ys))(self);
|
319
|
-
};
|
320
|
-
}
|
321
|
-
/**
|
322
|
-
* @tsplus pipeable fncts.ImmutableArray drop
|
323
|
-
*/
|
324
|
-
export function drop(n) {
|
325
|
-
return self => {
|
326
|
-
return tsplus_module_4.slice(n)(self);
|
327
|
-
};
|
328
|
-
}
|
329
|
-
/**
|
330
|
-
* @tsplus pipeable fncts.ImmutableArray dropLast
|
331
|
-
*/
|
332
|
-
export function dropLast(n) {
|
333
|
-
return self => {
|
334
|
-
return tsplus_module_4.slice(0, length_1(self) - n)(self);
|
335
|
-
};
|
336
|
-
}
|
337
|
-
/**
|
338
|
-
* @tsplus pipeable fncts.ImmutableArray dropWhile
|
339
|
-
*/
|
340
|
-
export function dropWhile(p) {
|
341
|
-
return self => {
|
342
|
-
return tsplus_module_4.slice(spanIndexLeft_1(p)(self))(self);
|
343
|
-
};
|
344
|
-
}
|
345
|
-
/**
|
346
|
-
* @tsplus pipeable fncts.ImmutableArray dropLastWhile
|
347
|
-
*/
|
348
|
-
export function dropLastWhile(p) {
|
349
|
-
return as => {
|
350
|
-
return tsplus_module_4.slice(0, spanIndexRight_1(p)(as) + 1)(as);
|
351
|
-
};
|
352
|
-
}
|
353
|
-
/**
|
354
|
-
* Test if a value is a member of an array. Takes an `Eq<A>` as a single
|
355
|
-
* argument which returns the function to use to search for a value of type `A` in
|
356
|
-
* an array of type `ImmutableArray<A>`.
|
357
|
-
*
|
358
|
-
* @tsplus pipeable fncts.ImmutableArray elem
|
359
|
-
*/
|
360
|
-
function elem_1(a, /** @tsplus auto */E) {
|
361
|
-
return as => {
|
362
|
-
const predicate = element => E.equals(a)(element);
|
363
|
-
const len = length_1(as);
|
364
|
-
for (let i = 0; i < len; i++) {
|
365
|
-
if (predicate(as._array[i])) {
|
366
|
-
return true;
|
367
|
-
}
|
368
|
-
}
|
369
|
-
return false;
|
370
|
-
};
|
371
|
-
}
|
372
|
-
export function every(p) {
|
373
|
-
return self => {
|
374
|
-
return everyWithIndex_1((_, a) => p(a))(self);
|
375
|
-
};
|
376
|
-
}
|
377
|
-
function everyWithIndex_1(p) {
|
378
|
-
return self => {
|
379
|
-
let result = true;
|
380
|
-
let i = 0;
|
381
|
-
while (result && i < length_1(self)) {
|
382
|
-
result = p(i, self._array[i]);
|
383
|
-
i++;
|
384
|
-
}
|
385
|
-
return result;
|
386
|
-
};
|
387
|
-
}
|
388
|
-
/**
|
389
|
-
* @tsplus pipeable fncts.ImmutableArray some
|
390
|
-
*/
|
391
|
-
export function some(p) {
|
392
|
-
return self => {
|
393
|
-
let result = false;
|
394
|
-
let i = 0;
|
395
|
-
while (!result && i < length_1(self)) {
|
396
|
-
result = p(self._array[i]);
|
397
|
-
i++;
|
398
|
-
}
|
399
|
-
return result;
|
400
|
-
};
|
401
|
-
}
|
402
|
-
function filter_1(p) {
|
403
|
-
return self => {
|
404
|
-
return filterWithIndex_1((_, a) => p(a))(self);
|
405
|
-
};
|
406
|
-
}
|
407
|
-
function filterWithIndex_1(p) {
|
408
|
-
return self => {
|
409
|
-
const result = [];
|
410
|
-
for (let i = 0; i < length_1(self); i++) {
|
411
|
-
const a = self._array[i];
|
412
|
-
if (p(i, a)) {
|
413
|
-
result.push(a);
|
414
|
-
}
|
415
|
-
}
|
416
|
-
return tsplus_module_2.asImmutableArray(result);
|
417
|
-
};
|
418
|
-
}
|
419
|
-
/**
|
420
|
-
* @tsplus pipeable fncts.ImmutableArray filterMapWithIndex
|
421
|
-
*/
|
422
|
-
function filterMapWithIndex_1(f) {
|
423
|
-
return fa => {
|
424
|
-
const result = [];
|
425
|
-
for (let i = 0; i < length_1(fa); i++) {
|
426
|
-
const maybeB = f(i, unsafeGet_1(fa, i));
|
427
|
-
if (tsplus_module_6.isJust(maybeB)) {
|
428
|
-
result.push(maybeB.value);
|
429
|
-
}
|
430
|
-
}
|
431
|
-
return tsplus_module_2.asImmutableArray(result);
|
432
|
-
};
|
433
|
-
}
|
434
|
-
/**
|
435
|
-
* @tsplus pipeable fncts.ImmutableArray filterMap
|
436
|
-
*/
|
437
|
-
export function filterMap(f) {
|
438
|
-
return self => {
|
439
|
-
return filterMapWithIndex_1((_, a) => f(a))(self);
|
440
|
-
};
|
441
|
-
}
|
442
|
-
export function find(p) {
|
443
|
-
return self => {
|
444
|
-
return findWithIndex_1((_, a) => p(a))(self);
|
445
|
-
};
|
446
|
-
}
|
447
|
-
/**
|
448
|
-
* @tsplus pipeable fncts.ImmutableArray findIndex
|
449
|
-
*/
|
450
|
-
export function findIndex(predicate) {
|
451
|
-
return as => {
|
452
|
-
return findMapWithIndex_1((i, a) => predicate(a) ? tsplus_module_11.just(i, fileName_1 + ":490:62") : tsplus_module_11.nothing(fileName_1 + ":490:75"))(as);
|
453
|
-
};
|
454
|
-
}
|
455
|
-
function findWithIndex_1(p) {
|
456
|
-
return as => {
|
457
|
-
const len = length_1(as);
|
458
|
-
for (let i = 0; i < len; i++) {
|
459
|
-
if (p(i, as._array[i])) {
|
460
|
-
return tsplus_module_11.just(as._array[i], fileName_1 + ":506:20");
|
461
|
-
}
|
462
|
-
}
|
463
|
-
return tsplus_module_11.nothing(fileName_1 + ":509:19");
|
464
|
-
};
|
465
|
-
}
|
466
|
-
/**
|
467
|
-
* @tsplus pipeable fncts.ImmutableArray findMap
|
468
|
-
*/
|
469
|
-
export function findMap(f) {
|
470
|
-
return as => {
|
471
|
-
return findMapWithIndex_1((_, a) => f(a))(as);
|
472
|
-
};
|
473
|
-
}
|
474
|
-
/**
|
475
|
-
* @tsplus pipeable fncts.ImmutableArray findMapWithIndex
|
476
|
-
*/
|
477
|
-
function findMapWithIndex_1(f) {
|
478
|
-
return as => {
|
479
|
-
const len = length_1(as);
|
480
|
-
for (let i = 0; i < len; i++) {
|
481
|
-
const v = f(i, as._array[i]);
|
482
|
-
if (tsplus_module_6.isJust(v)) {
|
483
|
-
return v;
|
484
|
-
}
|
485
|
-
}
|
486
|
-
return tsplus_module_11.nothing(fileName_1 + ":534:19");
|
487
|
-
};
|
488
|
-
}
|
489
|
-
export function findLast(p) {
|
490
|
-
return as => {
|
491
|
-
const len = length_1(as);
|
492
|
-
for (let i = len - 1; i >= 0; i--) {
|
493
|
-
if (p(as._array[i])) {
|
494
|
-
return tsplus_module_11.just(as._array[i], fileName_1 + ":548:20");
|
495
|
-
}
|
496
|
-
}
|
497
|
-
return tsplus_module_11.nothing(fileName_1 + ":551:19");
|
498
|
-
};
|
499
|
-
}
|
500
|
-
/**
|
501
|
-
* @tsplus pipeable fncts.ImmutableArray findLastIndex
|
502
|
-
*/
|
503
|
-
export function findLastIndex(p) {
|
504
|
-
return self => {
|
505
|
-
return findLastMapWithIndex_1((i, a) => p(a) ? tsplus_module_11.just(i, fileName_1 + ":560:60") : tsplus_module_11.nothing(fileName_1 + ":560:73"))(self);
|
506
|
-
};
|
507
|
-
}
|
508
|
-
/**
|
509
|
-
* @tsplus pipeable fncts.ImmutableArray findLastMap
|
510
|
-
*/
|
511
|
-
export function findLastMap(f) {
|
512
|
-
return as => {
|
513
|
-
return findLastMapWithIndex_1((_, a) => f(a))(as);
|
514
|
-
};
|
515
|
-
}
|
516
|
-
/**
|
517
|
-
* @tsplus pipeable fncts.ImmutableArray findLastMapWithIndex
|
518
|
-
*/
|
519
|
-
function findLastMapWithIndex_1(f) {
|
520
|
-
return as => {
|
521
|
-
const len = length_1(as);
|
522
|
-
for (let i = len - 1; i >= 0; i--) {
|
523
|
-
const v = f(i, as._array[i]);
|
524
|
-
if (tsplus_module_6.isJust(v)) {
|
525
|
-
return v;
|
526
|
-
}
|
527
|
-
}
|
528
|
-
return tsplus_module_11.nothing(fileName_1 + ":585:19");
|
529
|
-
};
|
530
|
-
}
|
531
|
-
/**
|
532
|
-
* @tsplus pipeable fncts.ImmutableArray foldLeftWithIndex
|
533
|
-
* @tsplus pipeable fncts.MutableArray foldLeftWithIndex
|
534
|
-
*/
|
535
|
-
function foldLeftWithIndex_1(b, f) {
|
536
|
-
return self => {
|
537
|
-
const len = length_1(self);
|
538
|
-
let r = b;
|
539
|
-
for (let i = 0; i < len; i++) {
|
540
|
-
r = f(i, r, self._array[i]);
|
541
|
-
}
|
542
|
-
return r;
|
543
|
-
};
|
544
|
-
}
|
545
|
-
/**
|
546
|
-
* @tsplus pipeable fncts.ImmutableArray foldLeft
|
547
|
-
* @tsplus pipeable fncts.MutableArray foldLeft
|
548
|
-
*/
|
549
|
-
function foldLeft_1(b, f) {
|
550
|
-
return self => {
|
551
|
-
return foldLeftWithIndex_1(b, (_, b, a) => f(b, a))(self);
|
552
|
-
};
|
553
|
-
}
|
554
|
-
/**
|
555
|
-
* @tsplus pipeable fncts.ImmutableArray foldLeftWhile
|
556
|
-
* @tsplus pipeable fncts.MutableArray foldLeftWhile
|
557
|
-
*/
|
558
|
-
export function foldLeftWhile(b, p, f) {
|
559
|
-
return self => {
|
560
|
-
return foldLeftWithIndexWhile_1(b, p, (_, b, a) => f(b, a))(self);
|
561
|
-
};
|
562
|
-
}
|
563
|
-
/**
|
564
|
-
* @tsplus pipeable fncts.ImmutableArray foldLeftWithIndexWhile
|
565
|
-
* @tsplus pipeable fncts.MutableArray foldLeftWithIndexWhile
|
566
|
-
*/
|
567
|
-
function foldLeftWithIndexWhile_1(b, p, f) {
|
568
|
-
return self => {
|
569
|
-
let out = b;
|
570
|
-
let cont = p(out);
|
571
|
-
for (let i = 0; cont && i < length_1(self); i++) {
|
572
|
-
out = f(i, out, self._array[i]);
|
573
|
-
cont = p(out);
|
574
|
-
}
|
575
|
-
return out;
|
576
|
-
};
|
577
|
-
}
|
578
|
-
/**
|
579
|
-
* @tsplus pipeable fncts.ImmutableArray fold
|
580
|
-
*/
|
581
|
-
function fold_1(/** @tsplus auto */M) {
|
582
|
-
return self => {
|
583
|
-
return foldLeft_1(M.nat, (b, a) => M.combine(a)(b))(self);
|
584
|
-
};
|
585
|
-
}
|
586
|
-
/**
|
587
|
-
* @tsplus pipeable fncts.ImmutableArray foldMapWithIndex
|
588
|
-
*/
|
589
|
-
function foldMapWithIndex_1(f, /** @tsplus auto */M) {
|
590
|
-
return self => {
|
591
|
-
return foldLeftWithIndex_1(M.nat, (i, b, a) => M.combine(f(i, a))(b))(self);
|
592
|
-
};
|
593
|
-
}
|
594
|
-
/**
|
595
|
-
* @tsplus pipeable fncts.ImmutableArray foldMap
|
596
|
-
*/
|
597
|
-
export function foldMap(f, /** @tsplus auto */M) {
|
598
|
-
return self => {
|
599
|
-
return foldMapWithIndex_1((_, a) => f(a), M)(self);
|
600
|
-
};
|
601
|
-
}
|
602
|
-
/**
|
603
|
-
* @tsplus pipeable fncts.ImmutableArray foldRightWithIndex
|
604
|
-
*/
|
605
|
-
function foldRightWithIndex_1(b, f) {
|
606
|
-
return self => {
|
607
|
-
let r = b;
|
608
|
-
for (let i = length_1(self) - 1; i >= 0; i--) {
|
609
|
-
r = f(i, self._array[i], r);
|
610
|
-
}
|
611
|
-
return r;
|
612
|
-
};
|
613
|
-
}
|
614
|
-
/**
|
615
|
-
* @tsplus pipeable fncts.ImmutableArray foldRight
|
616
|
-
*/
|
617
|
-
export function foldRight(b, f) {
|
618
|
-
return self => {
|
619
|
-
return foldRightWithIndex_1(b, (_, a, b) => f(a, b))(self);
|
620
|
-
};
|
621
|
-
}
|
622
|
-
/**
|
623
|
-
* @tsplus pipeable fncts.ImmutableArray foldRighWhile
|
624
|
-
*/
|
625
|
-
export function foldRightWhile(b, p, f) {
|
626
|
-
return self => {
|
627
|
-
return foldRightWithIndexWhile_1(b, p, (_, a, b) => f(a, b))(self);
|
628
|
-
};
|
629
|
-
}
|
630
|
-
/**
|
631
|
-
* @tsplus pipeable fncts.ImmutableArray foldRightWithIndexWhile
|
632
|
-
*/
|
633
|
-
function foldRightWithIndexWhile_1(b, predicate, f) {
|
634
|
-
return self => {
|
635
|
-
let out = b;
|
636
|
-
let cont = predicate(out);
|
637
|
-
for (let i = length_1(self) - 1; cont && i >= 0; i--) {
|
638
|
-
out = f(i, self._array[i], out);
|
639
|
-
cont = predicate(out);
|
640
|
-
}
|
641
|
-
return out;
|
642
|
-
};
|
643
|
-
}
|
644
|
-
/**
|
645
|
-
* @tsplus pipeable fncts.ImmutableArray forEach
|
646
|
-
*/
|
647
|
-
function forEach_1(f) {
|
648
|
-
return self => {
|
649
|
-
return forEach_1(f)(self);
|
650
|
-
};
|
651
|
-
}
|
652
|
-
/**
|
653
|
-
* @tsplus pipeable fncts.ImmutableArray get
|
654
|
-
* @tsplus pipeable fncts.MutableArray get
|
655
|
-
*/
|
656
|
-
function get_1(i) {
|
657
|
-
return self => {
|
658
|
-
return isOutOfBound_1(i)(self) ? tsplus_module_11.nothing(fileName_1 + ":728:42") : tsplus_module_11.just(self._array[i], fileName_1 + ":728:51");
|
659
|
-
};
|
660
|
-
}
|
661
|
-
/**
|
662
|
-
* @tsplus pipeable fncts.ImmutableArray group
|
663
|
-
*/
|
664
|
-
export function group(E) {
|
665
|
-
return chop_1(self => {
|
666
|
-
const h = self._array[0];
|
667
|
-
const out = [h];
|
668
|
-
let i = 1;
|
669
|
-
for (; i < length_1(self); i++) {
|
670
|
-
const a = self._array[i];
|
671
|
-
if (E.equals(h)(a)) {
|
672
|
-
out.push(a);
|
673
|
-
} else {
|
674
|
-
break;
|
675
|
-
}
|
676
|
-
}
|
677
|
-
return [tsplus_module_12.unsafeAsNonEmptyArray(out), tsplus_module_4.slice(i)(self)];
|
678
|
-
});
|
679
|
-
}
|
680
|
-
/**
|
681
|
-
* @tsplus pipeable fncts.ImmutableArray groupBy
|
682
|
-
*/
|
683
|
-
export function groupBy(f) {
|
684
|
-
return self => {
|
685
|
-
const out = {};
|
686
|
-
for (let i = 0; i < length_1(self); i++) {
|
687
|
-
const a = self._array[i];
|
688
|
-
const k = f(a);
|
689
|
-
if (Object.prototype.hasOwnProperty.call(out, k)) {
|
690
|
-
out[k].push(a);
|
691
|
-
} else {
|
692
|
-
out[k] = [a];
|
693
|
-
}
|
694
|
-
}
|
695
|
-
return tsplus_module_14.map(tsplus_module_12.from)(tsplus_module_13.Dictionary.get(out));
|
696
|
-
};
|
697
|
-
}
|
698
|
-
/**
|
699
|
-
* @tsplus getter fncts.ImmutableArray head
|
700
|
-
*/
|
701
|
-
export function head(self) {
|
702
|
-
return tsplus_module_5.isNonEmpty(self) ? tsplus_module_11.just(self._array[0], fileName_1 + ":775:34") : tsplus_module_11.nothing(fileName_1 + ":775:60");
|
703
|
-
}
|
704
|
-
/**
|
705
|
-
* @tsplus getter fncts.ImmutableArray init
|
706
|
-
*/
|
707
|
-
export function init(self) {
|
708
|
-
const len = length_1(self);
|
709
|
-
return len === 0 ? tsplus_module_11.nothing(fileName_1 + ":783:29") : tsplus_module_11.just(tsplus_module_4.slice(0, len - 1)(self), fileName_1 + ":783:38");
|
710
|
-
}
|
711
|
-
/**
|
712
|
-
* @tsplus pipeable fncts.ImmutableArray insertAt
|
713
|
-
*/
|
714
|
-
export function insertAt(i, a) {
|
715
|
-
return self => {
|
716
|
-
return isOutOfBound_1(i)(self) ? tsplus_module_11.nothing(fileName_1 + ":791:42") : tsplus_module_11.just(unsafeInsertAt_1(i, a)(self), fileName_1 + ":791:51");
|
717
|
-
};
|
718
|
-
}
|
719
|
-
/**
|
720
|
-
* @tsplus pipeable fncts.ImmutableArray intersection
|
721
|
-
*/
|
722
|
-
export function intersection(that, /** @tsplus auto */E) {
|
723
|
-
return self => {
|
724
|
-
return filter_1(a => elem_1(a, E)(that))(self);
|
725
|
-
};
|
726
|
-
}
|
727
|
-
/**
|
728
|
-
* @tsplus pipeable fncts.ImmutableArray intersperse
|
729
|
-
*/
|
730
|
-
export function intersperse(a) {
|
731
|
-
return self => {
|
732
|
-
const len = length_1(self);
|
733
|
-
return len === 0 ? self : prepend_1(unsafeGet_1(self, 0))(prependAll_1(a)(tsplus_module_4.slice(1, len)(self)));
|
734
|
-
};
|
735
|
-
}
|
736
|
-
/**
|
737
|
-
* @tsplus fluent fncts.ImmutableArray isEmpty
|
738
|
-
*/
|
739
|
-
function isEmpty_1(self) {
|
740
|
-
return length_1(self) === 0;
|
741
|
-
}
|
742
|
-
/**
|
743
|
-
* @tsplus pipeable fncts.ImmutableArray isOutOfBound
|
744
|
-
*/
|
745
|
-
function isOutOfBound_1(i) {
|
746
|
-
return self => {
|
747
|
-
return i < 0 || i >= length_1(self);
|
748
|
-
};
|
749
|
-
}
|
750
|
-
/**
|
751
|
-
* @tsplus pipeable fncts.ImmutableArray join
|
752
|
-
*/
|
753
|
-
export function join(separator) {
|
754
|
-
return self => {
|
755
|
-
return self._array.join(separator);
|
756
|
-
};
|
757
|
-
}
|
758
|
-
/**
|
759
|
-
* @tsplus getter fncts.ImmutableArray last
|
760
|
-
*/
|
761
|
-
export function last(self) {
|
762
|
-
return get_1(length_1(self) - 1)(self);
|
763
|
-
}
|
764
|
-
/**
|
765
|
-
* @tsplus getter fncts.ImmutableArray length
|
766
|
-
*/
|
767
|
-
function length_1(self) {
|
768
|
-
return self._array.length;
|
769
|
-
}
|
770
|
-
/**
|
771
|
-
* @tsplus getter fncts.ImmutableArray lefts
|
772
|
-
*/
|
773
|
-
export function lefts(self) {
|
774
|
-
const ls = [];
|
775
|
-
for (let i = 0; i < length_1(self); i++) {
|
776
|
-
const a = self._array[i];
|
777
|
-
void 0;
|
778
|
-
if (a._tag === "Left" /* EitherTag.Left */) {
|
779
|
-
ls.push(a.left);
|
780
|
-
}
|
781
|
-
}
|
782
|
-
return tsplus_module_2.asImmutableArray(ls);
|
783
|
-
}
|
784
|
-
/**
|
785
|
-
* @tsplus pipeable fncts.ImmutableArray map
|
786
|
-
*/
|
787
|
-
function map_1(f) {
|
788
|
-
return self => {
|
789
|
-
return mapWithIndex_1((_, a) => f(a))(self);
|
790
|
-
};
|
791
|
-
}
|
792
|
-
/**
|
793
|
-
* @tsplus pipeable fncts.ImmutableArray mapAccum
|
794
|
-
*/
|
795
|
-
export function mapAccum(s, f) {
|
796
|
-
return self => {
|
797
|
-
const bs = Array(length_1(self));
|
798
|
-
let state = s;
|
799
|
-
for (let i = 0; i < length_1(self); i++) {
|
800
|
-
const result = f(state, self._array[i]);
|
801
|
-
bs[i] = result[0];
|
802
|
-
state = result[1];
|
803
|
-
}
|
804
|
-
return [tsplus_module_2.asImmutableArray(bs), state];
|
805
|
-
};
|
806
|
-
}
|
807
|
-
/**
|
808
|
-
* @tsplus pipeable fncts.ImmutableArray mapWithIndex
|
809
|
-
*/
|
810
|
-
function mapWithIndex_1(f) {
|
811
|
-
return self => {
|
812
|
-
const len = self._array.length;
|
813
|
-
const bs = Array(len);
|
814
|
-
for (let i = 0; i < len; i++) {
|
815
|
-
bs[i] = f(i, self._array[i]);
|
816
|
-
}
|
817
|
-
return tsplus_module_2.asImmutableArray(bs);
|
818
|
-
};
|
819
|
-
}
|
820
|
-
/**
|
821
|
-
* @tsplus pipeable fncts.ImmutableArray modifyAt
|
822
|
-
*/
|
823
|
-
export function modifyAt(i, f) {
|
824
|
-
return self => {
|
825
|
-
return isOutOfBound_1(i)(self) ? tsplus_module_11.nothing(fileName_1 + ":912:42") : tsplus_module_11.just(unsafeModifyAt_1(i, f)(self), fileName_1 + ":912:51");
|
826
|
-
};
|
827
|
-
}
|
828
|
-
/**
|
829
|
-
* @tsplus pipeable fncts.ImmutableArray mutate
|
830
|
-
*/
|
831
|
-
function mutate_1(f) {
|
832
|
-
return self => {
|
833
|
-
const mut = mutableClone_1(self);
|
834
|
-
f(mut);
|
835
|
-
return tsplus_module_2.asImmutableArray(mut);
|
836
|
-
};
|
837
|
-
}
|
838
|
-
/**
|
839
|
-
* @tsplus getter fncts.ImmutableArray mutableClone
|
840
|
-
*/
|
841
|
-
function mutableClone_1(self) {
|
842
|
-
return tsplus_module_4.slice(0)(self)._array;
|
843
|
-
}
|
844
|
-
function partitionWithIndex_1(p) {
|
845
|
-
return self => {
|
846
|
-
const left = [];
|
847
|
-
const right = [];
|
848
|
-
for (let i = 0; i < length_1(self); i++) {
|
849
|
-
const a = self._array[i];
|
850
|
-
if (p(i, a)) {
|
851
|
-
right.push(a);
|
852
|
-
} else {
|
853
|
-
left.push(a);
|
854
|
-
}
|
855
|
-
}
|
856
|
-
return [tsplus_module_2.asImmutableArray(left), tsplus_module_2.asImmutableArray(right)];
|
857
|
-
};
|
858
|
-
}
|
859
|
-
export function partition(p) {
|
860
|
-
return self => {
|
861
|
-
return partitionWithIndex_1((_, a) => p(a))(self);
|
862
|
-
};
|
863
|
-
}
|
864
|
-
/**
|
865
|
-
* @tsplus pipeable fncts.ImmutableArray partitionMapWithIndex
|
866
|
-
*/
|
867
|
-
function partitionMapWithIndex_1(f) {
|
868
|
-
return self => {
|
869
|
-
const left = [];
|
870
|
-
const right = [];
|
871
|
-
for (let i = 0; i < length_1(self); i++) {
|
872
|
-
const ea = f(i, self._array[i]);
|
873
|
-
void 0;
|
874
|
-
switch (ea._tag) {
|
875
|
-
case "Left" /* EitherTag.Left */:
|
876
|
-
left.push(ea.left);
|
877
|
-
break;
|
878
|
-
case "Right" /* EitherTag.Right */:
|
879
|
-
right.push(ea.right);
|
880
|
-
break;
|
881
|
-
}
|
882
|
-
}
|
883
|
-
return [tsplus_module_2.asImmutableArray(left), tsplus_module_2.asImmutableArray(right)];
|
884
|
-
};
|
885
|
-
}
|
886
|
-
/**
|
887
|
-
* @tsplus pipeable fncts.ImmutableArray partitionMap
|
888
|
-
*/
|
889
|
-
export function partitionMap(f) {
|
890
|
-
return self => {
|
891
|
-
return partitionMapWithIndex_1((_, a) => f(a))(self);
|
892
|
-
};
|
893
|
-
}
|
894
|
-
/**
|
895
|
-
* @tsplus pipeable fncts.ImmutableArray prepend
|
896
|
-
*/
|
897
|
-
function prepend_1(head) {
|
898
|
-
return self => {
|
899
|
-
const len = length_1(self);
|
900
|
-
const out = Array(len + 1);
|
901
|
-
out[0] = head;
|
902
|
-
for (let i = 0; i < len; i++) {
|
903
|
-
out[i + 1] = self._array[i];
|
904
|
-
}
|
905
|
-
return tsplus_module_2.asImmutableArray(out);
|
906
|
-
};
|
907
|
-
}
|
908
|
-
/**
|
909
|
-
* @tsplus pipeable fncts.ImmutableArray prependAll
|
910
|
-
*/
|
911
|
-
function prependAll_1(a) {
|
912
|
-
return self => {
|
913
|
-
const out = [];
|
914
|
-
for (let i = 0; i < length_1(self); i++) {
|
915
|
-
out.push(a, self._array[i]);
|
916
|
-
}
|
917
|
-
return tsplus_module_2.asImmutableArray(out);
|
918
|
-
};
|
919
|
-
}
|
920
|
-
/**
|
921
|
-
* @tsplus getter fncts.ImmutableArray reverse
|
922
|
-
*/
|
923
|
-
export function reverse(self) {
|
924
|
-
if (isEmpty_1(self)) {
|
925
|
-
return self;
|
926
|
-
} else if (length_1(self) === 1) {
|
927
|
-
return tsplus_module_2.make(self._array[0]);
|
928
|
-
} else {
|
929
|
-
const out = Array(length_1(self));
|
930
|
-
for (let j = 0, i = length_1(self) - 1; i >= 0; i--, j++) {
|
931
|
-
out[j] = self._array[i];
|
932
|
-
}
|
933
|
-
return tsplus_module_2.asImmutableArray(out);
|
934
|
-
}
|
935
|
-
}
|
936
|
-
/**
|
937
|
-
* @tsplus getter fncts.ImmutableArray rights
|
938
|
-
*/
|
939
|
-
export function rights(self) {
|
940
|
-
const rs = [];
|
941
|
-
for (let i = 0; i < length_1(self); i++) {
|
942
|
-
const a = self._array[i];
|
943
|
-
void 0;
|
944
|
-
if (a._tag === "Right" /* EitherTag.Right */) {
|
945
|
-
rs.push(a.right);
|
946
|
-
}
|
947
|
-
}
|
948
|
-
return tsplus_module_2.asImmutableArray(rs);
|
949
|
-
}
|
950
|
-
/**
|
951
|
-
* @tsplus pipeable fncts.ImmutableArray rotate
|
952
|
-
*/
|
953
|
-
function rotate_1(n) {
|
954
|
-
return self => {
|
955
|
-
const len = length_1(self);
|
956
|
-
if (n === 0 || len <= 1 || len === Math.abs(n)) {
|
957
|
-
return self;
|
958
|
-
} else if (n < 0) {
|
959
|
-
return rotate_1(len + n)(self);
|
960
|
-
} else {
|
961
|
-
return concat_1(tsplus_module_4.slice(0, len - n)(self))(tsplus_module_4.slice(-n)(self));
|
962
|
-
}
|
963
|
-
};
|
964
|
-
}
|
965
|
-
/**
|
966
|
-
* @tsplus pipeable fncts.ImmutableArray scanLeft
|
967
|
-
*/
|
968
|
-
export function scanLeft(b, f) {
|
969
|
-
return self => {
|
970
|
-
const l = length_1(self);
|
971
|
-
const r = Array(l + 1);
|
972
|
-
r[0] = b;
|
973
|
-
for (let i = 0; i < l; i++) {
|
974
|
-
r[i + 1] = f(r[i], self._array[i]);
|
975
|
-
}
|
976
|
-
return tsplus_module_2.asImmutableArray(r);
|
977
|
-
};
|
978
|
-
}
|
979
|
-
/**
|
980
|
-
* @tsplus pipeable fncts.ImmutableArray scanRight
|
981
|
-
*/
|
982
|
-
export function scanRight(b, f) {
|
983
|
-
return self => {
|
984
|
-
const l = length_1(self);
|
985
|
-
const r = Array(l + 1);
|
986
|
-
r[l] = b;
|
987
|
-
for (let i = l - 1; i >= 0; i--) {
|
988
|
-
r[i] = f(self._array[i], r[i + 1]);
|
989
|
-
}
|
990
|
-
return tsplus_module_2.asImmutableArray(r);
|
991
|
-
};
|
992
|
-
}
|
993
|
-
/**
|
994
|
-
* @tsplus pipeable fncts.ImmutableArray sort
|
995
|
-
*/
|
996
|
-
function sort_1(/** @tsplus auto */O) {
|
997
|
-
return self => {
|
998
|
-
return isEmpty_1(self) || length_1(self) === 1 ? self : tsplus_module_2.asImmutableArray(self._array.slice().sort((a, b) => O.compare(b)(a)));
|
999
|
-
};
|
1000
|
-
}
|
1001
|
-
/**
|
1002
|
-
* @tsplus pipeable fncts.ImmutableArray sortBy
|
1003
|
-
*/
|
1004
|
-
export function sortBy(Os) {
|
1005
|
-
return self => {
|
1006
|
-
return sort_1(fold_1(tsplus_module_15.getMonoid())(Os))(self);
|
1007
|
-
};
|
1008
|
-
}
|
1009
|
-
export function spanLeft(p) {
|
1010
|
-
return self => {
|
1011
|
-
const i = spanIndexLeft_1(p)(self);
|
1012
|
-
const init = Array(i);
|
1013
|
-
for (let j = 0; j < i; j++) {
|
1014
|
-
init[j] = self._array[j];
|
1015
|
-
}
|
1016
|
-
const l = length_1(self);
|
1017
|
-
const rest = Array(l - i);
|
1018
|
-
for (let j = i; j < l; j++) {
|
1019
|
-
rest[j - i] = self._array[j];
|
1020
|
-
}
|
1021
|
-
return [tsplus_module_2.asImmutableArray(init), tsplus_module_2.asImmutableArray(rest)];
|
1022
|
-
};
|
1023
|
-
}
|
1024
|
-
export function spanRight(p) {
|
1025
|
-
return self => {
|
1026
|
-
const i = spanIndexRight_1(p)(self);
|
1027
|
-
const l = length_1(self);
|
1028
|
-
const tail = Array(l - i - 1);
|
1029
|
-
for (let j = l - 1; j > i; j--) {
|
1030
|
-
tail[j - i - 1] = self._array[j];
|
1031
|
-
}
|
1032
|
-
const rest = Array(i);
|
1033
|
-
for (let j = i; j >= 0; j--) {
|
1034
|
-
rest[j] = self._array[j];
|
1035
|
-
}
|
1036
|
-
return [tsplus_module_2.asImmutableArray(rest), tsplus_module_2.asImmutableArray(tail)];
|
1037
|
-
};
|
1038
|
-
}
|
1039
|
-
/**
|
1040
|
-
* @tsplus pipeable fncts.ImmutableArray spanIndexLeft
|
1041
|
-
*/
|
1042
|
-
function spanIndexLeft_1(p) {
|
1043
|
-
return self => {
|
1044
|
-
const l = length_1(self);
|
1045
|
-
let i = 0;
|
1046
|
-
for (; i < l; i++) {
|
1047
|
-
if (!p(self._array[i])) {
|
1048
|
-
break;
|
1049
|
-
}
|
1050
|
-
}
|
1051
|
-
return i;
|
1052
|
-
};
|
1053
|
-
}
|
1054
|
-
/**
|
1055
|
-
* @tsplus pipeable fncts.ImmutableArray spanIndexRight
|
1056
|
-
*/
|
1057
|
-
function spanIndexRight_1(predicate) {
|
1058
|
-
return as => {
|
1059
|
-
let i = length_1(as) - 1;
|
1060
|
-
for (; i >= 0; i--) {
|
1061
|
-
if (!predicate(as._array[i])) {
|
1062
|
-
break;
|
1063
|
-
}
|
1064
|
-
}
|
1065
|
-
return i;
|
1066
|
-
};
|
1067
|
-
}
|
1068
|
-
/**
|
1069
|
-
* @tsplus getter fncts.ImmutableArray tail
|
1070
|
-
*/
|
1071
|
-
export function tail(self) {
|
1072
|
-
return tsplus_module_5.isNonEmpty(self) ? tsplus_module_11.just(tsplus_module_4.slice(1)(self), fileName_1 + ":1217:34") : tsplus_module_11.nothing(fileName_1 + ":1217:59");
|
1073
|
-
}
|
1074
|
-
/**
|
1075
|
-
* @tsplus pipeable fncts.ImmutableArray take
|
1076
|
-
*/
|
1077
|
-
export function take(n) {
|
1078
|
-
return self => {
|
1079
|
-
return tsplus_module_4.slice(0, n)(self);
|
1080
|
-
};
|
1081
|
-
}
|
1082
|
-
/**
|
1083
|
-
* @tsplus pipeable fncts.ImmutableArray takeLast
|
1084
|
-
*/
|
1085
|
-
export function takeLast(n) {
|
1086
|
-
return as => {
|
1087
|
-
return isEmpty_1(as) ? tsplus_module_2.empty() : tsplus_module_4.slice(-n)(as);
|
1088
|
-
};
|
1089
|
-
}
|
1090
|
-
export function takeWhile(p) {
|
1091
|
-
return self => {
|
1092
|
-
const i = spanIndexLeft_1(p)(self);
|
1093
|
-
const init = Array(i);
|
1094
|
-
for (let j = 0; j < i; j++) {
|
1095
|
-
init[j] = self._array[j];
|
1096
|
-
}
|
1097
|
-
return tsplus_module_2.asImmutableArray(init);
|
1098
|
-
};
|
1099
|
-
}
|
1100
|
-
function _traverseWithIndex_1(self) {
|
1101
|
-
return G => f => foldLeftWithIndex_1(G.pure(tsplus_module_2.empty()), (i, fbs, a) => G.zipWith(f(i, a), (bs, b) => append_1(b)(bs))(fbs))(self);
|
1102
|
-
}
|
1103
|
-
/**
|
1104
|
-
* @tsplus getter fncts.ImmutableArray traverse
|
1105
|
-
*/
|
1106
|
-
function _traverse_1(self) {
|
1107
|
-
return G => f => _traverseWithIndex_1(self)(G)((_, a) => f(a));
|
1108
|
-
}
|
1109
|
-
export const traverseWithIndex = G => f => self => _traverseWithIndex_1(self)(G)(f);
|
1110
|
-
export const traverse = G => f => self => _traverseWithIndex_1(self)(G)((_, a) => f(a));
|
1111
|
-
/**
|
1112
|
-
* @tsplus pipeable fncts.ImmutableArray union
|
1113
|
-
*/
|
1114
|
-
export function union(that, /** @tsplus auto */E) {
|
1115
|
-
return self => {
|
1116
|
-
return concat_1(filter_1(a => !elem_1(a, E)(self))(that))(self);
|
1117
|
-
};
|
1118
|
-
}
|
1119
|
-
/**
|
1120
|
-
* @tsplus pipeable fncts.ImmutableArray uniq
|
1121
|
-
*/
|
1122
|
-
export function uniq(/** @tsplus auto */E) {
|
1123
|
-
return self => {
|
1124
|
-
if (length_1(self) === 1) {
|
1125
|
-
return self;
|
1126
|
-
}
|
1127
|
-
const out = [];
|
1128
|
-
const len = length_1(self);
|
1129
|
-
for (let i = 0; i < len; i++) {
|
1130
|
-
const a = self._array[i];
|
1131
|
-
if (!elem_1(a, E)(tsplus_module_2.asImmutableArray(out))) {
|
1132
|
-
out.push(a);
|
1133
|
-
}
|
1134
|
-
}
|
1135
|
-
return tsplus_module_2.asImmutableArray(out);
|
1136
|
-
};
|
1137
|
-
}
|
1138
|
-
/**
|
1139
|
-
* @tsplus getter fncts.ImmutableArray unprepend
|
1140
|
-
*/
|
1141
|
-
export function unprepend(self) {
|
1142
|
-
return tsplus_module_5.isNonEmpty(self) ? tsplus_module_11.just([unsafeGet_1(self, 0), tsplus_module_4.slice(1)(self)], fileName_1 + ":1328:34") : tsplus_module_11.nothing(fileName_1 + ":1328:71");
|
1143
|
-
}
|
1144
|
-
/**
|
1145
|
-
* @tsplus index fncts.ImmutableArray
|
1146
|
-
*/
|
1147
|
-
function unsafeGet_1(self, i) {
|
1148
|
-
return self._array[i];
|
1149
|
-
}
|
1150
|
-
/**
|
1151
|
-
* @tsplus getter fncts.ImmutableArray unsafeAsMutable
|
1152
|
-
*/
|
1153
|
-
function unsafeAsMutable_1(self) {
|
1154
|
-
return self._array;
|
1155
|
-
}
|
1156
|
-
/**
|
1157
|
-
* @tsplus pipeable fncts.ImmutableArray unsafeDeleteAt
|
1158
|
-
*/
|
1159
|
-
function unsafeDeleteAt_1(i) {
|
1160
|
-
return self => {
|
1161
|
-
return mutate_1(xs => {
|
1162
|
-
xs.splice(i, 1);
|
1163
|
-
})(self);
|
1164
|
-
};
|
1165
|
-
}
|
1166
|
-
/**
|
1167
|
-
* @tsplus pipeable fncts.ImmutableArray unsafeInsertAt
|
1168
|
-
*/
|
1169
|
-
function unsafeInsertAt_1(i, a) {
|
1170
|
-
return as => {
|
1171
|
-
return mutate_1(xs => {
|
1172
|
-
xs.splice(i, 0, a);
|
1173
|
-
})(as);
|
1174
|
-
};
|
1175
|
-
}
|
1176
|
-
/**
|
1177
|
-
* @tsplus pipeable fncts.ImmutableArray unsafeModifyAt
|
1178
|
-
*/
|
1179
|
-
function unsafeModifyAt_1(i, f) {
|
1180
|
-
return as => {
|
1181
|
-
const next = f(unsafeGet_1(as, i));
|
1182
|
-
if (unsafeGet_1(as, i) === next) {
|
1183
|
-
return as;
|
1184
|
-
}
|
1185
|
-
return mutate_1(xs => {
|
1186
|
-
xs[i] = next;
|
1187
|
-
})(as);
|
1188
|
-
};
|
1189
|
-
}
|
1190
|
-
/**
|
1191
|
-
* @tsplus pipeable fncts.ImmutableArray unsafeUpdateAt
|
1192
|
-
*/
|
1193
|
-
function unsafeUpdateAt_1(i, a) {
|
1194
|
-
return as => {
|
1195
|
-
if (unsafeGet_1(as, i) === a) {
|
1196
|
-
return as;
|
1197
|
-
} else {
|
1198
|
-
return mutate_1(xs => {
|
1199
|
-
xs[i] = a;
|
1200
|
-
})(as);
|
1201
|
-
}
|
1202
|
-
};
|
1203
|
-
}
|
1204
|
-
/**
|
1205
|
-
* @tsplus getter fncts.ImmutableArray unzip
|
1206
|
-
*/
|
1207
|
-
export function unzip(self) {
|
1208
|
-
const fa = Array(length_1(self));
|
1209
|
-
const fb = Array(length_1(self));
|
1210
|
-
for (let i = 0; i < length_1(self); i++) {
|
1211
|
-
fa[i] = self._array[i][0];
|
1212
|
-
fb[i] = self._array[i][1];
|
1213
|
-
}
|
1214
|
-
return [tsplus_module_2.asImmutableArray(fa), tsplus_module_2.asImmutableArray(fb)];
|
1215
|
-
}
|
1216
|
-
/**
|
1217
|
-
* @tsplus pipeable fncts.ImmutableArray updateAt
|
1218
|
-
*/
|
1219
|
-
export function updateAt(i, a) {
|
1220
|
-
return as => {
|
1221
|
-
return isOutOfBound_1(i)(as) ? tsplus_module_11.nothing(fileName_1 + ":1417:40") : tsplus_module_11.just(unsafeUpdateAt_1(i, a)(as), fileName_1 + ":1417:49");
|
1222
|
-
};
|
1223
|
-
}
|
1224
|
-
/**
|
1225
|
-
* @tsplus getter fncts.ImmutableArray wiltWithIndex
|
1226
|
-
*/
|
1227
|
-
function _wiltWithIndex_1(self) {
|
1228
|
-
return G => f => G.map(([b1s, b2s]) => [tsplus_module_2.asImmutableArray(b1s), tsplus_module_2.asImmutableArray(b2s)])(foldLeftWithIndex_1(G.pure([[], []]), (i, fbs, a) => G.zipWith(fbs, (eb, r) => tsplus_module_16.match(b1 => {
|
1229
|
-
r[0].push(b1);
|
1230
|
-
return r;
|
1231
|
-
}, b2 => {
|
1232
|
-
r[1].push(b2);
|
1233
|
-
return r;
|
1234
|
-
})(eb))(f(i, a)))(self));
|
1235
|
-
}
|
1236
|
-
/**
|
1237
|
-
* @tsplus getter fncts.ImmutableArray wilt
|
1238
|
-
*/
|
1239
|
-
export function _wilt(self) {
|
1240
|
-
return G => f => _wiltWithIndex_1(self)(G)((_, a) => f(a));
|
1241
|
-
}
|
1242
|
-
/**
|
1243
|
-
* @tsplus getter fncts.ImmutableArray witherWithIndex
|
1244
|
-
*/
|
1245
|
-
function _witherWithIndex_1(self) {
|
1246
|
-
return G => f => G.map(bs => tsplus_module_2.asImmutableArray(bs))(foldLeftWithIndex_1(G.pure([]), (i, b, a) => G.zipWith(b, (maybeB, bs) => {
|
1247
|
-
if (tsplus_module_6.isJust(maybeB)) {
|
1248
|
-
bs.push(maybeB.value);
|
1249
|
-
}
|
1250
|
-
return bs;
|
1251
|
-
})(f(i, a)))(self));
|
1252
|
-
}
|
1253
|
-
/**
|
1254
|
-
* @tsplus getter fncts.ImmutableArray wither
|
1255
|
-
*/
|
1256
|
-
export function _wither(self) {
|
1257
|
-
return G => f => _witherWithIndex_1(self)(G)((_, a) => f(a));
|
1258
|
-
}
|
1259
|
-
export const wiltWithIndex = G => f => self => _wiltWithIndex_1(self)(G)(f);
|
1260
|
-
export const wilt = G => f => self => _wiltWithIndex_1(self)(G)((_, a) => f(a));
|
1261
|
-
export const witherWithIndex = G => f => self => _witherWithIndex_1(self)(G)(f);
|
1262
|
-
export const wither = G => f => self => _witherWithIndex_1(self)(G)((_, a) => f(a));
|
1263
|
-
/**
|
1264
|
-
* @tsplus pipeable fncts.ImmutableArray zip
|
1265
|
-
*/
|
1266
|
-
export function zip(that) {
|
1267
|
-
return self => {
|
1268
|
-
return zipWith_1(that, tuple)(self);
|
1269
|
-
};
|
1270
|
-
}
|
1271
|
-
/**
|
1272
|
-
* @tsplus pipeable fncts.ImmutableArray zipWith
|
1273
|
-
*/
|
1274
|
-
function zipWith_1(fb, f) {
|
1275
|
-
return self => {
|
1276
|
-
const len = Math.min(length_1(self), length_1(fb));
|
1277
|
-
const fc = Array(len);
|
1278
|
-
for (let i = 0; i < len; i++) {
|
1279
|
-
fc[i] = f(self._array[i], fb._array[i]);
|
1280
|
-
}
|
1281
|
-
return tsplus_module_2.asImmutableArray(fc);
|
1282
|
-
};
|
1283
|
-
}
|
1284
|
-
//# sourceMappingURL=api.mjs.map
|