@fncts/base 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_cjs/collection/Iterable/api/traverseConc.cjs +21 -15
- package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -1
- package/_cjs/collection/Iterable/api.cjs +23 -37
- package/_cjs/collection/Iterable/api.cjs.map +1 -1
- package/_cjs/collection/compat/Array/api.cjs +1 -1
- package/_cjs/collection/compat/Array/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/api.cjs +41 -53
- package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/definition.cjs +49 -39
- package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Dictionary/definition.cjs +4 -2
- package/_cjs/collection/immutable/Dictionary/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/api.cjs +35 -108
- package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/definition.cjs +19 -15
- package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashSet/api.cjs +10 -10
- package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api.cjs +153 -248
- package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs +12 -10
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs +153 -157
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +118 -181
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs +3 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs +45 -81
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/List/api.cjs +4 -7
- package/_cjs/collection/immutable/List/api.cjs.map +1 -1
- package/_cjs/collection/immutable/RoseTree/api.cjs +485 -0
- package/_cjs/collection/immutable/RoseTree/api.cjs.map +1 -0
- package/_cjs/collection/immutable/RoseTree/definition.cjs +58 -0
- package/_cjs/collection/immutable/RoseTree/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/RoseTree.cjs +32 -0
- package/_cjs/collection/immutable/RoseTree.cjs.map +1 -0
- package/_cjs/collection/immutable/SortedMap/api.cjs +65 -65
- package/_cjs/collection/immutable/SortedMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/api.cjs +70 -15
- package/_cjs/collection/immutable/Vector/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/definition.cjs +13 -11
- package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -1
- package/_cjs/collection/mutable/HashMap.cjs +5 -5
- package/_cjs/collection/mutable/HashMap.cjs.map +1 -1
- package/_cjs/collection/mutable/HashSet.cjs +4 -4
- package/_cjs/collection/mutable/HashSet.cjs.map +1 -1
- package/_cjs/control/Eval/api.cjs +6 -0
- package/_cjs/control/Eval/api.cjs.map +1 -1
- package/_cjs/control/Eval/definition.cjs +7 -0
- package/_cjs/control/Eval/definition.cjs.map +1 -1
- package/_cjs/control/Eval/instance.cjs +14 -25
- package/_cjs/control/Eval/instance.cjs.map +1 -1
- package/_cjs/control/Z/definition.cjs +9 -3
- package/_cjs/control/Z/definition.cjs.map +1 -1
- package/_cjs/control/Z/instances.cjs +6 -13
- package/_cjs/control/Z/instances.cjs.map +1 -1
- package/_cjs/data/Branded/definition.cjs +29 -0
- package/_cjs/data/Branded/definition.cjs.map +1 -0
- package/_cjs/data/Branded/derivations.cjs +58 -0
- package/_cjs/data/Branded/derivations.cjs.map +1 -0
- package/_cjs/data/Branded.cjs +32 -0
- package/_cjs/data/Branded.cjs.map +1 -0
- package/_cjs/data/Cause/api/fold.cjs +2 -0
- package/_cjs/data/Cause/api/fold.cjs.map +1 -1
- package/_cjs/data/Cause/api.cjs +23 -0
- package/_cjs/data/Cause/api.cjs.map +1 -1
- package/_cjs/data/Const/api.cjs +3 -7
- package/_cjs/data/Const/api.cjs.map +1 -1
- package/_cjs/data/Const/definition.cjs +19 -1
- package/_cjs/data/Const/definition.cjs.map +1 -1
- package/_cjs/data/Const/instances.cjs +9 -20
- package/_cjs/data/Const/instances.cjs.map +1 -1
- package/_cjs/data/DecodeError/definition.cjs +308 -0
- package/_cjs/data/DecodeError/definition.cjs.map +1 -0
- package/_cjs/data/DecodeError.cjs +19 -0
- package/_cjs/data/DecodeError.cjs.map +1 -0
- package/_cjs/data/Decoder/api.cjs +217 -0
- package/_cjs/data/Decoder/api.cjs.map +1 -0
- package/_cjs/data/Decoder/definition.cjs +41 -0
- package/_cjs/data/Decoder/definition.cjs.map +1 -0
- package/_cjs/data/Decoder.cjs +32 -0
- package/_cjs/data/Decoder.cjs.map +1 -0
- package/_cjs/data/Duration/api.cjs +22 -9
- package/_cjs/data/Duration/api.cjs.map +1 -1
- package/_cjs/data/Either/api/alignWith.cjs +2 -0
- package/_cjs/data/Either/api/alignWith.cjs.map +1 -1
- package/_cjs/data/Either/api.cjs +105 -42
- package/_cjs/data/Either/api.cjs.map +1 -1
- package/_cjs/data/Either/definition.cjs +39 -10
- package/_cjs/data/Either/definition.cjs.map +1 -1
- package/_cjs/data/Either/destructors.cjs +2 -0
- package/_cjs/data/Either/destructors.cjs.map +1 -1
- package/_cjs/data/Either/instances.cjs +123 -40
- package/_cjs/data/Either/instances.cjs.map +1 -1
- package/_cjs/data/Environment/api.cjs +29 -8
- package/_cjs/data/Environment/api.cjs.map +1 -1
- package/_cjs/data/Identity/api.cjs +35 -6
- package/_cjs/data/Identity/api.cjs.map +1 -1
- package/_cjs/data/Identity/definition.cjs +10 -1
- package/_cjs/data/Identity/definition.cjs.map +1 -1
- package/_cjs/data/Identity/instances.cjs +11 -25
- package/_cjs/data/Identity/instances.cjs.map +1 -1
- package/_cjs/data/Interval.cjs +154 -0
- package/_cjs/data/Interval.cjs.map +1 -0
- package/_cjs/data/Maybe/api.cjs +30 -43
- package/_cjs/data/Maybe/api.cjs.map +1 -1
- package/_cjs/data/Maybe/definition.cjs +45 -18
- package/_cjs/data/Maybe/definition.cjs.map +1 -1
- package/_cjs/data/Maybe/destructors.cjs +1 -0
- package/_cjs/data/Maybe/destructors.cjs.map +1 -1
- package/_cjs/data/Maybe/instances.cjs +62 -42
- package/_cjs/data/Maybe/instances.cjs.map +1 -1
- package/_cjs/data/Newtype.cjs +5 -3
- package/_cjs/data/Newtype.cjs.map +1 -1
- package/_cjs/data/Patch/api.cjs +1 -1
- package/_cjs/data/Patch/api.cjs.map +1 -1
- package/_cjs/data/Refinement/api.cjs +0 -4
- package/_cjs/data/Refinement/api.cjs.map +1 -1
- package/_cjs/data/Struct/definition.cjs +4 -2
- package/_cjs/data/Struct/definition.cjs.map +1 -1
- package/_cjs/data/These/api.cjs +299 -0
- package/_cjs/data/These/api.cjs.map +1 -0
- package/_cjs/data/These/constructors.cjs +24 -4
- package/_cjs/data/These/constructors.cjs.map +1 -1
- package/_cjs/data/These/definition.cjs +16 -0
- package/_cjs/data/These/definition.cjs.map +1 -1
- package/_cjs/data/These/destructors.cjs +70 -0
- package/_cjs/data/These/destructors.cjs.map +1 -1
- package/_cjs/data/These/instances.cjs +54 -0
- package/_cjs/data/These/instances.cjs.map +1 -0
- package/_cjs/data/These.cjs +13 -0
- package/_cjs/data/These.cjs.map +1 -1
- package/_cjs/data/bigint/definition.cjs +6 -0
- package/_cjs/data/bigint/definition.cjs.map +1 -0
- package/_cjs/data/bigint/instances.cjs +24 -0
- package/_cjs/data/bigint/instances.cjs.map +1 -0
- package/_cjs/data/bigint.cjs +32 -0
- package/_cjs/data/bigint.cjs.map +1 -0
- package/_cjs/data/boolean/definition.cjs +6 -0
- package/_cjs/data/boolean/definition.cjs.map +1 -0
- package/_cjs/data/boolean/instances.cjs +24 -0
- package/_cjs/data/boolean/instances.cjs.map +1 -0
- package/_cjs/data/boolean.cjs +32 -0
- package/_cjs/data/boolean.cjs.map +1 -0
- package/_cjs/data/number/instances.cjs +18 -5
- package/_cjs/data/number/instances.cjs.map +1 -1
- package/_cjs/data/object/instances.cjs +24 -0
- package/_cjs/data/object/instances.cjs.map +1 -0
- package/_cjs/data/string/instances.cjs +24 -9
- package/_cjs/data/string/instances.cjs.map +1 -1
- package/_cjs/internal/Stack.cjs +4 -0
- package/_cjs/internal/Stack.cjs.map +1 -1
- package/_cjs/json/EitherJson.cjs +33 -0
- package/_cjs/json/EitherJson.cjs.map +1 -0
- package/_cjs/json/MaybeJson.cjs +31 -0
- package/_cjs/json/MaybeJson.cjs.map +1 -0
- package/_cjs/json/TheseJson.cjs +37 -0
- package/_cjs/json/TheseJson.cjs.map +1 -0
- package/_cjs/optics/Optional/definition.cjs +6 -4
- package/_cjs/optics/Optional/definition.cjs.map +1 -1
- package/_cjs/optics/Traversal/api/compose.cjs +1 -1
- package/_cjs/optics/Traversal/api/compose.cjs.map +1 -1
- package/_cjs/optics/Traversal/api/fromTraversable.cjs +4 -4
- package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -1
- package/_cjs/optics/Traversal/definition.cjs +17 -12
- package/_cjs/optics/Traversal/definition.cjs.map +1 -1
- package/_cjs/typeclass/Align.cjs +0 -20
- package/_cjs/typeclass/Align.cjs.map +1 -1
- package/_cjs/typeclass/Alt.cjs +5 -15
- package/_cjs/typeclass/Alt.cjs.map +1 -1
- package/_cjs/typeclass/Alternative.cjs +0 -23
- package/_cjs/typeclass/Alternative.cjs.map +1 -1
- package/_cjs/typeclass/Applicative.cjs +0 -22
- package/_cjs/typeclass/Applicative.cjs.map +1 -1
- package/_cjs/typeclass/ApplicativeExcept.cjs +40 -34
- package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -1
- package/_cjs/typeclass/Apply.cjs +93 -49
- package/_cjs/typeclass/Apply.cjs.map +1 -1
- package/_cjs/typeclass/Chain.cjs +40 -17
- package/_cjs/typeclass/Chain.cjs.map +1 -1
- package/_cjs/typeclass/Closure.cjs +1 -4
- package/_cjs/typeclass/Closure.cjs.map +1 -1
- package/_cjs/typeclass/Eq/definition.cjs +18 -0
- package/_cjs/typeclass/Eq/definition.cjs.map +1 -0
- package/_cjs/typeclass/Eq/derivations.cjs +59 -0
- package/_cjs/typeclass/Eq/derivations.cjs.map +1 -0
- package/_cjs/typeclass/Eq.cjs +11 -13
- package/_cjs/typeclass/Eq.cjs.map +1 -1
- package/_cjs/typeclass/Fail.cjs +6 -12
- package/_cjs/typeclass/Fail.cjs.map +1 -1
- package/_cjs/typeclass/Filterable.cjs +31 -18
- package/_cjs/typeclass/Filterable.cjs.map +1 -1
- package/_cjs/typeclass/FilterableWithIndex.cjs +0 -26
- package/_cjs/typeclass/FilterableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Foldable.cjs +33 -19
- package/_cjs/typeclass/Foldable.cjs.map +1 -1
- package/_cjs/typeclass/FoldableWithIndex.cjs +33 -21
- package/_cjs/typeclass/FoldableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Functor.cjs +19 -16
- package/_cjs/typeclass/Functor.cjs.map +1 -1
- package/_cjs/typeclass/FunctorWithIndex.cjs +0 -21
- package/_cjs/typeclass/FunctorWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Guard/api.cjs +40 -0
- package/_cjs/typeclass/Guard/api.cjs.map +1 -0
- package/_cjs/typeclass/Guard/definition.cjs +40 -0
- package/_cjs/typeclass/Guard/definition.cjs.map +1 -0
- package/_cjs/typeclass/Guard/derivations.cjs +85 -0
- package/_cjs/typeclass/Guard/derivations.cjs.map +1 -0
- package/_cjs/typeclass/Guard.cjs +32 -0
- package/_cjs/typeclass/Guard.cjs.map +1 -0
- package/_cjs/typeclass/HashEq.cjs +3 -3
- package/_cjs/typeclass/HashEq.cjs.map +1 -1
- package/_cjs/typeclass/Monad.cjs +0 -22
- package/_cjs/typeclass/Monad.cjs.map +1 -1
- package/_cjs/typeclass/MonadExcept.cjs +12 -19
- package/_cjs/typeclass/MonadExcept.cjs.map +1 -1
- package/_cjs/typeclass/Monoid.cjs +56 -2
- package/_cjs/typeclass/Monoid.cjs.map +1 -1
- package/_cjs/typeclass/Nil.cjs +10 -0
- package/_cjs/typeclass/Nil.cjs.map +1 -1
- package/_cjs/typeclass/Ord/api/contramap.cjs +2 -4
- package/_cjs/typeclass/Ord/api/contramap.cjs.map +1 -1
- package/_cjs/typeclass/Ord/api/max.cjs +1 -1
- package/_cjs/typeclass/Ord/api/max.cjs.map +1 -1
- package/_cjs/typeclass/Ord/api/min.cjs +1 -1
- package/_cjs/typeclass/Ord/api/min.cjs.map +1 -1
- package/_cjs/typeclass/Ord/definition.cjs +2 -3
- package/_cjs/typeclass/Ord/definition.cjs.map +1 -1
- package/_cjs/typeclass/Ord/instances.cjs +7 -7
- package/_cjs/typeclass/Ord/instances.cjs.map +1 -1
- package/_cjs/typeclass/Pointed.cjs +6 -11
- package/_cjs/typeclass/Pointed.cjs.map +1 -1
- package/_cjs/typeclass/Semialign.cjs +77 -94
- package/_cjs/typeclass/Semialign.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/api.cjs +2 -2
- package/_cjs/typeclass/Semigroup/api.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/definition.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/derivations.cjs +63 -0
- package/_cjs/typeclass/Semigroup/derivations.cjs.map +1 -0
- package/_cjs/typeclass/Semimonoidal.cjs +9 -13
- package/_cjs/typeclass/Semimonoidal.cjs.map +1 -1
- package/_cjs/typeclass/Showable/show.cjs +11 -11
- package/_cjs/typeclass/Showable/show.cjs.map +1 -1
- package/_cjs/typeclass/Traversable.cjs +26 -34
- package/_cjs/typeclass/Traversable.cjs.map +1 -1
- package/_cjs/typeclass/TraversableWithIndex.cjs +7 -38
- package/_cjs/typeclass/TraversableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Witherable.cjs +41 -42
- package/_cjs/typeclass/Witherable.cjs.map +1 -1
- package/_cjs/typeclass/WitherableWithIndex.cjs +41 -50
- package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass.cjs +13 -0
- package/_cjs/typeclass.cjs.map +1 -1
- package/_cjs/util/predicates.cjs +5 -0
- package/_cjs/util/predicates.cjs.map +1 -1
- package/_mjs/collection/Iterable/api/traverseConc.mjs +20 -15
- package/_mjs/collection/Iterable/api/traverseConc.mjs.map +1 -1
- package/_mjs/collection/Iterable/api.mjs +21 -31
- package/_mjs/collection/Iterable/api.mjs.map +1 -1
- package/_mjs/collection/compat/Array/api.mjs +1 -1
- package/_mjs/collection/compat/Array/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/api.mjs +35 -36
- package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/definition.mjs +48 -39
- package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Dictionary/definition.mjs +3 -2
- package/_mjs/collection/immutable/Dictionary/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/api.mjs +26 -66
- package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/definition.mjs +18 -15
- package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/HashSet/api.mjs +5 -5
- package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api.mjs +135 -177
- package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs +11 -10
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs +151 -138
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +108 -142
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs +2 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs +46 -67
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/List/api.mjs +4 -5
- package/_mjs/collection/immutable/List/api.mjs.map +1 -1
- package/_mjs/collection/immutable/RoseTree/api.mjs +447 -0
- package/_mjs/collection/immutable/RoseTree/api.mjs.map +1 -0
- package/_mjs/collection/immutable/RoseTree/definition.mjs +35 -0
- package/_mjs/collection/immutable/RoseTree/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/RoseTree.mjs +4 -0
- package/_mjs/collection/immutable/RoseTree.mjs.map +1 -0
- package/_mjs/collection/immutable/SortedMap/api.mjs +65 -65
- package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/api.mjs +59 -15
- package/_mjs/collection/immutable/Vector/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/definition.mjs +12 -11
- package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -1
- package/_mjs/collection/mutable/HashMap.mjs +5 -5
- package/_mjs/collection/mutable/HashMap.mjs.map +1 -1
- package/_mjs/collection/mutable/HashSet.mjs +4 -4
- package/_mjs/collection/mutable/HashSet.mjs.map +1 -1
- package/_mjs/control/Eval/api.mjs +5 -2
- package/_mjs/control/Eval/api.mjs.map +1 -1
- package/_mjs/control/Eval/definition.mjs +1 -0
- package/_mjs/control/Eval/definition.mjs.map +1 -1
- package/_mjs/control/Eval/instance.mjs +15 -18
- package/_mjs/control/Eval/instance.mjs.map +1 -1
- package/_mjs/control/Z/definition.mjs +2 -0
- package/_mjs/control/Z/definition.mjs.map +1 -1
- package/_mjs/control/Z/instances.mjs +7 -8
- package/_mjs/control/Z/instances.mjs.map +1 -1
- package/_mjs/data/Branded/definition.mjs +18 -0
- package/_mjs/data/Branded/definition.mjs.map +1 -0
- package/_mjs/data/Branded/derivations.mjs +39 -0
- package/_mjs/data/Branded/derivations.mjs.map +1 -0
- package/_mjs/data/Branded.mjs +4 -0
- package/_mjs/data/Branded.mjs.map +1 -0
- package/_mjs/data/Cause/api/fold.mjs +2 -0
- package/_mjs/data/Cause/api/fold.mjs.map +1 -1
- package/_mjs/data/Cause/api.mjs +20 -0
- package/_mjs/data/Cause/api.mjs.map +1 -1
- package/_mjs/data/Const/api.mjs +3 -3
- package/_mjs/data/Const/api.mjs.map +1 -1
- package/_mjs/data/Const/definition.mjs +13 -1
- package/_mjs/data/Const/definition.mjs.map +1 -1
- package/_mjs/data/Const/instances.mjs +7 -15
- package/_mjs/data/Const/instances.mjs.map +1 -1
- package/_mjs/data/DecodeError/definition.mjs +226 -0
- package/_mjs/data/DecodeError/definition.mjs.map +1 -0
- package/_mjs/data/DecodeError.mjs +3 -0
- package/_mjs/data/DecodeError.mjs.map +1 -0
- package/_mjs/data/Decoder/api.mjs +179 -0
- package/_mjs/data/Decoder/api.mjs.map +1 -0
- package/_mjs/data/Decoder/definition.mjs +24 -0
- package/_mjs/data/Decoder/definition.mjs.map +1 -0
- package/_mjs/data/Decoder.mjs +4 -0
- package/_mjs/data/Decoder.mjs.map +1 -0
- package/_mjs/data/Duration/api.mjs +17 -8
- package/_mjs/data/Duration/api.mjs.map +1 -1
- package/_mjs/data/Either/api/alignWith.mjs +2 -0
- package/_mjs/data/Either/api/alignWith.mjs.map +1 -1
- package/_mjs/data/Either/api.mjs +91 -21
- package/_mjs/data/Either/api.mjs.map +1 -1
- package/_mjs/data/Either/definition.mjs +25 -5
- package/_mjs/data/Either/definition.mjs.map +1 -1
- package/_mjs/data/Either/destructors.mjs +2 -0
- package/_mjs/data/Either/destructors.mjs.map +1 -1
- package/_mjs/data/Either/instances.mjs +109 -39
- package/_mjs/data/Either/instances.mjs.map +1 -1
- package/_mjs/data/Environment/api.mjs +23 -7
- package/_mjs/data/Environment/api.mjs.map +1 -1
- package/_mjs/data/Identity/api.mjs +24 -5
- package/_mjs/data/Identity/api.mjs.map +1 -1
- package/_mjs/data/Identity/definition.mjs +3 -1
- package/_mjs/data/Identity/definition.mjs.map +1 -1
- package/_mjs/data/Identity/instances.mjs +12 -18
- package/_mjs/data/Identity/instances.mjs.map +1 -1
- package/_mjs/data/Interval.mjs +114 -0
- package/_mjs/data/Interval.mjs.map +1 -0
- package/_mjs/data/Maybe/api.mjs +30 -35
- package/_mjs/data/Maybe/api.mjs.map +1 -1
- package/_mjs/data/Maybe/definition.mjs +37 -14
- package/_mjs/data/Maybe/definition.mjs.map +1 -1
- package/_mjs/data/Maybe/destructors.mjs +1 -0
- package/_mjs/data/Maybe/destructors.mjs.map +1 -1
- package/_mjs/data/Maybe/instances.mjs +56 -39
- package/_mjs/data/Maybe/instances.mjs.map +1 -1
- package/_mjs/data/Newtype.mjs +4 -3
- package/_mjs/data/Newtype.mjs.map +1 -1
- package/_mjs/data/Patch/api.mjs +1 -1
- package/_mjs/data/Patch/api.mjs.map +1 -1
- package/_mjs/data/Refinement/api.mjs +0 -4
- package/_mjs/data/Refinement/api.mjs.map +1 -1
- package/_mjs/data/Struct/definition.mjs +3 -2
- package/_mjs/data/Struct/definition.mjs.map +1 -1
- package/_mjs/data/These/api.mjs +262 -0
- package/_mjs/data/These/api.mjs.map +1 -0
- package/_mjs/data/These/constructors.mjs +14 -2
- package/_mjs/data/These/constructors.mjs.map +1 -1
- package/_mjs/data/These/definition.mjs +8 -0
- package/_mjs/data/These/definition.mjs.map +1 -1
- package/_mjs/data/These/destructors.mjs +53 -0
- package/_mjs/data/These/destructors.mjs.map +1 -1
- package/_mjs/data/These/instances.mjs +36 -0
- package/_mjs/data/These/instances.mjs.map +1 -0
- package/_mjs/data/These.mjs +1 -0
- package/_mjs/data/These.mjs.map +1 -1
- package/_mjs/data/bigint/definition.mjs +2 -0
- package/_mjs/data/bigint/definition.mjs.map +1 -0
- package/_mjs/data/bigint/instances.mjs +10 -0
- package/_mjs/data/bigint/instances.mjs.map +1 -0
- package/_mjs/data/bigint.mjs +4 -0
- package/_mjs/data/bigint.mjs.map +1 -0
- package/_mjs/data/boolean/definition.mjs +2 -0
- package/_mjs/data/boolean/definition.mjs.map +1 -0
- package/_mjs/data/boolean/instances.mjs +10 -0
- package/_mjs/data/boolean/instances.mjs.map +1 -0
- package/_mjs/data/boolean.mjs +4 -0
- package/_mjs/data/boolean.mjs.map +1 -0
- package/_mjs/data/number/instances.mjs +14 -4
- package/_mjs/data/number/instances.mjs.map +1 -1
- package/_mjs/data/object/instances.mjs +10 -0
- package/_mjs/data/object/instances.mjs.map +1 -0
- package/_mjs/data/string/instances.mjs +20 -8
- package/_mjs/data/string/instances.mjs.map +1 -1
- package/_mjs/internal/Stack.mjs +4 -0
- package/_mjs/internal/Stack.mjs.map +1 -1
- package/_mjs/json/EitherJson.mjs +18 -0
- package/_mjs/json/EitherJson.mjs.map +1 -0
- package/_mjs/json/MaybeJson.mjs +16 -0
- package/_mjs/json/MaybeJson.mjs.map +1 -0
- package/_mjs/json/TheseJson.mjs +22 -0
- package/_mjs/json/TheseJson.mjs.map +1 -0
- package/_mjs/optics/Optional/definition.mjs +5 -4
- package/_mjs/optics/Optional/definition.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/compose.mjs +1 -1
- package/_mjs/optics/Traversal/api/compose.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/fromTraversable.mjs +5 -4
- package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -1
- package/_mjs/optics/Traversal/definition.mjs +14 -12
- package/_mjs/optics/Traversal/definition.mjs.map +1 -1
- package/_mjs/typeclass/Align.mjs +0 -11
- package/_mjs/typeclass/Align.mjs.map +1 -1
- package/_mjs/typeclass/Alt.mjs +4 -7
- package/_mjs/typeclass/Alt.mjs.map +1 -1
- package/_mjs/typeclass/Alternative.mjs +0 -13
- package/_mjs/typeclass/Alternative.mjs.map +1 -1
- package/_mjs/typeclass/Applicative.mjs +0 -12
- package/_mjs/typeclass/Applicative.mjs.map +1 -1
- package/_mjs/typeclass/ApplicativeExcept.mjs +32 -24
- package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -1
- package/_mjs/typeclass/Apply.mjs +85 -42
- package/_mjs/typeclass/Apply.mjs.map +1 -1
- package/_mjs/typeclass/Chain.mjs +33 -12
- package/_mjs/typeclass/Chain.mjs.map +1 -1
- package/_mjs/typeclass/Closure.mjs +1 -4
- package/_mjs/typeclass/Closure.mjs.map +1 -1
- package/_mjs/typeclass/Eq/definition.mjs +9 -0
- package/_mjs/typeclass/Eq/definition.mjs.map +1 -0
- package/_mjs/typeclass/Eq/derivations.mjs +46 -0
- package/_mjs/typeclass/Eq/derivations.mjs.map +1 -0
- package/_mjs/typeclass/Eq.mjs +1 -11
- package/_mjs/typeclass/Eq.mjs.map +1 -1
- package/_mjs/typeclass/Fail.mjs +5 -7
- package/_mjs/typeclass/Fail.mjs.map +1 -1
- package/_mjs/typeclass/Filterable.mjs +27 -13
- package/_mjs/typeclass/Filterable.mjs.map +1 -1
- package/_mjs/typeclass/FilterableWithIndex.mjs +0 -16
- package/_mjs/typeclass/FilterableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Foldable.mjs +29 -12
- package/_mjs/typeclass/Foldable.mjs.map +1 -1
- package/_mjs/typeclass/FoldableWithIndex.mjs +29 -13
- package/_mjs/typeclass/FoldableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Functor.mjs +16 -9
- package/_mjs/typeclass/Functor.mjs.map +1 -1
- package/_mjs/typeclass/FunctorWithIndex.mjs +0 -12
- package/_mjs/typeclass/FunctorWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Guard/api.mjs +23 -0
- package/_mjs/typeclass/Guard/api.mjs.map +1 -0
- package/_mjs/typeclass/Guard/definition.mjs +23 -0
- package/_mjs/typeclass/Guard/definition.mjs.map +1 -0
- package/_mjs/typeclass/Guard/derivations.mjs +67 -0
- package/_mjs/typeclass/Guard/derivations.mjs.map +1 -0
- package/_mjs/typeclass/Guard.mjs +4 -0
- package/_mjs/typeclass/Guard.mjs.map +1 -0
- package/_mjs/typeclass/HashEq.mjs +3 -3
- package/_mjs/typeclass/HashEq.mjs.map +1 -1
- package/_mjs/typeclass/Monad.mjs +0 -12
- package/_mjs/typeclass/Monad.mjs.map +1 -1
- package/_mjs/typeclass/MonadExcept.mjs +9 -13
- package/_mjs/typeclass/MonadExcept.mjs.map +1 -1
- package/_mjs/typeclass/Monoid.mjs +50 -1
- package/_mjs/typeclass/Monoid.mjs.map +1 -1
- package/_mjs/typeclass/Nil.mjs +8 -1
- package/_mjs/typeclass/Nil.mjs.map +1 -1
- package/_mjs/typeclass/Ord/api/contramap.mjs +2 -4
- package/_mjs/typeclass/Ord/api/contramap.mjs.map +1 -1
- package/_mjs/typeclass/Ord/api/max.mjs +1 -1
- package/_mjs/typeclass/Ord/api/max.mjs.map +1 -1
- package/_mjs/typeclass/Ord/api/min.mjs +1 -1
- package/_mjs/typeclass/Ord/api/min.mjs.map +1 -1
- package/_mjs/typeclass/Ord/definition.mjs +2 -3
- package/_mjs/typeclass/Ord/definition.mjs.map +1 -1
- package/_mjs/typeclass/Ord/instances.mjs +7 -7
- package/_mjs/typeclass/Ord/instances.mjs.map +1 -1
- package/_mjs/typeclass/Pointed.mjs +5 -4
- package/_mjs/typeclass/Pointed.mjs.map +1 -1
- package/_mjs/typeclass/Semialign.mjs +67 -74
- package/_mjs/typeclass/Semialign.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/api.mjs +2 -2
- package/_mjs/typeclass/Semigroup/api.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/definition.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/derivations.mjs +50 -0
- package/_mjs/typeclass/Semigroup/derivations.mjs.map +1 -0
- package/_mjs/typeclass/Semigroup.mjs +1 -1
- package/_mjs/typeclass/Semimonoidal.mjs +8 -6
- package/_mjs/typeclass/Semimonoidal.mjs.map +1 -1
- package/_mjs/typeclass/Showable/show.mjs +11 -11
- package/_mjs/typeclass/Showable/show.mjs.map +1 -1
- package/_mjs/typeclass/Traversable.mjs +25 -24
- package/_mjs/typeclass/Traversable.mjs.map +1 -1
- package/_mjs/typeclass/TraversableWithIndex.mjs +6 -24
- package/_mjs/typeclass/TraversableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Witherable.mjs +39 -32
- package/_mjs/typeclass/Witherable.mjs.map +1 -1
- package/_mjs/typeclass/WitherableWithIndex.mjs +39 -37
- package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass.mjs +1 -0
- package/_mjs/typeclass.mjs.map +1 -1
- package/_mjs/util/predicates.mjs +3 -0
- package/_mjs/util/predicates.mjs.map +1 -1
- package/_src/collection/Iterable/api/traverseConc.ts +21 -29
- package/_src/collection/Iterable/api.ts +20 -34
- package/_src/collection/compat/Array/api.ts +1 -1
- package/_src/collection/immutable/Conc/api.ts +26 -46
- package/_src/collection/immutable/Conc/definition.ts +19 -8
- package/_src/collection/immutable/Dictionary/definition.ts +1 -1
- package/_src/collection/immutable/HashMap/api.ts +24 -81
- package/_src/collection/immutable/HashMap/definition.ts +7 -9
- package/_src/collection/immutable/HashMap/internal.ts +1 -1
- package/_src/collection/immutable/HashSet/api.ts +4 -4
- package/_src/collection/immutable/ImmutableArray/api.ts +180 -219
- package/_src/collection/immutable/ImmutableArray/definition.ts +6 -8
- package/_src/collection/immutable/ImmutableArray/instances.ts +156 -134
- package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +87 -158
- package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +4 -8
- package/_src/collection/immutable/ImmutableNonEmptyArray/instances.ts +39 -49
- package/_src/collection/immutable/List/api.ts +2 -6
- package/_src/collection/immutable/RoseTree/api.ts +278 -0
- package/_src/collection/immutable/RoseTree/definition.ts +29 -0
- package/_src/collection/immutable/RoseTree.ts +4 -0
- package/_src/collection/immutable/SortedMap/api.ts +56 -53
- package/_src/collection/immutable/Vector/api.ts +57 -17
- package/_src/collection/immutable/Vector/definition.ts +10 -0
- package/_src/collection/mutable/HashMap.ts +5 -5
- package/_src/collection/mutable/HashSet.ts +4 -4
- package/_src/control/Eval/api.ts +5 -1
- package/_src/control/Eval/definition.ts +5 -8
- package/_src/control/Eval/instance.ts +16 -15
- package/_src/control/Z/definition.ts +26 -19
- package/_src/control/Z/instances.ts +9 -8
- package/_src/data/Branded/definition.ts +47 -0
- package/_src/data/Branded/derivations.ts +57 -0
- package/_src/data/Branded.ts +4 -0
- package/_src/data/Cause/api/fold.ts +1 -0
- package/_src/data/Cause/api.ts +18 -0
- package/_src/data/Const/api.ts +3 -3
- package/_src/data/Const/definition.ts +22 -5
- package/_src/data/Const/instances.ts +12 -21
- package/_src/data/DecodeError/definition.ts +227 -0
- package/_src/data/DecodeError.ts +3 -0
- package/_src/data/Decoder/api.ts +198 -0
- package/_src/data/Decoder/definition.ts +25 -0
- package/_src/data/Decoder.ts +4 -0
- package/_src/data/Duration/api.ts +21 -14
- package/_src/data/Either/api/alignWith.ts +2 -0
- package/_src/data/Either/api.ts +85 -30
- package/_src/data/Either/definition.ts +41 -19
- package/_src/data/Either/destructors.ts +1 -0
- package/_src/data/Either/instances.ts +102 -51
- package/_src/data/Environment/api.ts +19 -4
- package/_src/data/Identity/api.ts +19 -4
- package/_src/data/Identity/definition.ts +7 -3
- package/_src/data/Identity/instances.ts +15 -8
- package/_src/data/Interval.ts +103 -0
- package/_src/data/Maybe/api.ts +21 -31
- package/_src/data/Maybe/definition.ts +31 -19
- package/_src/data/Maybe/destructors.ts +1 -0
- package/_src/data/Maybe/instances.ts +61 -34
- package/_src/data/Newtype.ts +11 -32
- package/_src/data/Patch/api.ts +1 -1
- package/_src/data/Refinement/api.ts +4 -2
- package/_src/data/Struct/definition.ts +1 -1
- package/_src/data/These/api.ts +184 -0
- package/_src/data/These/constructors.ts +10 -0
- package/_src/data/These/definition.ts +7 -0
- package/_src/data/These/destructors.ts +45 -0
- package/_src/data/These/instances.ts +43 -0
- package/_src/data/These.ts +1 -0
- package/_src/data/bigint/definition.ts +13 -0
- package/_src/data/bigint/instances.ts +8 -0
- package/_src/data/bigint.ts +4 -0
- package/_src/data/boolean/definition.ts +13 -0
- package/_src/data/boolean/instances.ts +8 -0
- package/_src/data/boolean.ts +4 -0
- package/_src/data/number/instances.ts +13 -3
- package/_src/data/object/instances.ts +7 -0
- package/_src/data/string/instances.ts +17 -5
- package/_src/internal/Stack.ts +4 -0
- package/_src/json/EitherJson.ts +28 -0
- package/_src/json/MaybeJson.ts +27 -0
- package/_src/json/TheseJson.ts +31 -0
- package/_src/optics/Optional/definition.ts +2 -2
- package/_src/optics/Traversal/api/compose.ts +1 -1
- package/_src/optics/Traversal/api/fromTraversable.ts +15 -41
- package/_src/optics/Traversal/definition.ts +21 -23
- package/_src/typeclass/Align.ts +4 -18
- package/_src/typeclass/Alt.ts +59 -90
- package/_src/typeclass/Alternative.ts +4 -20
- package/_src/typeclass/Applicative.ts +3 -23
- package/_src/typeclass/ApplicativeExcept.ts +94 -193
- package/_src/typeclass/Apply.ts +319 -509
- package/_src/typeclass/Chain.ts +127 -199
- package/_src/typeclass/Closure.ts +4 -20
- package/_src/typeclass/Eq/definition.ts +20 -0
- package/_src/typeclass/Eq/derivations.ts +61 -0
- package/_src/typeclass/Eq.ts +2 -36
- package/_src/typeclass/Fail.ts +28 -27
- package/_src/typeclass/Filterable.ts +70 -117
- package/_src/typeclass/FilterableWithIndex.ts +27 -131
- package/_src/typeclass/Foldable.ts +35 -52
- package/_src/typeclass/FoldableWithIndex.ts +40 -75
- package/_src/typeclass/Functor.ts +21 -59
- package/_src/typeclass/FunctorWithIndex.ts +6 -34
- package/_src/typeclass/Guard/api.ts +32 -0
- package/_src/typeclass/Guard/definition.ts +23 -0
- package/_src/typeclass/Guard/derivations.ts +80 -0
- package/_src/typeclass/Guard.ts +5 -0
- package/_src/typeclass/HashEq.ts +3 -4
- package/_src/typeclass/Monad.ts +3 -18
- package/_src/typeclass/MonadExcept.ts +9 -32
- package/_src/typeclass/Monoid.ts +60 -2
- package/_src/typeclass/Nil.ts +26 -17
- package/_src/typeclass/Ord/api/contramap.ts +2 -4
- package/_src/typeclass/Ord/api/max.ts +1 -1
- package/_src/typeclass/Ord/api/min.ts +1 -1
- package/_src/typeclass/Ord/definition.ts +3 -19
- package/_src/typeclass/Ord/instances.ts +6 -6
- package/_src/typeclass/Pointed.ts +29 -25
- package/_src/typeclass/Semialign.ts +308 -444
- package/_src/typeclass/Semigroup/api.ts +2 -2
- package/_src/typeclass/Semigroup/definition.ts +2 -6
- package/_src/typeclass/Semigroup/derivations.ts +64 -0
- package/_src/typeclass/Semigroup.ts +1 -1
- package/_src/typeclass/Semimonoidal.ts +55 -84
- package/_src/typeclass/Showable/show.ts +6 -8
- package/_src/typeclass/Traversable.ts +67 -157
- package/_src/typeclass/TraversableWithIndex.ts +37 -127
- package/_src/typeclass/Witherable.ts +120 -279
- package/_src/typeclass/WitherableWithIndex.ts +129 -337
- package/_src/typeclass.ts +2 -0
- package/_src/util/predicates.ts +4 -0
- package/collection/Iterable/api/traverseConc.d.ts +6 -4
- package/collection/Iterable/api.d.ts +5 -13
- package/collection/immutable/Conc/api.d.ts +15 -23
- package/collection/immutable/Conc/definition.d.ts +10 -7
- package/collection/immutable/Dictionary/definition.d.ts +1 -1
- package/collection/immutable/HashMap/api.d.ts +15 -27
- package/collection/immutable/HashMap/definition.d.ts +6 -9
- package/collection/immutable/HashMap/internal.d.ts +1 -1
- package/collection/immutable/ImmutableArray/api.d.ts +42 -94
- package/collection/immutable/ImmutableArray/definition.d.ts +6 -8
- package/collection/immutable/ImmutableArray/instances.d.ts +86 -17
- package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +26 -47
- package/collection/immutable/ImmutableNonEmptyArray/definition.d.ts +4 -8
- package/collection/immutable/ImmutableNonEmptyArray/instances.d.ts +1 -1
- package/collection/immutable/List/api.d.ts +1 -2
- package/collection/immutable/RoseTree/api.d.ts +63 -0
- package/collection/immutable/RoseTree/definition.d.ts +23 -0
- package/collection/immutable/RoseTree.d.ts +2 -0
- package/collection/immutable/SortedMap/api.d.ts +2 -1
- package/collection/immutable/Vector/api.d.ts +31 -8
- package/collection/immutable/Vector/definition.d.ts +10 -0
- package/control/Eval/api.d.ts +1 -0
- package/control/Eval/definition.d.ts +5 -8
- package/control/Eval/instance.d.ts +4 -1
- package/control/Z/definition.d.ts +23 -18
- package/control/Z/instances.d.ts +4 -3
- package/data/Branded/definition.d.ts +36 -0
- package/data/Branded/derivations.d.ts +24 -0
- package/data/Branded.d.ts +2 -0
- package/data/Cause/api.d.ts +7 -1
- package/data/Const/api.d.ts +1 -1
- package/data/Const/definition.d.ts +23 -7
- package/data/Const/instances.d.ts +4 -12
- package/data/DecodeError/definition.d.ts +141 -0
- package/data/DecodeError.d.ts +1 -0
- package/data/Decoder/api.d.ts +65 -0
- package/data/Decoder/definition.d.ts +24 -0
- package/data/Decoder.d.ts +2 -0
- package/data/Duration/api.d.ts +12 -8
- package/data/Either/api.d.ts +29 -17
- package/data/Either/definition.d.ts +31 -14
- package/data/Either/instances.d.ts +26 -11
- package/data/Environment/api.d.ts +5 -0
- package/data/Identity/api.d.ts +11 -0
- package/data/Identity/definition.d.ts +7 -2
- package/data/Identity/instances.d.ts +5 -9
- package/data/Interval.d.ts +71 -0
- package/data/Maybe/api.d.ts +3 -17
- package/data/Maybe/definition.d.ts +20 -14
- package/data/Maybe/instances.d.ts +14 -8
- package/data/Newtype.d.ts +8 -9
- package/data/Refinement/api.d.ts +2 -0
- package/data/Struct/definition.d.ts +1 -1
- package/data/These/api.d.ts +73 -0
- package/data/These/constructors.d.ts +7 -1
- package/data/These/definition.d.ts +5 -0
- package/data/These/destructors.d.ts +27 -1
- package/data/These/instances.d.ts +13 -0
- package/data/These.d.ts +1 -0
- package/data/bigint/definition.d.ts +13 -0
- package/data/bigint/instances.d.ts +7 -0
- package/data/bigint.d.ts +2 -0
- package/data/boolean/definition.d.ts +13 -0
- package/data/boolean/instances.d.ts +7 -0
- package/data/boolean.d.ts +2 -0
- package/data/number/instances.d.ts +8 -0
- package/data/object/instances.d.ts +7 -0
- package/data/string/instances.d.ts +10 -0
- package/internal/Stack.d.ts +1 -0
- package/json/EitherJson.d.ts +24 -0
- package/json/MaybeJson.d.ts +23 -0
- package/json/TheseJson.d.ts +26 -0
- package/optics/Traversal/api/fromTraversable.d.ts +1 -1
- package/optics/Traversal/definition.d.ts +4 -9
- package/package.json +2 -2
- package/typeclass/Align.d.ts +3 -10
- package/typeclass/Alt.d.ts +6 -19
- package/typeclass/Alternative.d.ts +4 -12
- package/typeclass/Applicative.d.ts +3 -12
- package/typeclass/ApplicativeExcept.d.ts +14 -39
- package/typeclass/Apply.d.ts +41 -72
- package/typeclass/Chain.d.ts +18 -28
- package/typeclass/Closure.d.ts +2 -12
- package/typeclass/Eq/definition.d.ts +17 -0
- package/typeclass/Eq/derivations.d.ts +24 -0
- package/typeclass/Eq.d.ts +2 -27
- package/typeclass/Fail.d.ts +4 -10
- package/typeclass/Filterable.d.ts +30 -51
- package/typeclass/FilterableWithIndex.d.ts +10 -53
- package/typeclass/Foldable.d.ts +19 -31
- package/typeclass/FoldableWithIndex.d.ts +20 -33
- package/typeclass/Functor.d.ts +11 -22
- package/typeclass/FunctorWithIndex.d.ts +3 -19
- package/typeclass/Guard/api.d.ts +20 -0
- package/typeclass/Guard/definition.d.ts +22 -0
- package/typeclass/Guard/derivations.d.ts +36 -0
- package/typeclass/Guard.d.ts +2 -0
- package/typeclass/HashEq.d.ts +1 -2
- package/typeclass/Monad.d.ts +3 -11
- package/typeclass/MonadExcept.d.ts +6 -17
- package/typeclass/Monoid.d.ts +24 -2
- package/typeclass/Nil.d.ts +7 -8
- package/typeclass/Ord/definition.d.ts +2 -14
- package/typeclass/Pointed.d.ts +4 -10
- package/typeclass/Semialign.d.ts +51 -63
- package/typeclass/Semigroup/definition.d.ts +3 -5
- package/typeclass/Semigroup/derivations.d.ts +25 -0
- package/typeclass/Semimonoidal.d.ts +5 -14
- package/typeclass/Traversable.d.ts +17 -57
- package/typeclass/TraversableWithIndex.d.ts +9 -52
- package/typeclass/Witherable.d.ts +22 -82
- package/typeclass/WitherableWithIndex.d.ts +26 -98
- package/typeclass.d.ts +1 -0
- package/util/predicates.d.ts +1 -0
@@ -314,43 +314,27 @@ export function foldLeft_<A, B>(self: Iterable<A>, b: B, f: (b: B, a: A) => B):
|
|
314
314
|
}
|
315
315
|
|
316
316
|
/**
|
317
|
-
* @
|
317
|
+
* @tsplus fluent fncts.Iterable foldMap
|
318
318
|
*/
|
319
|
-
export function foldMap_<M>(M: P.Monoid<M>) {
|
320
|
-
return
|
319
|
+
export function foldMap_<A, M>(self: Iterable<A>, f: (a: A) => M, /** @tsplus auto */ M: P.Monoid<M>): M {
|
320
|
+
return self.foldMapWithIndex((_, a) => f(a), M);
|
321
321
|
}
|
322
322
|
|
323
323
|
/**
|
324
|
-
* @tsplus
|
324
|
+
* @tsplus fluent fncts.Iterable foldMapWithIndex
|
325
325
|
*/
|
326
|
-
export function
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
let n = -1;
|
339
|
-
for (const value of self) {
|
340
|
-
n += 1;
|
341
|
-
res = M.combine_(res, f(n, value));
|
342
|
-
}
|
343
|
-
return res;
|
344
|
-
};
|
345
|
-
}
|
346
|
-
|
347
|
-
/**
|
348
|
-
* @tsplus getter fncts.Iterable foldMapWithIndex
|
349
|
-
*/
|
350
|
-
export function foldMapWithIndexSelf<A>(self: Iterable<A>) {
|
351
|
-
return <M>(M: P.Monoid<M>) =>
|
352
|
-
(f: (i: number, a: A) => M): M =>
|
353
|
-
foldMapWithIndex_(M)(self, f);
|
326
|
+
export function foldMapWithIndex_<A, M>(
|
327
|
+
self: Iterable<A>,
|
328
|
+
f: (i: number, a: A) => M,
|
329
|
+
/** @tsplus auto */ M: P.Monoid<M>,
|
330
|
+
): M {
|
331
|
+
let res = M.nat;
|
332
|
+
let n = -1;
|
333
|
+
for (const value of self) {
|
334
|
+
n += 1;
|
335
|
+
res = M.combine(res, f(n, value));
|
336
|
+
}
|
337
|
+
return res;
|
354
338
|
}
|
355
339
|
|
356
340
|
/**
|
@@ -430,6 +414,7 @@ function handlePartitionMap<A, B, C>(
|
|
430
414
|
h: "Left" | "Right",
|
431
415
|
): PartitionHandleResult<B | C> {
|
432
416
|
const bc = f(i, a);
|
417
|
+
Either.concrete(bc);
|
433
418
|
return h === "Left" && bc._tag === "Left"
|
434
419
|
? { emit: true, value: bc.left }
|
435
420
|
: h === "Right" && bc._tag === "Right"
|
@@ -592,15 +577,16 @@ export function size<A>(self: Iterable<A>): number {
|
|
592
577
|
export function take<A>(self: Iterable<A>, n: number): Iterable<A> {
|
593
578
|
return Iterable.make<A>(() => {
|
594
579
|
let done = false;
|
595
|
-
|
580
|
+
let i = 0;
|
596
581
|
let value: IteratorResult<A>;
|
597
582
|
const iterator = self[Symbol.iterator]();
|
598
583
|
return {
|
599
584
|
next() {
|
600
|
-
if (done || i
|
585
|
+
if (done || i >= n) {
|
601
586
|
return this.return!();
|
602
587
|
}
|
603
588
|
value = iterator.next();
|
589
|
+
i++;
|
604
590
|
if (value.done) {
|
605
591
|
this.return!();
|
606
592
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { Concat, ConcF } from "@fncts/base/collection/immutable/Conc/definition";
|
2
2
|
import type { Eq } from "@fncts/base/typeclass";
|
3
|
+
import type * as P from "@fncts/base/typeclass";
|
3
4
|
|
4
5
|
import {
|
5
6
|
_Empty,
|
@@ -13,7 +14,6 @@ import {
|
|
13
14
|
import { EitherTag } from "@fncts/base/data/Either";
|
14
15
|
import { identity, tuple } from "@fncts/base/data/function";
|
15
16
|
import { Stack } from "@fncts/base/internal/Stack";
|
16
|
-
import * as P from "@fncts/base/typeclass";
|
17
17
|
|
18
18
|
/**
|
19
19
|
* @tsplus fluent fncts.Conc align
|
@@ -103,6 +103,7 @@ export function chainRecDepthFirst<A, B>(a: A, f: (a: A) => Conc<Either<A, B>>):
|
|
103
103
|
while (buffer.length > 0) {
|
104
104
|
const e = buffer.unsafeHead;
|
105
105
|
buffer = buffer.unsafeTail;
|
106
|
+
Either.concrete(e);
|
106
107
|
if (e._tag === EitherTag.Left) {
|
107
108
|
buffer = f(e.left).concat(buffer);
|
108
109
|
} else {
|
@@ -122,6 +123,7 @@ export function chainRecBreadthFirst<A, B>(a: A, f: (a: A) => Conc<Either<A, B>>
|
|
122
123
|
let out = Conc.empty<B>();
|
123
124
|
|
124
125
|
function go(e: Either<A, B>): void {
|
126
|
+
Either.concrete(e);
|
125
127
|
if (e._tag === EitherTag.Left) {
|
126
128
|
f(e.left).forEach((ab) => ((buffer = buffer.append(ab)), undefined));
|
127
129
|
} else {
|
@@ -211,12 +213,10 @@ export function concat_<A, B>(self: Conc<A>, that: Conc<B>): Conc<A | B> {
|
|
211
213
|
}
|
212
214
|
|
213
215
|
/**
|
214
|
-
* @tsplus
|
216
|
+
* @tsplus fluent fncts.Conc elem
|
215
217
|
*/
|
216
|
-
export function elem_<A>(self: Conc<A>) {
|
217
|
-
return (E
|
218
|
-
(a: A): boolean =>
|
219
|
-
self.exists((el) => E.equals_(el, a));
|
218
|
+
export function elem_<A>(self: Conc<A>, a: A, /** @tsplus auto */ E: Eq<A>): boolean {
|
219
|
+
return self.exists((el) => E.equals(el, a));
|
220
220
|
}
|
221
221
|
|
222
222
|
/**
|
@@ -458,36 +458,17 @@ export function foldLeftWithIndex_<A, B>(self: Conc<A>, b: B, f: (i: number, b:
|
|
458
458
|
}
|
459
459
|
|
460
460
|
/**
|
461
|
-
* @
|
461
|
+
* @tsplus fluent fncts.Conc foldMap
|
462
462
|
*/
|
463
|
-
export function foldMap_<M>(M: P.Monoid<M>) {
|
464
|
-
return
|
463
|
+
export function foldMap_<A, M>(fa: Conc<A>, f: (a: A) => M, /** @tsplus auto */ M: P.Monoid<M>): M {
|
464
|
+
return fa.foldMapWithIndex((_, a) => f(a), M);
|
465
465
|
}
|
466
466
|
|
467
467
|
/**
|
468
|
-
* @tsplus
|
468
|
+
* @tsplus fluent fncts.Conc foldMapWithIndex
|
469
469
|
*/
|
470
|
-
export function
|
471
|
-
|
472
|
-
(f: (a: A) => M): M =>
|
473
|
-
self.foldMapWithIndex(M)((_, a) => f(a));
|
474
|
-
}
|
475
|
-
|
476
|
-
/**
|
477
|
-
* @constrained
|
478
|
-
*/
|
479
|
-
export function foldMapWithIndex_<M>(M: P.Monoid<M>) {
|
480
|
-
return <A>(fa: Conc<A>, f: (i: number, a: A) => M): M =>
|
481
|
-
fa.foldLeftWithIndex(M.nat, (i, b, a) => M.combine_(b, f(i, a)));
|
482
|
-
}
|
483
|
-
|
484
|
-
/**
|
485
|
-
* @tsplus getter fncts.Conc foldMapWithIndex
|
486
|
-
*/
|
487
|
-
export function foldMapWithIndexSelf<A>(self: Conc<A>) {
|
488
|
-
return <M>(M: P.Monoid<M>) =>
|
489
|
-
(f: (i: number, a: A) => M): M =>
|
490
|
-
foldMapWithIndex_(M)(self, f);
|
470
|
+
export function foldMapWithIndex_<A, M>(fa: Conc<A>, f: (i: number, a: A) => M, /** @tsplus auto */ M: P.Monoid<M>): M {
|
471
|
+
return fa.foldLeftWithIndex(M.nat, (i, b, a) => M.combine(b, f(i, a)));
|
491
472
|
}
|
492
473
|
|
493
474
|
/**
|
@@ -593,7 +574,7 @@ export function map_<A, B>(self: Conc<A>, f: (a: A) => B): Conc<B> {
|
|
593
574
|
*
|
594
575
|
* @tsplus fluent fncts.Conc mapAccum
|
595
576
|
*/
|
596
|
-
export function mapAccum_<A, S, B>(self: Conc<A>, s: S, f: (s: S, a: A) => readonly [
|
577
|
+
export function mapAccum_<A, S, B>(self: Conc<A>, s: S, f: (s: S, a: A) => readonly [S, B]): readonly [S, Conc<B>] {
|
597
578
|
concrete(self);
|
598
579
|
const iterator = self.arrayIterator();
|
599
580
|
const out = builder<B>();
|
@@ -605,11 +586,11 @@ export function mapAccum_<A, S, B>(self: Conc<A>, s: S, f: (s: S, a: A) => reado
|
|
605
586
|
for (let i = 0; i < length; i++) {
|
606
587
|
const a = array[i]!;
|
607
588
|
const tup = f(state, a);
|
608
|
-
out.append(tup[
|
609
|
-
state = tup[
|
589
|
+
out.append(tup[1]);
|
590
|
+
state = tup[0];
|
610
591
|
}
|
611
592
|
}
|
612
|
-
return tuple(out.result()
|
593
|
+
return tuple(s, out.result());
|
613
594
|
}
|
614
595
|
|
615
596
|
function mapArrayLike<A, B>(as: ArrayLike<A>, len: number, startIndex: number, f: (i: number, a: A) => B): Conc<B> {
|
@@ -980,22 +961,21 @@ export function takeWhile_<A>(self: Conc<A>, p: Predicate<A>): Conc<A> {
|
|
980
961
|
}
|
981
962
|
}
|
982
963
|
|
983
|
-
export const traverse_: P.traverse_<ConcF> = (A) => (ta, f) => traverseWithIndex_(A)(ta, (_, a) => f(a));
|
984
|
-
|
985
964
|
/**
|
986
|
-
* @tsplus
|
965
|
+
* @tsplus fluent fncts.Conc traverse
|
987
966
|
*/
|
988
|
-
export const
|
989
|
-
|
990
|
-
export const traverseWithIndex_: P.traverseWithIndex_<ConcF> = P.mkTraverseWithIndex_<ConcF>()(
|
991
|
-
(_) => (A) => (ta, f) =>
|
992
|
-
ta.foldLeftWithIndex(A.pure(Conc.empty()), (i, fbs, a) => A.zipWith_(fbs, f(i, a), (bs, b) => bs.append(b))),
|
993
|
-
);
|
967
|
+
export const traverse: P.Traversable<ConcF>["traverse"] = (self, f, G) => self.traverseWithIndex((_, a) => f(a), G);
|
994
968
|
|
995
969
|
/**
|
996
|
-
* @tsplus
|
970
|
+
* @tsplus fluent fncts.Conc traverseWithIndex
|
997
971
|
*/
|
998
|
-
export
|
972
|
+
export function traverseWithIndex<G extends HKT, KG, QG, WG, XG, IG, SG, RG, EG, A, B>(
|
973
|
+
self: Conc<A>,
|
974
|
+
f: (i: number, a: A) => HKT.Kind<G, KG, QG, WG, XG, IG, SG, RG, EG, B>,
|
975
|
+
/** @tsplus auto */ G: P.Applicative<G>,
|
976
|
+
): HKT.Kind<G, KG, QG, WG, XG, IG, SG, RG, EG, Conc<B>> {
|
977
|
+
return self.foldLeftWithIndex(G.pure(Conc.empty()), (i, fbs, a) => fbs.zipWith(f(i, a), (bs, b) => bs.append(b), G));
|
978
|
+
}
|
999
979
|
|
1000
980
|
/**
|
1001
981
|
* @tsplus fluent fncts.ConcOps unfold
|
@@ -1,10 +1,5 @@
|
|
1
1
|
import { Iterable } from "../../Iterable/definition.js";
|
2
2
|
|
3
|
-
export interface ConcF extends HKT {
|
4
|
-
readonly type: Conc<this["A"]>;
|
5
|
-
readonly index: number;
|
6
|
-
}
|
7
|
-
|
8
3
|
export const BUFFER_SIZE = 64;
|
9
4
|
|
10
5
|
export const UPDATE_BUFFER_SIZE = 256;
|
@@ -24,13 +19,19 @@ export const enum ConcTag {
|
|
24
19
|
ByteChunk = "ByteChunk",
|
25
20
|
}
|
26
21
|
|
22
|
+
export interface ConcF extends Conc<any> {}
|
23
|
+
|
27
24
|
/**
|
28
25
|
* @tsplus type fncts.Conc
|
29
26
|
* @tsplus companion fncts.ConcOps
|
30
27
|
*/
|
31
28
|
export abstract class Conc<A> implements Iterable<A>, Hashable, Equatable {
|
29
|
+
[HKT.F]?: ConcF;
|
30
|
+
[HKT.A]?: () => A;
|
31
|
+
[HKT.T]?: Conc<HKT._A<this>>;
|
32
|
+
[HKT.Ix]?: number;
|
33
|
+
|
32
34
|
readonly _typeId: ConcTypeId = ConcTypeId;
|
33
|
-
readonly _A!: () => A;
|
34
35
|
abstract readonly length: number;
|
35
36
|
abstract [Symbol.iterator](): Iterator<A>;
|
36
37
|
|
@@ -43,7 +44,17 @@ export abstract class Conc<A> implements Iterable<A>, Hashable, Equatable {
|
|
43
44
|
}
|
44
45
|
}
|
45
46
|
|
46
|
-
abstract class ConcImplementation<A>
|
47
|
+
abstract class ConcImplementation<A> implements Iterable<A> {
|
48
|
+
|
49
|
+
readonly _typeId: ConcTypeId = ConcTypeId;
|
50
|
+
get [Symbol.hash](): number {
|
51
|
+
return Hashable.iterator(this[Symbol.iterator]());
|
52
|
+
}
|
53
|
+
|
54
|
+
[Symbol.equals](that: unknown): boolean {
|
55
|
+
return Conc.isConc(that) && (this as Conc<A>).corresponds(that, Equatable.strictEquals);
|
56
|
+
}
|
57
|
+
|
47
58
|
abstract readonly length: number;
|
48
59
|
abstract readonly binary: boolean;
|
49
60
|
abstract get(n: number): A;
|
@@ -309,7 +320,7 @@ class AppendN<A> extends ConcImplementation<A> {
|
|
309
320
|
}
|
310
321
|
|
311
322
|
[Symbol.iterator](): Iterator<A> {
|
312
|
-
return this.start.asIterable.concat(this.buffer
|
323
|
+
return this.start.asIterable.concat(this.buffer.asIterable.take(this.bufferUsed))[Symbol.iterator]() as Iterator<A>;
|
313
324
|
}
|
314
325
|
|
315
326
|
append<A1>(a: A1): ConcImplementation<A | A1> {
|
@@ -55,12 +55,12 @@ export function makeDefault<K, V>(): HashMap<K, V> {
|
|
55
55
|
*
|
56
56
|
* @tsplus fluent fncts.HashMapOps fromFoldable
|
57
57
|
*/
|
58
|
-
export function fromFoldable<F extends HKT, C, K, A>(config: P.HashEq<K>, S: P.Semigroup<A>, F: P.Foldable<F
|
59
|
-
return <K_, Q, W, X, I, S, R, E>(fka: HKT.Kind<F,
|
60
|
-
return F.
|
58
|
+
export function fromFoldable<F extends HKT, C, K, A>(config: P.HashEq<K>, S: P.Semigroup<A>, F: P.Foldable<F>) {
|
59
|
+
return <K_, Q, W, X, I, S, R, E>(fka: HKT.Kind<F, K_, Q, W, X, I, S, R, E, readonly [K, A]>): HashMap<K, A> => {
|
60
|
+
return F.foldLeft(fka, makeWith(config), (b, [k, a]) => {
|
61
61
|
const oa = b.get(k);
|
62
62
|
if (oa.isJust()) {
|
63
|
-
return b.set(k, S.
|
63
|
+
return b.set(k, S.combine(oa.value, a));
|
64
64
|
} else {
|
65
65
|
return b.set(k, a);
|
66
66
|
}
|
@@ -117,7 +117,7 @@ export function has_<K, V>(map: HashMap<K, V>, key: K): boolean {
|
|
117
117
|
*/
|
118
118
|
export function modifyHash_<K, V>(map: HashMap<K, V>, key: K, hash: number, f: UpdateFn<V>): HashMap<K, V> {
|
119
119
|
const size = { value: map.size };
|
120
|
-
const newRoot = map.root.modify(map.editable ? map.edit : NaN, map.config.
|
120
|
+
const newRoot = map.root.modify(map.editable ? map.edit : NaN, map.config.equals, 0, f, hash, key, size);
|
121
121
|
return setTree(map, newRoot, size.value);
|
122
122
|
}
|
123
123
|
|
@@ -528,31 +528,16 @@ export function foldLeft_<K, V, Z>(map: HashMap<K, V>, z: Z, f: (z: Z, v: V) =>
|
|
528
528
|
return map.foldLeftWithIndex(z, (_, b, a) => f(b, a));
|
529
529
|
}
|
530
530
|
|
531
|
-
export const traverseWithIndex_: P.traverseWithIndex_<HashMapF> = P.mkTraverseWithIndex_<HashMapF>()(
|
532
|
-
() => (A) => (ta, f) =>
|
533
|
-
foldLeftWithIndex_(ta, A.pure(makeWith(ta.config)), (k, b, a) => A.zipWith_(b, f(k, a), (map, b) => map.set(k, b))),
|
534
|
-
);
|
535
|
-
|
536
|
-
export const traverseWithIndex: P.traverseWithIndex<HashMapF> = (A) => {
|
537
|
-
const traverseWithIndexA_ = traverseWithIndex_(A);
|
538
|
-
return (f) => (ta) => traverseWithIndexA_(ta, f);
|
539
|
-
};
|
540
|
-
|
541
531
|
/**
|
542
|
-
* @tsplus
|
532
|
+
* @tsplus fluent fncts.HashMap traverseWithIndex
|
543
533
|
*/
|
544
|
-
export const
|
545
|
-
|
534
|
+
export const traverseWithIndex_: P.TraversableWithIndex<HashMapF>["traverseWithIndex"] = (ta, f, G) =>
|
535
|
+
ta.foldLeftWithIndex(G.pure(makeWith(ta.config)), (k, b, a) => b.zipWith(f(k, a), (map, b) => map.set(k, b), G));
|
546
536
|
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
export const traverse: P.traverse<HashMapF> = (A) => {
|
553
|
-
const traverseWithIndexA_ = traverseWithIndex_(A);
|
554
|
-
return (f) => (ta) => traverseWithIndexA_(ta, (_, a) => f(a));
|
555
|
-
};
|
537
|
+
/**
|
538
|
+
* @tsplus fluent fncts.HashMap traverse
|
539
|
+
*/
|
540
|
+
export const traverse_: P.Traversable<HashMapF>["traverse"] = (ta, f, G) => ta.traverseWithIndex((_, a) => f(a), G);
|
556
541
|
|
557
542
|
/**
|
558
543
|
* @tsplus fluent fncts.HashMap unsafeGet
|
@@ -562,69 +547,27 @@ export function unsafeGet_<K, V>(self: HashMap<K, V>, key: K): V | undefined {
|
|
562
547
|
}
|
563
548
|
|
564
549
|
/**
|
565
|
-
* @tsplus
|
566
|
-
*/
|
567
|
-
export const traverseSelf: P.traverseSelf<HashMapF> = (self) => (A) => (f) =>
|
568
|
-
traverseWithIndex_(A)(self, (_, a) => f(a));
|
569
|
-
|
570
|
-
export const witherWithIndex_: P.witherWithIndex_<HashMapF> = (A) => (wa, f) =>
|
571
|
-
A.map_(wa.traverseWithIndex(A)(f), compact);
|
572
|
-
|
573
|
-
export const witherWithIndex: P.witherWithIndex<HashMapF> = (A) => {
|
574
|
-
const witherWithIndexA_ = witherWithIndex_(A);
|
575
|
-
return (f) => (ta) => witherWithIndexA_(ta, f);
|
576
|
-
};
|
577
|
-
|
578
|
-
/**
|
579
|
-
* @tsplus getter fncts.HashMap witherWithIndex
|
550
|
+
* @tsplus fluent fncts.HashMap witherWithIndex
|
580
551
|
*/
|
581
|
-
export const
|
582
|
-
|
583
|
-
|
584
|
-
export const wither_: P.wither_<HashMapF> = (A) => {
|
585
|
-
const witherWithIndexA_ = witherWithIndex_(A);
|
586
|
-
return (wa, f) => witherWithIndexA_(wa, (_, a) => f(a));
|
587
|
-
};
|
588
|
-
|
589
|
-
export const wither: P.wither<HashMapF> = (A) => {
|
590
|
-
const witherWithIndexA_ = witherWithIndex_(A);
|
591
|
-
return (f) => (wa) => witherWithIndexA_(wa, (_, a) => f(a));
|
592
|
-
};
|
552
|
+
export const witherWithIndex_: P.WitherableWithIndex<HashMapF>["witherWithIndex"] = (wa, f, G) =>
|
553
|
+
wa.traverseWithIndex(f, G).map(compact, G);
|
593
554
|
|
594
555
|
/**
|
595
|
-
* @tsplus
|
556
|
+
* @tsplus fluent fncts.HashMap wither
|
596
557
|
*/
|
597
|
-
export const
|
598
|
-
|
599
|
-
export const wiltWithIndex_: P.wiltWithIndex_<HashMapF> = (A) => {
|
600
|
-
const traverseWithIndexA_ = traverseWithIndex_(A);
|
601
|
-
return (wa, f) => traverseWithIndexA_(wa, f).via(A.map(separate));
|
602
|
-
};
|
603
|
-
|
604
|
-
export const wiltWithIndex: P.wiltWithIndex<HashMapF> = (A) => {
|
605
|
-
const wiltWithIndexA_ = wiltWithIndex_(A);
|
606
|
-
return (f) => (wa) => wiltWithIndexA_(wa, f);
|
607
|
-
};
|
558
|
+
export const wither_: P.Witherable<HashMapF>["wither"] = (wa, f, G) => wa.witherWithIndex((_, a) => f(a), G);
|
608
559
|
|
609
560
|
/**
|
610
|
-
* @tsplus
|
561
|
+
* @tsplus fluent fncts.HashMap wiltWithIndex
|
611
562
|
*/
|
612
|
-
export const
|
613
|
-
|
614
|
-
export const wilt_: P.wilt_<HashMapF> = (A) => {
|
615
|
-
const wiltWithIndexA_ = wiltWithIndex_(A);
|
616
|
-
return (wa, f) => wiltWithIndexA_(wa, (_, a) => f(a));
|
617
|
-
};
|
618
|
-
|
619
|
-
export const wilt: P.wilt<HashMapF> = (A) => {
|
620
|
-
const wiltWithIndexA_ = wiltWithIndex_(A);
|
621
|
-
return (f) => (wa) => wiltWithIndexA_(wa, (_, a) => f(a));
|
622
|
-
};
|
563
|
+
export const wiltWithIndex_: P.WitherableWithIndex<HashMapF>["wiltWithIndex"] = (wa, f, G) =>
|
564
|
+
wa.traverseWithIndex(f, G).map(separate, G);
|
623
565
|
|
624
566
|
/**
|
625
|
-
* @tsplus
|
567
|
+
* @tsplus fluent fncts.HashMap wilt
|
626
568
|
*/
|
627
|
-
export const
|
569
|
+
export const wilt_: P.Witherable<HashMapF>["wilt"] = (wa, f, G) =>
|
570
|
+
wa.wiltWithIndex((_, a) => f(a), G);
|
628
571
|
|
629
572
|
/**
|
630
573
|
* @tsplus fluent fncts.HashMap unionWith
|
@@ -688,7 +631,7 @@ function setTree<K, V>(map: HashMap<K, V>, newRoot: Node<K, V>, newSize: number)
|
|
688
631
|
function tryGetHash<K, V>(map: HashMap<K, V>, key: K, hash: number): Maybe<V> {
|
689
632
|
let node = map.root;
|
690
633
|
let shift = 0;
|
691
|
-
const keyEq = map.config.
|
634
|
+
const keyEq = map.config.equals;
|
692
635
|
|
693
636
|
// eslint-disable-next-line no-constant-condition
|
694
637
|
while (true) {
|
@@ -4,21 +4,18 @@ import type { HashEq } from "@fncts/base/typeclass";
|
|
4
4
|
import { isEmptyNode } from "@fncts/base/collection/immutable/HashMap/internal";
|
5
5
|
import { identity, tuple } from "@fncts/base/data/function";
|
6
6
|
|
7
|
-
export interface HashMapF extends
|
8
|
-
readonly type: HashMap<this["K"], this["A"]>;
|
9
|
-
readonly variance: {
|
10
|
-
K: "_";
|
11
|
-
A: "+";
|
12
|
-
};
|
13
|
-
}
|
7
|
+
export interface HashMapF extends HashMap<any, any> {}
|
14
8
|
|
15
9
|
/**
|
16
10
|
* @tsplus type fncts.HashMap
|
17
11
|
* @tsplus companion fncts.HashMapOps
|
18
12
|
*/
|
19
13
|
export class HashMap<K, V> implements Iterable<readonly [K, V]>, Hashable, Equatable {
|
20
|
-
readonly
|
21
|
-
readonly
|
14
|
+
readonly [HKT.F]!: HashMapF;
|
15
|
+
readonly [HKT.K]!: () => K;
|
16
|
+
readonly [HKT.A]!: () => V;
|
17
|
+
readonly [HKT.T]!: HashMap<HKT._K<this>, HKT._A<this>>;
|
18
|
+
readonly [HKT.Ix]!: K;
|
22
19
|
|
23
20
|
constructor(
|
24
21
|
public editable: boolean,
|
@@ -55,6 +52,7 @@ export class HashMapIterator<K, V, T> implements IterableIterator<T> {
|
|
55
52
|
}
|
56
53
|
|
57
54
|
next(): IteratorResult<T> {
|
55
|
+
this.v.concrete();
|
58
56
|
if (this.v.isNothing()) {
|
59
57
|
return { done: true, value: undefined };
|
60
58
|
}
|
@@ -133,7 +133,7 @@ export function canEditNode<K, V>(edit: number, node: Node<K, V>): boolean {
|
|
133
133
|
return isEmptyNode(node) ? false : edit === node.edit;
|
134
134
|
}
|
135
135
|
|
136
|
-
export type KeyEq<K> = Eq<K>["
|
136
|
+
export type KeyEq<K> = Eq<K>["equals"];
|
137
137
|
|
138
138
|
export type UpdateFn<V> = (v: Maybe<V>) => Maybe<V>;
|
139
139
|
|
@@ -169,7 +169,7 @@ export function flatMapDefault<A, B>(self: HashSet<A>, f: (a: A) => Iterable<B>)
|
|
169
169
|
*/
|
170
170
|
export function getEq<A>(): P.Eq<HashSet<A>> {
|
171
171
|
return P.Eq({
|
172
|
-
|
172
|
+
equals: (x, y) => {
|
173
173
|
if (y === x) {
|
174
174
|
return true;
|
175
175
|
}
|
@@ -406,7 +406,7 @@ export function union_<A>(l: HashSet<A>, r: Iterable<A>): HashSet<A> {
|
|
406
406
|
export function toArray_<A>(set: HashSet<A>, O: P.Ord<A>): ReadonlyArray<A> {
|
407
407
|
const r: Array<A> = [];
|
408
408
|
set.forEach((a) => r.push(a));
|
409
|
-
return r.sort(O.
|
409
|
+
return r.sort(O.compare);
|
410
410
|
}
|
411
411
|
|
412
412
|
/*
|
@@ -426,14 +426,14 @@ function setTree<A>(set: HashSet<A>, newRoot: Node<A>, newSize: number) {
|
|
426
426
|
|
427
427
|
function modifyHash<A>(set: HashSet<A>, value: A, hash: number, remove: boolean): HashSet<A> {
|
428
428
|
const size = { value: set._size };
|
429
|
-
const newRoot = set._root.modify(remove, set._editable ? set._edit : NaN, set.config.
|
429
|
+
const newRoot = set._root.modify(remove, set._editable ? set._edit : NaN, set.config.equals, 0, hash, value, size);
|
430
430
|
return setTree(set, newRoot, size.value);
|
431
431
|
}
|
432
432
|
|
433
433
|
function tryGetHash<A>(set: HashSet<A>, value: A, hash: number): Maybe<A> {
|
434
434
|
let node = set._root;
|
435
435
|
let shift = 0;
|
436
|
-
const eq = set.config.
|
436
|
+
const eq = set.config.equals;
|
437
437
|
|
438
438
|
// eslint-disable-next-line no-constant-condition
|
439
439
|
while (true) {
|