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