@fncts/base 0.0.12 → 0.0.15
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 +16 -21
- package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -1
- package/_cjs/collection/compat/Array/api.cjs +10 -10
- package/_cjs/collection/compat/Array/derivations.cjs +96 -0
- package/_cjs/collection/compat/Array/derivations.cjs.map +1 -0
- package/_cjs/collection/compat/Array.cjs +13 -0
- package/_cjs/collection/compat/Array.cjs.map +1 -1
- package/_cjs/collection/compat/Record/instances.cjs +67 -16
- package/_cjs/collection/compat/Record/instances.cjs.map +1 -1
- package/_cjs/collection/compat.cjs +6 -0
- package/_cjs/collection/compat.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/api.cjs +9 -12
- package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/definition.cjs +41 -43
- package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/derivations.cjs +45 -0
- package/_cjs/collection/immutable/Conc/derivations.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc.cjs +13 -0
- package/_cjs/collection/immutable/Conc.cjs.map +1 -1
- package/_cjs/collection/immutable/Dictionary/definition.cjs +2 -4
- package/_cjs/collection/immutable/Dictionary/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/api.cjs +26 -29
- package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/definition.cjs +15 -17
- package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api.cjs +142 -159
- package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/constructors.cjs +2 -2
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs +18 -15
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/derivations.cjs +41 -0
- package/_cjs/collection/immutable/ImmutableArray/derivations.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs +11 -9
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray.cjs +13 -0
- package/_cjs/collection/immutable/ImmutableArray.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +21 -22
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs +2 -2
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs +3 -9
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs +62 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs +8 -2
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs +13 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs.map +1 -1
- package/_cjs/collection/immutable/List/definition.cjs +2 -2
- package/_cjs/collection/immutable/RoseTree/definition.cjs +13 -15
- package/_cjs/collection/immutable/RoseTree/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/api.cjs +8 -12
- package/_cjs/collection/immutable/Vector/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/definition.cjs +11 -13
- package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/internal.cjs +1 -1
- package/_cjs/collection/immutable.cjs +6 -0
- package/_cjs/collection/immutable.cjs.map +1 -0
- package/_cjs/collection/mutable/HashMap.cjs +4 -0
- package/_cjs/collection/mutable/HashMap.cjs.map +1 -1
- package/_cjs/collection/mutable.cjs +6 -0
- package/_cjs/collection/mutable.cjs.map +1 -0
- package/_cjs/collection/weak/IterableWeakMap.cjs +51 -2
- package/_cjs/collection/weak/IterableWeakMap.cjs.map +1 -1
- package/_cjs/collection/weak/IterableWeakSet.cjs +59 -7
- package/_cjs/collection/weak/IterableWeakSet.cjs.map +1 -1
- package/_cjs/collection/weak.cjs +6 -0
- package/_cjs/collection/weak.cjs.map +1 -0
- package/_cjs/collection.cjs +6 -0
- package/_cjs/collection.cjs.map +1 -0
- package/_cjs/control/Eval/api.cjs +9 -3
- package/_cjs/control/Eval/api.cjs.map +1 -1
- package/_cjs/control/Eval/definition.cjs +1 -8
- package/_cjs/control/Eval/definition.cjs.map +1 -1
- package/_cjs/control/Eval/instance.cjs +6 -0
- package/_cjs/control/Eval/instance.cjs.map +1 -1
- package/_cjs/control/Z/api.cjs +16 -14
- package/_cjs/control/Z/api.cjs.map +1 -1
- package/_cjs/control/Z/definition.cjs +8 -14
- package/_cjs/control/Z/definition.cjs.map +1 -1
- package/_cjs/control/Z/instances.cjs +6 -0
- package/_cjs/control/Z/instances.cjs.map +1 -1
- package/_cjs/control/Z/runtime.cjs +17 -13
- package/_cjs/control/Z/runtime.cjs.map +1 -1
- package/_cjs/control.cjs +6 -0
- package/_cjs/control.cjs.map +1 -0
- package/_cjs/data/Cause/api/isEmpty.cjs +2 -0
- package/_cjs/data/Cause/api/isEmpty.cjs.map +1 -1
- package/_cjs/data/Cause/api/linearize.cjs +2 -0
- package/_cjs/data/Cause/api/linearize.cjs.map +1 -1
- package/_cjs/data/Cause/api.cjs +2 -0
- package/_cjs/data/Cause/api.cjs.map +1 -1
- package/_cjs/data/Const/definition.cjs +0 -7
- package/_cjs/data/Const/definition.cjs.map +1 -1
- package/_cjs/data/Const/instances.cjs +11 -8
- package/_cjs/data/Const/instances.cjs.map +1 -1
- package/_cjs/data/Datum/api.cjs +479 -0
- package/_cjs/data/Datum/api.cjs.map +1 -0
- package/_cjs/data/Datum/definition.cjs +142 -0
- package/_cjs/data/Datum/definition.cjs.map +1 -0
- package/_cjs/data/Datum/instances.cjs +69 -0
- package/_cjs/data/Datum/instances.cjs.map +1 -0
- package/_cjs/data/DatumEither/api.cjs +365 -0
- package/_cjs/data/DatumEither/api.cjs.map +1 -0
- package/_cjs/data/DatumEither/definition.cjs +9 -0
- package/_cjs/data/DatumEither/definition.cjs.map +1 -0
- package/_cjs/data/DecodeError/definition.cjs +16 -4
- package/_cjs/data/DecodeError/definition.cjs.map +1 -1
- package/_cjs/data/DecodeError/instances.cjs +6 -0
- package/_cjs/data/DecodeError/instances.cjs.map +1 -0
- package/_cjs/data/DecodeError.cjs +13 -0
- package/_cjs/data/DecodeError.cjs.map +1 -1
- package/_cjs/data/Decoder/definition.cjs +3 -10
- package/_cjs/data/Decoder/definition.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 +21 -5
- package/_cjs/data/Either/api.cjs.map +1 -1
- package/_cjs/data/Either/definition.cjs +4 -11
- package/_cjs/data/Either/definition.cjs.map +1 -1
- package/_cjs/data/Either/instances.cjs +25 -23
- package/_cjs/data/Either/instances.cjs.map +1 -1
- package/_cjs/data/EitherT/api.cjs +106 -0
- package/_cjs/data/EitherT/api.cjs.map +1 -0
- package/_cjs/data/EitherT/definition.cjs +9 -0
- package/_cjs/data/EitherT/definition.cjs.map +1 -0
- package/_cjs/data/Environment/api.cjs +15 -14
- package/_cjs/data/Environment/api.cjs.map +1 -1
- package/_cjs/data/Environment/definition.cjs.map +1 -1
- package/_cjs/data/Identity/api.cjs +3 -1
- package/_cjs/data/Identity/api.cjs.map +1 -1
- package/_cjs/data/Identity/definition.cjs +2 -4
- package/_cjs/data/Identity/definition.cjs.map +1 -1
- package/_cjs/data/Identity/instances.cjs +6 -0
- package/_cjs/data/Identity/instances.cjs.map +1 -1
- package/_cjs/data/Intervals.cjs +292 -0
- package/_cjs/data/Intervals.cjs.map +1 -0
- package/_cjs/data/Maybe/api.cjs +3 -1
- package/_cjs/data/Maybe/api.cjs.map +1 -1
- package/_cjs/data/Maybe/definition.cjs +11 -13
- package/_cjs/data/Maybe/definition.cjs.map +1 -1
- package/_cjs/data/Maybe/instances.cjs +13 -11
- package/_cjs/data/Maybe/instances.cjs.map +1 -1
- package/_cjs/data/Newtype.cjs +3 -5
- package/_cjs/data/Newtype.cjs.map +1 -1
- package/_cjs/data/Patch/api.cjs +2 -0
- package/_cjs/data/Patch/api.cjs.map +1 -1
- package/_cjs/data/Struct/api.cjs +2 -0
- package/_cjs/data/Struct/api.cjs.map +1 -1
- package/_cjs/data/Struct/definition.cjs +2 -4
- package/_cjs/data/Struct/definition.cjs.map +1 -1
- package/_cjs/data/These/definition.cjs +1 -1
- package/_cjs/data/These/definition.cjs.map +1 -1
- package/_cjs/data/Zipped.cjs +55 -0
- package/_cjs/data/Zipped.cjs.map +1 -0
- package/_cjs/data/function/api.cjs +10 -0
- package/_cjs/data/function/api.cjs.map +1 -1
- package/_cjs/data/object/instances.cjs +9 -1
- package/_cjs/data/object/instances.cjs.map +1 -1
- package/_cjs/data/string/api.cjs +1 -1
- package/_cjs/data.cjs +6 -0
- package/_cjs/data.cjs.map +1 -0
- package/_cjs/global.cjs +6 -0
- package/_cjs/global.cjs.map +1 -0
- package/_cjs/index.cjs +6 -0
- package/_cjs/index.cjs.map +1 -0
- package/_cjs/json.cjs +6 -0
- package/_cjs/json.cjs.map +1 -0
- package/_cjs/optics/At/definition.cjs +2 -0
- package/_cjs/optics/At/definition.cjs.map +1 -1
- package/_cjs/optics/Iso/definition.cjs +4 -0
- package/_cjs/optics/Iso/definition.cjs.map +1 -1
- package/_cjs/optics/Lens/definition.cjs +4 -0
- package/_cjs/optics/Lens/definition.cjs.map +1 -1
- package/_cjs/optics/Optional/definition.cjs +5 -5
- package/_cjs/optics/Optional/definition.cjs.map +1 -1
- package/_cjs/optics/Prism/definition.cjs +2 -0
- package/_cjs/optics/Prism/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 +1 -1
- package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -1
- package/_cjs/optics/Traversal/definition.cjs +7 -3
- package/_cjs/optics/Traversal/definition.cjs.map +1 -1
- package/_cjs/optics.cjs +6 -0
- package/_cjs/optics.cjs.map +1 -0
- package/_cjs/typeclass/Alt.cjs +0 -7
- package/_cjs/typeclass/Alt.cjs.map +1 -1
- package/_cjs/typeclass/ApplicativeExcept.cjs +9 -35
- package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -1
- package/_cjs/typeclass/Apply.cjs +39 -66
- package/_cjs/typeclass/Apply.cjs.map +1 -1
- package/_cjs/typeclass/Chain.cjs +6 -28
- package/_cjs/typeclass/Chain.cjs.map +1 -1
- package/_cjs/typeclass/Fail.cjs +0 -10
- package/_cjs/typeclass/Fail.cjs.map +1 -1
- package/_cjs/typeclass/Filterable.cjs +0 -36
- package/_cjs/typeclass/Filterable.cjs.map +1 -1
- package/_cjs/typeclass/Foldable.cjs +4 -34
- package/_cjs/typeclass/Foldable.cjs.map +1 -1
- package/_cjs/typeclass/FoldableWithIndex.cjs +4 -34
- package/_cjs/typeclass/FoldableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Functor.cjs +3 -18
- package/_cjs/typeclass/Functor.cjs.map +1 -1
- package/_cjs/typeclass/Guard/definition.cjs +3 -10
- package/_cjs/typeclass/Guard/definition.cjs.map +1 -1
- package/_cjs/typeclass/HashEq.cjs +2 -0
- package/_cjs/typeclass/HashEq.cjs.map +1 -1
- package/_cjs/typeclass/MonadExcept.cjs +2 -10
- package/_cjs/typeclass/MonadExcept.cjs.map +1 -1
- package/_cjs/typeclass/Monoid.cjs +2 -0
- package/_cjs/typeclass/Monoid.cjs.map +1 -1
- package/_cjs/typeclass/Nil.cjs +0 -10
- package/_cjs/typeclass/Nil.cjs.map +1 -1
- package/_cjs/typeclass/Ord/definition.cjs +2 -0
- package/_cjs/typeclass/Ord/definition.cjs.map +1 -1
- package/_cjs/typeclass/Ord/instances.cjs +4 -3
- package/_cjs/typeclass/Ord/instances.cjs.map +1 -1
- package/_cjs/typeclass/Pointed.cjs +0 -11
- package/_cjs/typeclass/Pointed.cjs.map +1 -1
- package/_cjs/typeclass/Semialign.cjs +18 -46
- package/_cjs/typeclass/Semialign.cjs.map +1 -1
- package/_cjs/typeclass/Semimonoidal.cjs +0 -11
- package/_cjs/typeclass/Semimonoidal.cjs.map +1 -1
- package/_cjs/typeclass/Showable/show.cjs +12 -12
- package/_cjs/typeclass/Showable/show.cjs.map +1 -1
- package/_cjs/typeclass/Traversable.cjs +7 -26
- package/_cjs/typeclass/Traversable.cjs.map +1 -1
- package/_cjs/typeclass/TraversableWithIndex.cjs +3 -7
- package/_cjs/typeclass/TraversableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Witherable.cjs +3 -45
- package/_cjs/typeclass/Witherable.cjs.map +1 -1
- package/_cjs/typeclass/WitherableWithIndex.cjs +8 -44
- package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -1
- package/_cjs/util.cjs +6 -0
- package/_cjs/util.cjs.map +1 -0
- package/_mjs/collection/Iterable/api/traverseConc.mjs +16 -21
- package/_mjs/collection/Iterable/api/traverseConc.mjs.map +1 -1
- package/_mjs/collection/compat/Array/api.mjs +10 -10
- package/_mjs/collection/compat/Array/derivations.mjs +70 -0
- package/_mjs/collection/compat/Array/derivations.mjs.map +1 -0
- package/_mjs/collection/compat/Array.mjs +1 -0
- package/_mjs/collection/compat/Array.mjs.map +1 -1
- package/_mjs/collection/compat/Record/instances.mjs +62 -16
- package/_mjs/collection/compat/Record/instances.mjs.map +1 -1
- package/_mjs/collection/compat.mjs +2 -0
- package/_mjs/collection/compat.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/api.mjs +8 -11
- package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/definition.mjs +41 -42
- package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/derivations.mjs +27 -0
- package/_mjs/collection/immutable/Conc/derivations.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc.mjs +2 -1
- package/_mjs/collection/immutable/Conc.mjs.map +1 -1
- package/_mjs/collection/immutable/Dictionary/definition.mjs +2 -3
- package/_mjs/collection/immutable/Dictionary/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/api.mjs +18 -20
- package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/definition.mjs +15 -16
- package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/HashSet/api.mjs +1 -0
- package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api.mjs +134 -153
- package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/constructors.mjs +2 -2
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs +16 -12
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/derivations.mjs +25 -0
- package/_mjs/collection/immutable/ImmutableArray/derivations.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs +9 -8
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray.mjs +1 -0
- package/_mjs/collection/immutable/ImmutableArray.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +19 -19
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs +2 -2
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs +0 -2
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs +39 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs +4 -3
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs.map +1 -1
- package/_mjs/collection/immutable/List/definition.mjs +2 -2
- package/_mjs/collection/immutable/RoseTree/definition.mjs +13 -14
- package/_mjs/collection/immutable/RoseTree/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/SortedMap/api.mjs +1 -0
- package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/api.mjs +8 -12
- package/_mjs/collection/immutable/Vector/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/definition.mjs +11 -12
- package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/internal.mjs +1 -1
- package/_mjs/collection/immutable.mjs +2 -0
- package/_mjs/collection/immutable.mjs.map +1 -0
- package/_mjs/collection/mutable/HashMap.mjs +4 -0
- package/_mjs/collection/mutable/HashMap.mjs.map +1 -1
- package/_mjs/collection/mutable.mjs +2 -0
- package/_mjs/collection/mutable.mjs.map +1 -0
- package/_mjs/collection/weak/IterableWeakMap.mjs +51 -2
- package/_mjs/collection/weak/IterableWeakMap.mjs.map +1 -1
- package/_mjs/collection/weak/IterableWeakSet.mjs +59 -7
- package/_mjs/collection/weak/IterableWeakSet.mjs.map +1 -1
- package/_mjs/collection/weak.mjs +2 -0
- package/_mjs/collection/weak.mjs.map +1 -0
- package/_mjs/collection.mjs +2 -0
- package/_mjs/collection.mjs.map +1 -0
- package/_mjs/control/Eval/api.mjs +9 -4
- package/_mjs/control/Eval/api.mjs.map +1 -1
- package/_mjs/control/Eval/definition.mjs +1 -2
- package/_mjs/control/Eval/definition.mjs.map +1 -1
- package/_mjs/control/Eval/instance.mjs +1 -0
- package/_mjs/control/Eval/instance.mjs.map +1 -1
- package/_mjs/control/Eval/run.mjs +1 -0
- package/_mjs/control/Eval/run.mjs.map +1 -1
- package/_mjs/control/Z/api.mjs +16 -15
- package/_mjs/control/Z/api.mjs.map +1 -1
- package/_mjs/control/Z/definition.mjs +3 -5
- package/_mjs/control/Z/definition.mjs.map +1 -1
- package/_mjs/control/Z/instances.mjs +1 -0
- package/_mjs/control/Z/instances.mjs.map +1 -1
- package/_mjs/control/Z/runtime.mjs +15 -13
- package/_mjs/control/Z/runtime.mjs.map +1 -1
- package/_mjs/control.mjs +2 -0
- package/_mjs/control.mjs.map +1 -0
- package/_mjs/data/Branded/derivations.mjs +1 -0
- package/_mjs/data/Branded/derivations.mjs.map +1 -1
- package/_mjs/data/Cause/api/isEmpty.mjs +1 -0
- package/_mjs/data/Cause/api/isEmpty.mjs.map +1 -1
- package/_mjs/data/Cause/api/linearize.mjs +1 -0
- package/_mjs/data/Cause/api/linearize.mjs.map +1 -1
- package/_mjs/data/Cause/api.mjs +2 -1
- package/_mjs/data/Cause/api.mjs.map +1 -1
- package/_mjs/data/Const/definition.mjs +0 -3
- package/_mjs/data/Const/definition.mjs.map +1 -1
- package/_mjs/data/Const/instances.mjs +7 -5
- package/_mjs/data/Const/instances.mjs.map +1 -1
- package/_mjs/data/Datum/api.mjs +404 -0
- package/_mjs/data/Datum/api.mjs.map +1 -0
- package/_mjs/data/Datum/definition.mjs +112 -0
- package/_mjs/data/Datum/definition.mjs.map +1 -0
- package/_mjs/data/Datum/instances.mjs +52 -0
- package/_mjs/data/Datum/instances.mjs.map +1 -0
- package/_mjs/data/DatumEither/api.mjs +290 -0
- package/_mjs/data/DatumEither/api.mjs.map +1 -0
- package/_mjs/data/DatumEither/definition.mjs +2 -0
- package/_mjs/data/DatumEither/definition.mjs.map +1 -0
- package/_mjs/data/DecodeError/definition.mjs +12 -3
- package/_mjs/data/DecodeError/definition.mjs.map +1 -1
- package/_mjs/data/DecodeError/instances.mjs +2 -0
- package/_mjs/data/DecodeError/instances.mjs.map +1 -0
- package/_mjs/data/DecodeError.mjs +1 -0
- package/_mjs/data/DecodeError.mjs.map +1 -1
- package/_mjs/data/Decoder/api.mjs +1 -0
- package/_mjs/data/Decoder/api.mjs.map +1 -1
- package/_mjs/data/Decoder/definition.mjs +0 -2
- package/_mjs/data/Decoder/definition.mjs.map +1 -1
- package/_mjs/data/Either/api/alignWith.mjs +1 -0
- package/_mjs/data/Either/api/alignWith.mjs.map +1 -1
- package/_mjs/data/Either/api.mjs +17 -4
- package/_mjs/data/Either/api.mjs.map +1 -1
- package/_mjs/data/Either/definition.mjs +1 -3
- package/_mjs/data/Either/definition.mjs.map +1 -1
- package/_mjs/data/Either/instances.mjs +24 -23
- package/_mjs/data/Either/instances.mjs.map +1 -1
- package/_mjs/data/EitherT/api.mjs +73 -0
- package/_mjs/data/EitherT/api.mjs.map +1 -0
- package/_mjs/data/EitherT/definition.mjs +2 -0
- package/_mjs/data/EitherT/definition.mjs.map +1 -0
- package/_mjs/data/Environment/api.mjs +12 -13
- package/_mjs/data/Environment/api.mjs.map +1 -1
- package/_mjs/data/Environment/definition.mjs.map +1 -1
- package/_mjs/data/Identity/api.mjs +2 -1
- package/_mjs/data/Identity/api.mjs.map +1 -1
- package/_mjs/data/Identity/definition.mjs +2 -3
- package/_mjs/data/Identity/definition.mjs.map +1 -1
- package/_mjs/data/Identity/instances.mjs +1 -0
- package/_mjs/data/Identity/instances.mjs.map +1 -1
- package/_mjs/data/Intervals.mjs +257 -0
- package/_mjs/data/Intervals.mjs.map +1 -0
- package/_mjs/data/Maybe/api.mjs +2 -1
- package/_mjs/data/Maybe/api.mjs.map +1 -1
- package/_mjs/data/Maybe/definition.mjs +8 -10
- package/_mjs/data/Maybe/definition.mjs.map +1 -1
- package/_mjs/data/Maybe/instances.mjs +12 -11
- package/_mjs/data/Maybe/instances.mjs.map +1 -1
- package/_mjs/data/Newtype.mjs +3 -4
- package/_mjs/data/Newtype.mjs.map +1 -1
- package/_mjs/data/Patch/api.mjs +1 -0
- package/_mjs/data/Patch/api.mjs.map +1 -1
- package/_mjs/data/Struct/api.mjs +1 -0
- package/_mjs/data/Struct/api.mjs.map +1 -1
- package/_mjs/data/Struct/definition.mjs +2 -3
- package/_mjs/data/Struct/definition.mjs.map +1 -1
- package/_mjs/data/These/definition.mjs +1 -1
- package/_mjs/data/These/definition.mjs.map +1 -1
- package/_mjs/data/Zipped.mjs +37 -0
- package/_mjs/data/Zipped.mjs.map +1 -0
- package/_mjs/data/function/api.mjs +8 -0
- package/_mjs/data/function/api.mjs.map +1 -1
- package/_mjs/data/object/instances.mjs +7 -1
- package/_mjs/data/object/instances.mjs.map +1 -1
- package/_mjs/data/string/api.mjs +1 -1
- package/_mjs/data.mjs +2 -0
- package/_mjs/data.mjs.map +1 -0
- package/_mjs/global.mjs +2 -0
- package/_mjs/global.mjs.map +1 -0
- package/_mjs/index.mjs +2 -0
- package/_mjs/index.mjs.map +1 -0
- package/_mjs/json.mjs +2 -0
- package/_mjs/json.mjs.map +1 -0
- package/_mjs/optics/At/api.mjs +1 -0
- package/_mjs/optics/At/api.mjs.map +1 -1
- package/_mjs/optics/At/definition.mjs +1 -0
- package/_mjs/optics/At/definition.mjs.map +1 -1
- package/_mjs/optics/Index/api.mjs +1 -0
- package/_mjs/optics/Index/api.mjs.map +1 -1
- package/_mjs/optics/Iso/api.mjs +1 -0
- package/_mjs/optics/Iso/api.mjs.map +1 -1
- package/_mjs/optics/Iso/definition.mjs +2 -0
- package/_mjs/optics/Iso/definition.mjs.map +1 -1
- package/_mjs/optics/Lens/api.mjs +1 -0
- package/_mjs/optics/Lens/api.mjs.map +1 -1
- package/_mjs/optics/Lens/definition.mjs +2 -0
- package/_mjs/optics/Lens/definition.mjs.map +1 -1
- package/_mjs/optics/Optional/api/compose.mjs +1 -0
- package/_mjs/optics/Optional/api/compose.mjs.map +1 -1
- package/_mjs/optics/Optional/definition.mjs +5 -5
- package/_mjs/optics/Optional/definition.mjs.map +1 -1
- package/_mjs/optics/Prism/api/compose.mjs +1 -0
- package/_mjs/optics/Prism/api/compose.mjs.map +1 -1
- package/_mjs/optics/Prism/api/fromNullable.mjs +1 -0
- package/_mjs/optics/Prism/api/fromNullable.mjs.map +1 -1
- package/_mjs/optics/Prism/api/just.mjs +1 -0
- package/_mjs/optics/Prism/api/just.mjs.map +1 -1
- package/_mjs/optics/Prism/definition.mjs +1 -0
- package/_mjs/optics/Prism/definition.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/compose.mjs +2 -1
- package/_mjs/optics/Traversal/api/compose.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/fromTraversable.mjs +2 -1
- package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -1
- package/_mjs/optics/Traversal/definition.mjs +5 -3
- package/_mjs/optics/Traversal/definition.mjs.map +1 -1
- package/_mjs/optics.mjs +2 -0
- package/_mjs/optics.mjs.map +1 -0
- package/_mjs/typeclass/Alt.mjs +0 -5
- package/_mjs/typeclass/Alt.mjs.map +1 -1
- package/_mjs/typeclass/ApplicativeExcept.mjs +7 -32
- package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -1
- package/_mjs/typeclass/Apply.mjs +35 -65
- package/_mjs/typeclass/Apply.mjs.map +1 -1
- package/_mjs/typeclass/Chain.mjs +4 -25
- package/_mjs/typeclass/Chain.mjs.map +1 -1
- package/_mjs/typeclass/Eq/derivations.mjs +1 -0
- package/_mjs/typeclass/Eq/derivations.mjs.map +1 -1
- package/_mjs/typeclass/Fail.mjs +1 -8
- package/_mjs/typeclass/Fail.mjs.map +1 -1
- package/_mjs/typeclass/Filterable.mjs +0 -28
- package/_mjs/typeclass/Filterable.mjs.map +1 -1
- package/_mjs/typeclass/Foldable.mjs +3 -30
- package/_mjs/typeclass/Foldable.mjs.map +1 -1
- package/_mjs/typeclass/FoldableWithIndex.mjs +3 -30
- package/_mjs/typeclass/FoldableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Functor.mjs +3 -16
- package/_mjs/typeclass/Functor.mjs.map +1 -1
- package/_mjs/typeclass/Guard/api.mjs +1 -0
- package/_mjs/typeclass/Guard/api.mjs.map +1 -1
- package/_mjs/typeclass/Guard/definition.mjs +0 -2
- package/_mjs/typeclass/Guard/definition.mjs.map +1 -1
- package/_mjs/typeclass/HashEq.mjs +1 -0
- package/_mjs/typeclass/HashEq.mjs.map +1 -1
- package/_mjs/typeclass/MonadExcept.mjs +2 -9
- package/_mjs/typeclass/MonadExcept.mjs.map +1 -1
- package/_mjs/typeclass/Monoid.mjs +1 -0
- package/_mjs/typeclass/Monoid.mjs.map +1 -1
- package/_mjs/typeclass/Nil.mjs +1 -8
- package/_mjs/typeclass/Nil.mjs.map +1 -1
- package/_mjs/typeclass/Ord/definition.mjs +1 -0
- package/_mjs/typeclass/Ord/definition.mjs.map +1 -1
- package/_mjs/typeclass/Ord/instances.mjs +3 -0
- package/_mjs/typeclass/Ord/instances.mjs.map +1 -1
- package/_mjs/typeclass/Pointed.mjs +0 -9
- package/_mjs/typeclass/Pointed.mjs.map +1 -1
- package/_mjs/typeclass/Semialign.mjs +17 -45
- package/_mjs/typeclass/Semialign.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/api.mjs +1 -0
- package/_mjs/typeclass/Semigroup/api.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/derivations.mjs +1 -0
- package/_mjs/typeclass/Semigroup/derivations.mjs.map +1 -1
- package/_mjs/typeclass/Semimonoidal.mjs +0 -9
- package/_mjs/typeclass/Semimonoidal.mjs.map +1 -1
- package/_mjs/typeclass/Showable/show.mjs +12 -12
- package/_mjs/typeclass/Showable/show.mjs.map +1 -1
- package/_mjs/typeclass/Traversable.mjs +6 -25
- package/_mjs/typeclass/Traversable.mjs.map +1 -1
- package/_mjs/typeclass/TraversableWithIndex.mjs +2 -6
- package/_mjs/typeclass/TraversableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Witherable.mjs +3 -40
- package/_mjs/typeclass/Witherable.mjs.map +1 -1
- package/_mjs/typeclass/WitherableWithIndex.mjs +6 -41
- package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -1
- package/_mjs/util.mjs +2 -0
- package/_mjs/util.mjs.map +1 -0
- package/_src/collection/Iterable/api/traverseConc.ts +24 -21
- package/_src/collection/compat/Array/api.ts +10 -10
- package/_src/collection/compat/Array/definition.ts +3 -3
- package/_src/collection/compat/Array/derivations.ts +85 -0
- package/_src/collection/compat/Array.ts +1 -0
- package/_src/collection/compat/Record/instances.ts +43 -0
- package/_src/collection/compat.ts +4 -0
- package/_src/collection/immutable/Conc/api.ts +9 -11
- package/_src/collection/immutable/Conc/definition.ts +18 -13
- package/_src/collection/immutable/Conc/derivations.ts +28 -0
- package/_src/collection/immutable/Conc.ts +1 -0
- package/_src/collection/immutable/Dictionary/definition.ts +1 -1
- package/_src/collection/immutable/HashMap/api.ts +20 -17
- package/_src/collection/immutable/HashMap/definition.ts +10 -6
- package/_src/collection/immutable/ImmutableArray/api.ts +62 -119
- package/_src/collection/immutable/ImmutableArray/constructors.ts +2 -2
- package/_src/collection/immutable/ImmutableArray/definition.ts +11 -5
- package/_src/collection/immutable/ImmutableArray/derivations.ts +28 -0
- package/_src/collection/immutable/ImmutableArray/instances.ts +47 -42
- package/_src/collection/immutable/ImmutableArray.ts +1 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +13 -11
- package/_src/collection/immutable/ImmutableNonEmptyArray/constructors.ts +2 -2
- package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +10 -5
- package/_src/collection/immutable/ImmutableNonEmptyArray/derivations.ts +44 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/instances.ts +24 -25
- package/_src/collection/immutable/ImmutableNonEmptyArray.ts +1 -0
- package/_src/collection/immutable/List/definition.ts +2 -2
- package/_src/collection/immutable/RoseTree/definition.ts +7 -4
- package/_src/collection/immutable/Vector/api.ts +12 -16
- package/_src/collection/immutable/Vector/definition.ts +10 -10
- package/_src/collection/immutable/Vector/internal.ts +1 -1
- package/_src/collection/immutable.ts +12 -0
- package/_src/collection/mutable/HashMap.ts +4 -0
- package/_src/collection/mutable.ts +6 -0
- package/_src/collection/weak/IterableWeakMap.ts +50 -5
- package/_src/collection/weak/IterableWeakSet.ts +57 -9
- package/_src/collection/weak.ts +4 -0
- package/_src/collection.ts +7 -0
- package/_src/control/Eval/api.ts +5 -2
- package/_src/control/Eval/definition.ts +8 -5
- package/_src/control/Eval/instance.ts +7 -7
- package/_src/control/Z/api.ts +40 -52
- package/_src/control/Z/definition.ts +36 -36
- package/_src/control/Z/instances.ts +3 -3
- package/_src/control/Z/runtime.ts +11 -11
- package/_src/control.ts +5 -0
- package/_src/data/Const/definition.ts +9 -17
- package/_src/data/Const/instances.ts +5 -5
- package/_src/data/Datum/api.ts +376 -0
- package/_src/data/Datum/definition.ts +102 -0
- package/_src/data/Datum/instances.ts +34 -0
- package/_src/data/DatumEither/api.ts +348 -0
- package/_src/data/DatumEither/definition.ts +20 -0
- package/_src/data/DecodeError/definition.ts +11 -3
- package/_src/data/DecodeError/instances.ts +0 -0
- package/_src/data/DecodeError.ts +1 -0
- package/_src/data/Decoder/definition.ts +7 -4
- package/_src/data/Either/api.ts +12 -2
- package/_src/data/Either/definition.ts +10 -15
- package/_src/data/Either/instances.ts +6 -6
- package/_src/data/EitherT/api.ts +239 -0
- package/_src/data/EitherT/definition.ts +23 -0
- package/_src/data/Environment/api.ts +8 -6
- package/_src/data/Environment/definition.ts +2 -2
- package/_src/data/Identity/api.ts +2 -2
- package/_src/data/Identity/definition.ts +2 -2
- package/_src/data/Identity/instances.ts +7 -7
- package/_src/data/Intervals.ts +126 -0
- package/_src/data/Maybe/api.ts +2 -2
- package/_src/data/Maybe/definition.ts +8 -5
- package/_src/data/Maybe/instances.ts +10 -10
- package/_src/data/Newtype.ts +32 -11
- package/_src/data/Struct/definition.ts +1 -1
- package/_src/data/Tag/definition.ts +2 -2
- package/_src/data/These/definition.ts +1 -1
- package/_src/data/Zipped.ts +52 -0
- package/_src/data/function/api.ts +8 -0
- package/_src/data/object/instances.ts +11 -1
- package/_src/data/string/api.ts +1 -1
- package/_src/data.ts +35 -0
- package/_src/global.ts +252 -0
- package/_src/index.ts +8 -0
- package/_src/json.ts +5 -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 +11 -11
- package/_src/optics/Traversal/definition.ts +13 -12
- package/_src/optics.ts +12 -0
- package/_src/typeclass/Align.ts +1 -1
- package/_src/typeclass/Alt.ts +24 -54
- package/_src/typeclass/Alternative.ts +1 -1
- package/_src/typeclass/Applicative.ts +6 -1
- package/_src/typeclass/ApplicativeExcept.ts +55 -81
- package/_src/typeclass/Apply.ts +224 -253
- package/_src/typeclass/Chain.ts +71 -98
- package/_src/typeclass/Fail.ts +10 -28
- package/_src/typeclass/Filterable.ts +13 -67
- package/_src/typeclass/FilterableWithIndex.ts +13 -13
- package/_src/typeclass/Foldable.ts +16 -35
- package/_src/typeclass/FoldableWithIndex.ts +14 -37
- package/_src/typeclass/Functor.ts +11 -21
- package/_src/typeclass/FunctorWithIndex.ts +4 -4
- package/_src/typeclass/Guard/definition.ts +1 -3
- package/_src/typeclass/Monad.ts +1 -1
- package/_src/typeclass/MonadExcept.ts +11 -7
- package/_src/typeclass/Nil.ts +10 -27
- package/_src/typeclass/Pointed.ts +11 -30
- package/_src/typeclass/Semialign.ts +285 -253
- package/_src/typeclass/Semimonoidal.ts +23 -54
- package/_src/typeclass/Showable/show.ts +10 -12
- package/_src/typeclass/Traversable.ts +45 -63
- package/_src/typeclass/TraversableWithIndex.ts +37 -34
- package/_src/typeclass/Witherable.ts +28 -115
- package/_src/typeclass/WitherableWithIndex.ts +82 -115
- package/_src/types/extractions.ts +1 -1
- package/_src/util.ts +8 -0
- package/collection/Iterable/api/traverseConc.d.ts +4 -6
- package/collection/compat/Array/api.d.ts +10 -10
- package/collection/compat/Array/definition.d.ts +3 -3
- package/collection/compat/Array/derivations.d.ts +24 -0
- package/collection/compat/Array.d.ts +1 -0
- package/collection/compat/Record/instances.d.ts +12 -0
- package/collection/compat.d.ts +2 -0
- package/collection/immutable/Conc/api.d.ts +4 -6
- package/collection/immutable/Conc/definition.d.ts +24 -20
- package/collection/immutable/Conc/derivations.d.ts +14 -0
- package/collection/immutable/Conc.d.ts +1 -0
- package/collection/immutable/Dictionary/definition.d.ts +1 -1
- package/collection/immutable/HashMap/api.d.ts +13 -13
- package/collection/immutable/HashMap/definition.d.ts +10 -7
- package/collection/immutable/ImmutableArray/api.d.ts +22 -24
- package/collection/immutable/ImmutableArray/constructors.d.ts +2 -2
- package/collection/immutable/ImmutableArray/definition.d.ts +12 -6
- package/collection/immutable/ImmutableArray/derivations.d.ts +14 -0
- package/collection/immutable/ImmutableArray/instances.d.ts +17 -17
- package/collection/immutable/ImmutableArray.d.ts +1 -0
- package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +6 -5
- package/collection/immutable/ImmutableNonEmptyArray/constructors.d.ts +2 -2
- package/collection/immutable/ImmutableNonEmptyArray/definition.d.ts +9 -5
- package/collection/immutable/ImmutableNonEmptyArray/derivations.d.ts +14 -0
- package/collection/immutable/ImmutableNonEmptyArray/instances.d.ts +10 -10
- package/collection/immutable/ImmutableNonEmptyArray.d.ts +1 -0
- package/collection/immutable/List/definition.d.ts +2 -2
- package/collection/immutable/RoseTree/definition.d.ts +7 -5
- package/collection/immutable/Vector/api.d.ts +4 -4
- package/collection/immutable/Vector/definition.d.ts +9 -10
- package/collection/immutable/Vector/internal.d.ts +1 -1
- package/collection/immutable.d.ts +10 -0
- package/collection/mutable/HashMap.d.ts +1 -0
- package/collection/mutable.d.ts +4 -0
- package/collection/weak/IterableWeakMap.d.ts +9 -3
- package/collection/weak/IterableWeakSet.d.ts +10 -4
- package/collection/weak.d.ts +2 -0
- package/collection.d.ts +5 -0
- package/control/Eval/api.d.ts +6 -1
- package/control/Eval/definition.d.ts +6 -4
- package/control/Eval/instance.d.ts +3 -3
- package/control/Z/api.d.ts +32 -30
- package/control/Z/definition.d.ts +43 -37
- package/control/Z/instances.d.ts +2 -2
- package/control/Z/runtime.d.ts +9 -8
- package/control.d.ts +3 -0
- package/data/Const/definition.d.ts +8 -16
- package/data/Const/instances.d.ts +4 -3
- package/data/Datum/api.d.ts +188 -0
- package/data/Datum/definition.d.ts +75 -0
- package/data/Datum/instances.d.ts +32 -0
- package/data/DatumEither/api.d.ts +169 -0
- package/data/DatumEither/definition.d.ts +21 -0
- package/data/DecodeError/definition.d.ts +6 -0
- package/data/DecodeError/instances.d.ts +1 -0
- package/data/DecodeError.d.ts +1 -0
- package/data/Decoder/definition.d.ts +6 -4
- package/data/Either/api.d.ts +10 -0
- package/data/Either/definition.d.ts +8 -14
- package/data/Either/instances.d.ts +4 -3
- package/data/EitherT/api.d.ts +60 -0
- package/data/EitherT/definition.d.ts +12 -0
- package/data/Environment/api.d.ts +7 -5
- package/data/Environment/definition.d.ts +3 -3
- package/data/Identity/api.d.ts +2 -1
- package/data/Identity/definition.d.ts +2 -2
- package/data/Identity/instances.d.ts +3 -3
- package/data/Intervals.d.ts +53 -0
- package/data/Maybe/api.d.ts +2 -1
- package/data/Maybe/definition.d.ts +10 -5
- package/data/Maybe/instances.d.ts +6 -6
- package/data/Newtype.d.ts +9 -8
- package/data/Struct/definition.d.ts +1 -1
- package/data/Tag/definition.d.ts +2 -2
- package/data/Zipped.d.ts +24 -0
- package/data/function/api.d.ts +6 -0
- package/data/object/instances.d.ts +6 -1
- package/data/string/api.d.ts +1 -1
- package/data.d.ts +33 -0
- package/global.d.ts +237 -0
- package/index.d.ts +8 -0
- package/json.d.ts +3 -0
- package/optics/Traversal/api/fromTraversable.d.ts +1 -1
- package/optics/Traversal/definition.d.ts +2 -4
- package/optics.d.ts +10 -0
- package/package.json +6 -2
- package/typeclass/Align.d.ts +1 -1
- package/typeclass/Alt.d.ts +2 -4
- package/typeclass/Alternative.d.ts +1 -1
- package/typeclass/Applicative.d.ts +2 -1
- package/typeclass/ApplicativeExcept.d.ts +5 -13
- package/typeclass/Apply.d.ts +20 -32
- package/typeclass/Chain.d.ts +5 -13
- package/typeclass/Fail.d.ts +2 -7
- package/typeclass/Filterable.d.ts +7 -31
- package/typeclass/FilterableWithIndex.d.ts +7 -7
- package/typeclass/Foldable.d.ts +6 -19
- package/typeclass/FoldableWithIndex.d.ts +6 -19
- package/typeclass/Functor.d.ts +4 -11
- package/typeclass/FunctorWithIndex.d.ts +2 -2
- package/typeclass/Guard/definition.d.ts +1 -4
- package/typeclass/Monad.d.ts +1 -1
- package/typeclass/MonadExcept.d.ts +3 -4
- package/typeclass/Nil.d.ts +2 -7
- package/typeclass/Pointed.d.ts +2 -7
- package/typeclass/Semialign.d.ts +26 -32
- package/typeclass/Semimonoidal.d.ts +3 -8
- package/typeclass/Showable/show.d.ts +1 -1
- package/typeclass/Traversable.d.ts +21 -12
- package/typeclass/TraversableWithIndex.d.ts +19 -6
- package/typeclass/Witherable.d.ts +5 -19
- package/typeclass/WitherableWithIndex.d.ts +33 -19
- package/types/extractions.d.ts +1 -1
- package/util.d.ts +6 -0
|
@@ -174,8 +174,8 @@ export function crossWith_<A, B, C>(
|
|
|
174
174
|
export function cross_<A, B>(
|
|
175
175
|
self: ImmutableNonEmptyArray<A>,
|
|
176
176
|
fb: ImmutableNonEmptyArray<B>,
|
|
177
|
-
): ImmutableNonEmptyArray<
|
|
178
|
-
return self.crossWith(fb, (a, b) =>
|
|
177
|
+
): ImmutableNonEmptyArray<Zipped.Make<A, B>> {
|
|
178
|
+
return self.crossWith(fb, (a, b) => Zipped(a, b));
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
/**
|
|
@@ -394,19 +394,21 @@ export function sort<A>(self: ImmutableNonEmptyArray<A>, /** @tsplus auto */ O:
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
/**
|
|
397
|
-
* @tsplus
|
|
397
|
+
* @tsplus getter fncts.ImmutableNonEmptyArray traverseWithIndex
|
|
398
398
|
*/
|
|
399
|
-
export const
|
|
400
|
-
self
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
399
|
+
export const traverseWithIndex = P.TraversableWithIndex.makeTraverseWithIndex<ImmutableNonEmptyArrayF>()(
|
|
400
|
+
() => (self) => (G) => (f) =>
|
|
401
|
+
self.tail.foldLeftWithIndex(
|
|
402
|
+
G.map(f(0, self.head), (b) => ImmutableNonEmptyArray(b)),
|
|
403
|
+
(i, fbs, a) => G.zipWith(fbs, f(i + 1, a), (bs, b) => bs.append(b)),
|
|
404
|
+
),
|
|
405
|
+
);
|
|
404
406
|
|
|
405
407
|
/**
|
|
406
|
-
* @tsplus
|
|
408
|
+
* @tsplus getter fncts.ImmutableNonEmptyArray traverse
|
|
407
409
|
*/
|
|
408
|
-
export const
|
|
409
|
-
self.traverseWithIndex((_, a) => f(a)
|
|
410
|
+
export const traverse: P.Traversable<ImmutableNonEmptyArrayF>["traverse"] = (self) => (G) => (f) =>
|
|
411
|
+
self.traverseWithIndex(G)((_, a) => f(a));
|
|
410
412
|
|
|
411
413
|
/**
|
|
412
414
|
* @tsplus fluent fncts.ImmutableNonEmptyArray uniq
|
|
@@ -7,8 +7,8 @@ export function allocWithHead<A>(head: A, length: number): Array<A> & { 0: A } {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @tsplus getter fncts.
|
|
11
|
-
* @tsplus getter fncts.
|
|
10
|
+
* @tsplus getter fncts.ReadonlyArray unsafeAsNonEmptyArray
|
|
11
|
+
* @tsplus getter fncts.Array unsafeAsNonEmptyArray
|
|
12
12
|
*/
|
|
13
13
|
export function unsafeAsNonEmptyArray<A>(self: ReadonlyArray<A>): ImmutableNonEmptyArray<A> {
|
|
14
14
|
if (self.length === 0) {
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import { ImmutableArray } from "@fncts/base/collection/immutable/ImmutableArray/definition";
|
|
2
2
|
|
|
3
|
-
export interface ImmutableNonEmptyArrayF extends
|
|
3
|
+
export interface ImmutableNonEmptyArrayF extends HKT {
|
|
4
|
+
type: ImmutableNonEmptyArray<this["A"]>;
|
|
5
|
+
variance: {
|
|
6
|
+
A: "+";
|
|
7
|
+
};
|
|
8
|
+
index: number;
|
|
9
|
+
}
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
12
|
* @tsplus type fncts.ImmutableNonEmptyArray
|
|
7
13
|
* @tsplus companion fncts.ImmutableNonEmptyArrayOps
|
|
8
14
|
*/
|
|
9
15
|
export class ImmutableNonEmptyArray<A> extends ImmutableArray<A> {
|
|
10
|
-
|
|
11
|
-
[HKT.T]!: ImmutableNonEmptyArray<HKT._A<this>>;
|
|
16
|
+
readonly _A!: () => A;
|
|
12
17
|
constructor(readonly _array: ReadonlyNonEmptyArray<A>) {
|
|
13
18
|
super(_array);
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
/**
|
|
18
|
-
* @tsplus type fncts.
|
|
23
|
+
* @tsplus type fncts.NonEmptyArray
|
|
19
24
|
*/
|
|
20
25
|
export interface NonEmptyArray<T> extends Array<T> {
|
|
21
26
|
0: T;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
/**
|
|
25
|
-
* @tsplus type fncts.
|
|
30
|
+
* @tsplus type fncts.ReadonlyNonEmptyArray
|
|
26
31
|
*/
|
|
27
32
|
export interface ReadonlyNonEmptyArray<T> extends ReadonlyArray<T> {
|
|
28
33
|
readonly 0: T;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Check } from "@fncts/typelevel/Check";
|
|
2
|
+
|
|
3
|
+
import { CompoundError, EmptyError } from "@fncts/base/data/DecodeError";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @tsplus derive fncts.Guard[fncts.ImmutableNonEmptyArray]<_> 10
|
|
7
|
+
*/
|
|
8
|
+
export function deriveGuard<A extends ImmutableNonEmptyArray<any>>(
|
|
9
|
+
...[elem]: [A] extends [ImmutableNonEmptyArray<infer _A>] ? [elem: Guard<_A>] : never
|
|
10
|
+
): Guard<A> {
|
|
11
|
+
return Guard((u): u is A => {
|
|
12
|
+
if (ImmutableNonEmptyArray.is(u)) {
|
|
13
|
+
return u.every(elem.is);
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @tsplus derive fncts.Decoder[fncts.ImmutableNonEmptyArray]<_> 10
|
|
21
|
+
*/
|
|
22
|
+
export function deriveDecoder<A extends ImmutableNonEmptyArray<any>>(
|
|
23
|
+
...[array, elem]: [A] extends [ImmutableNonEmptyArray<infer _A>]
|
|
24
|
+
? Check<Check.IsEqual<A, ImmutableNonEmptyArray<_A>>> extends Check.True
|
|
25
|
+
? [array: Decoder<Array<_A>>, elem: Decoder<_A>]
|
|
26
|
+
: never
|
|
27
|
+
: never
|
|
28
|
+
): Decoder<A> {
|
|
29
|
+
return Decoder(
|
|
30
|
+
(u) =>
|
|
31
|
+
array.decode(u).match2(These.left, (warn, as) => {
|
|
32
|
+
if (as.isNonEmpty()) {
|
|
33
|
+
return These.right(new ImmutableNonEmptyArray(as) as A);
|
|
34
|
+
} else {
|
|
35
|
+
const err = new EmptyError(as);
|
|
36
|
+
return warn.match(
|
|
37
|
+
() => These.left(err),
|
|
38
|
+
(err0) => These.left(new CompoundError(`ImmutableNonEmptyArray<${elem.label}>`, Vector(err0, err))),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}),
|
|
42
|
+
`ImmutableNonEmptyArray<${elem.label}>`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -4,7 +4,6 @@ import type * as P from "@fncts/base/typeclass";
|
|
|
4
4
|
import {
|
|
5
5
|
align_,
|
|
6
6
|
alignWith_,
|
|
7
|
-
ap_,
|
|
8
7
|
cross_,
|
|
9
8
|
crossWith_,
|
|
10
9
|
flatMap_,
|
|
@@ -14,92 +13,92 @@ import {
|
|
|
14
13
|
foldRightWithIndex_,
|
|
15
14
|
map_,
|
|
16
15
|
mapWithIndex_,
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
traverse,
|
|
17
|
+
traverseWithIndex,
|
|
19
18
|
} from "@fncts/base/collection/immutable/ImmutableNonEmptyArray/api";
|
|
20
19
|
import { make } from "@fncts/base/collection/immutable/ImmutableNonEmptyArray/constructors";
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps Semialign
|
|
24
23
|
*/
|
|
25
|
-
export const Semialign
|
|
24
|
+
export const Semialign = HKT.instance<P.Semialign<ImmutableNonEmptyArrayF>>({
|
|
26
25
|
map: map_,
|
|
27
26
|
alignWith: alignWith_,
|
|
28
|
-
};
|
|
27
|
+
});
|
|
29
28
|
|
|
30
29
|
/**
|
|
31
30
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps Functor
|
|
32
31
|
*/
|
|
33
|
-
export const Functor
|
|
32
|
+
export const Functor = HKT.instance<P.Functor<ImmutableNonEmptyArrayF>>({
|
|
34
33
|
map: map_,
|
|
35
|
-
};
|
|
34
|
+
});
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
37
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps FunctorWithIndex
|
|
39
38
|
*/
|
|
40
|
-
export const FunctorWithIndex
|
|
39
|
+
export const FunctorWithIndex = HKT.instance<P.FunctorWithIndex<ImmutableNonEmptyArrayF>>({
|
|
41
40
|
map: map_,
|
|
42
41
|
mapWithIndex: mapWithIndex_,
|
|
43
|
-
};
|
|
42
|
+
});
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
45
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps Apply
|
|
47
46
|
*/
|
|
48
|
-
export const Apply
|
|
47
|
+
export const Apply = HKT.instance<P.Apply<ImmutableNonEmptyArrayF>>({
|
|
49
48
|
...Functor,
|
|
50
49
|
zip: cross_,
|
|
51
50
|
zipWith: crossWith_,
|
|
52
|
-
};
|
|
51
|
+
});
|
|
53
52
|
|
|
54
53
|
/**
|
|
55
54
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps Applicative
|
|
56
55
|
*/
|
|
57
|
-
export const Applicative
|
|
56
|
+
export const Applicative = HKT.instance<P.Applicative<ImmutableNonEmptyArrayF>>({
|
|
58
57
|
...Apply,
|
|
59
58
|
pure: make,
|
|
60
|
-
};
|
|
59
|
+
});
|
|
61
60
|
|
|
62
61
|
/**
|
|
63
62
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps Monad
|
|
64
63
|
*/
|
|
65
|
-
export const Monad
|
|
64
|
+
export const Monad = HKT.instance<P.Monad<ImmutableNonEmptyArrayF>>({
|
|
66
65
|
...Applicative,
|
|
67
66
|
flatMap: flatMap_,
|
|
68
|
-
};
|
|
67
|
+
});
|
|
69
68
|
|
|
70
69
|
/**
|
|
71
70
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps Foldable
|
|
72
71
|
*/
|
|
73
|
-
export const Foldable
|
|
72
|
+
export const Foldable = HKT.instance<P.Foldable<ImmutableNonEmptyArrayF>>({
|
|
74
73
|
foldLeft: foldLeft_,
|
|
75
74
|
foldRight: foldRight_,
|
|
76
|
-
};
|
|
75
|
+
});
|
|
77
76
|
|
|
78
77
|
/**
|
|
79
78
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps FoldableWithIndex
|
|
80
79
|
*/
|
|
81
|
-
export const FoldableWithIndex
|
|
80
|
+
export const FoldableWithIndex = HKT.instance<P.FoldableWithIndex<ImmutableNonEmptyArrayF>>({
|
|
82
81
|
...Foldable,
|
|
83
82
|
foldLeftWithIndex: foldLeftWithIndex_,
|
|
84
83
|
foldRightWithIndex: foldRightWithIndex_,
|
|
85
|
-
};
|
|
84
|
+
});
|
|
86
85
|
|
|
87
86
|
/**
|
|
88
87
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps Traversable
|
|
89
88
|
*/
|
|
90
|
-
export const Traversable
|
|
89
|
+
export const Traversable = HKT.instance<P.Traversable<ImmutableNonEmptyArrayF>>({
|
|
91
90
|
...Functor,
|
|
92
91
|
...Foldable,
|
|
93
|
-
traverse:
|
|
94
|
-
};
|
|
92
|
+
traverse: traverse,
|
|
93
|
+
});
|
|
95
94
|
|
|
96
95
|
/**
|
|
97
96
|
* @tsplus static fncts.ImmutableNonEmptyArrayOps TraversableWithIndex
|
|
98
97
|
*/
|
|
99
|
-
export const TraversableWithIndex
|
|
98
|
+
export const TraversableWithIndex = HKT.instance<P.TraversableWithIndex<ImmutableNonEmptyArrayF>>({
|
|
100
99
|
...Functor,
|
|
101
100
|
...FunctorWithIndex,
|
|
102
101
|
...FoldableWithIndex,
|
|
103
102
|
...Traversable,
|
|
104
|
-
traverseWithIndex:
|
|
105
|
-
};
|
|
103
|
+
traverseWithIndex: traverseWithIndex,
|
|
104
|
+
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export * from "./ImmutableNonEmptyArray/api.js";
|
|
3
3
|
export * from "./ImmutableNonEmptyArray/constructors.js";
|
|
4
4
|
export * from "./ImmutableNonEmptyArray/definition.js";
|
|
5
|
+
export * from "./ImmutableNonEmptyArray/derivations.js";
|
|
5
6
|
export * from "./ImmutableNonEmptyArray/destructors.js";
|
|
6
7
|
export * from "./ImmutableNonEmptyArray/instances.js";
|
|
7
8
|
// codegen:end
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @tsplus type fncts.
|
|
16
|
+
* @tsplus type fncts.List.Cons
|
|
17
17
|
* @tsplus companion fncts.ConsOps
|
|
18
18
|
*/
|
|
19
19
|
export class Cons<A> implements Iterable<A> {
|
|
@@ -48,7 +48,7 @@ export class Cons<A> implements Iterable<A> {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* @tsplus type fncts.
|
|
51
|
+
* @tsplus type fncts.List.Nil
|
|
52
52
|
* @tsplus companion fncts.NilOps
|
|
53
53
|
*/
|
|
54
54
|
export class Nil<A> implements Iterable<A> {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export const RoseTreeTypeId = Symbol.for("fncts.RoseTree");
|
|
2
2
|
export type RoseTreeTypeId = typeof RoseTreeTypeId;
|
|
3
3
|
|
|
4
|
-
export interface RoseTreeF extends
|
|
4
|
+
export interface RoseTreeF extends HKT {
|
|
5
|
+
type: RoseTree<this["A"]>;
|
|
6
|
+
variance: {
|
|
7
|
+
A: "+";
|
|
8
|
+
};
|
|
9
|
+
}
|
|
5
10
|
|
|
6
11
|
/**
|
|
7
12
|
* @tsplus type fncts.RoseTree
|
|
@@ -9,9 +14,7 @@ export interface RoseTreeF extends RoseTree<any> {}
|
|
|
9
14
|
*/
|
|
10
15
|
export class RoseTree<A> implements Hashable, Equatable {
|
|
11
16
|
readonly _typeId: RoseTreeTypeId = RoseTreeTypeId;
|
|
12
|
-
|
|
13
|
-
readonly [HKT.A]!: () => A;
|
|
14
|
-
readonly [HKT.T]!: RoseTree<HKT._A<this>>;
|
|
17
|
+
declare _A: () => A;
|
|
15
18
|
constructor(readonly value: A, readonly forest: Vector<RoseTree<A>>) {}
|
|
16
19
|
[Symbol.equals](that: unknown): boolean {
|
|
17
20
|
return isRoseTree(that) ? Equatable.strictEquals(this.value, that.value) && this.forest == that.forest : false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable prefer-const */
|
|
2
2
|
import type { MutableVector, VectorF } from "@fncts/base/collection/immutable/Vector/definition";
|
|
3
|
-
import type { Eq, Monoid, Ord, Ordering, Traversable
|
|
3
|
+
import type { Eq, Monoid, Ord, Ordering, Traversable } from "@fncts/base/typeclass";
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
affixPush,
|
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
updateNode,
|
|
49
49
|
zeroOffset,
|
|
50
50
|
} from "@fncts/base/collection/immutable/Vector/internal";
|
|
51
|
+
import { TraversableWithIndex } from "@fncts/base/typeclass";
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
54
|
* Appends an element to the end of a Vector and returns the new Vector.
|
|
@@ -1201,27 +1202,22 @@ export function toList<A>(self: Vector<A>): List<A> {
|
|
|
1201
1202
|
}
|
|
1202
1203
|
|
|
1203
1204
|
/**
|
|
1204
|
-
* @tsplus
|
|
1205
|
+
* @tsplus getter fncts.Vector traverseWithIndex
|
|
1205
1206
|
*/
|
|
1206
|
-
export const traverseWithIndex
|
|
1207
|
+
export const traverseWithIndex = TraversableWithIndex.makeTraverseWithIndex<VectorF>()(() => (self) => (G) => (f) => {
|
|
1207
1208
|
return self.foldLeftWithIndex(G.pure(Vector.emptyPushable()), (i, b, a) =>
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
return v;
|
|
1213
|
-
},
|
|
1214
|
-
G,
|
|
1215
|
-
),
|
|
1209
|
+
G.zipWith(b, f(i, a), (v, b) => {
|
|
1210
|
+
push(v, b);
|
|
1211
|
+
return v;
|
|
1212
|
+
}),
|
|
1216
1213
|
);
|
|
1217
|
-
};
|
|
1214
|
+
});
|
|
1218
1215
|
|
|
1219
1216
|
/**
|
|
1220
|
-
* @tsplus
|
|
1217
|
+
* @tsplus getter fncts.Vector traverse
|
|
1221
1218
|
*/
|
|
1222
|
-
export const traverse: Traversable<VectorF>["traverse"] = (self
|
|
1223
|
-
|
|
1224
|
-
};
|
|
1219
|
+
export const traverse: Traversable<VectorF>["traverse"] = (self) => (G) => (f) =>
|
|
1220
|
+
self.traverseWithIndex(G)((_, a) => f(a));
|
|
1225
1221
|
|
|
1226
1222
|
/**
|
|
1227
1223
|
* Returns a new Vector without repeated elements by using the given
|
|
@@ -8,7 +8,13 @@ import { ForwardVectorIterator } from "@fncts/base/collection/immutable/Vector/i
|
|
|
8
8
|
export const VectorTypeId = Symbol.for("fncts.Vector");
|
|
9
9
|
export type VectorTypeId = typeof VectorTypeId;
|
|
10
10
|
|
|
11
|
-
export interface VectorF extends
|
|
11
|
+
export interface VectorF extends HKT {
|
|
12
|
+
type: Vector<this["A"]>;
|
|
13
|
+
variance: {
|
|
14
|
+
A: "+";
|
|
15
|
+
};
|
|
16
|
+
index: number;
|
|
17
|
+
}
|
|
12
18
|
|
|
13
19
|
/**
|
|
14
20
|
* Represents a Vector of elements.
|
|
@@ -18,10 +24,7 @@ export interface VectorF extends Vector<any> {}
|
|
|
18
24
|
*/
|
|
19
25
|
export class Vector<A> implements Iterable<A> {
|
|
20
26
|
readonly _typeId: VectorTypeId = VectorTypeId;
|
|
21
|
-
readonly
|
|
22
|
-
readonly [HKT.A]!: () => A;
|
|
23
|
-
readonly [HKT.T]!: Vector<HKT._A<this>>;
|
|
24
|
-
readonly [HKT.Ix]!: number;
|
|
27
|
+
readonly _A!: () => A;
|
|
25
28
|
constructor(
|
|
26
29
|
/** @private */
|
|
27
30
|
readonly bits: number,
|
|
@@ -50,14 +53,11 @@ export class Vector<A> implements Iterable<A> {
|
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
/**
|
|
53
|
-
* @tsplus type fncts.
|
|
56
|
+
* @tsplus type fncts.MutableVector
|
|
54
57
|
*/
|
|
55
58
|
export interface MutableVector<A> {
|
|
56
59
|
readonly _typeId: VectorTypeId;
|
|
57
|
-
readonly
|
|
58
|
-
readonly [HKT.A]: () => A;
|
|
59
|
-
readonly [HKT.T]: Vector<HKT._A<this>>;
|
|
60
|
-
readonly [HKT.Ix]: number;
|
|
60
|
+
readonly _A: () => A;
|
|
61
61
|
bits: number;
|
|
62
62
|
offset: number;
|
|
63
63
|
length: number;
|
|
@@ -357,7 +357,7 @@ export function decrementDepth(bits: number): number {
|
|
|
357
357
|
/**
|
|
358
358
|
* Appends the value to the Vector by _mutating_ the Vector and its content.
|
|
359
359
|
*
|
|
360
|
-
* @tsplus fluent fncts.
|
|
360
|
+
* @tsplus fluent fncts.MutableVector push
|
|
361
361
|
*/
|
|
362
362
|
export function push<A>(l: MutableVector<A>, value: A): MutableVector<A> {
|
|
363
363
|
const suffixSize = getSuffixSize(l);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// codegen:start { preset: type-barrel, include: ./immutable/*.ts }
|
|
2
|
+
export type {} from "./immutable/Conc.js";
|
|
3
|
+
export type {} from "./immutable/HashMap.js";
|
|
4
|
+
export type {} from "./immutable/HashSet.js";
|
|
5
|
+
export type {} from "./immutable/ImmutableArray.js";
|
|
6
|
+
export type {} from "./immutable/ImmutableNonEmptyArray.js";
|
|
7
|
+
export type {} from "./immutable/List.js";
|
|
8
|
+
export type {} from "./immutable/Queue.js";
|
|
9
|
+
export type {} from "./immutable/RoseTree.js";
|
|
10
|
+
export type {} from "./immutable/SortedMap.js";
|
|
11
|
+
export type {} from "./immutable/Vector.js";
|
|
12
|
+
// codegen:end
|
|
@@ -56,6 +56,10 @@ export class HashMap<K, V> implements Iterable<readonly [K, V]> {
|
|
|
56
56
|
return this.findNode(key) !== undefined;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
unsafeGet(key: K): V | undefined {
|
|
60
|
+
return this.findNode(key)?.value;
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
get(key: K): Maybe<V> {
|
|
60
64
|
const n = this.findNode(key);
|
|
61
65
|
return n ? Just(n.value) : Nothing();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// codegen:start { preset: type-barrel, include: ./mutable/*.ts }
|
|
2
|
+
export type {} from "./mutable/HashMap.js";
|
|
3
|
+
export type {} from "./mutable/HashSet.js";
|
|
4
|
+
export type {} from "./mutable/internal.js";
|
|
5
|
+
export type {} from "./mutable/ListBuffer.js";
|
|
6
|
+
// codegen:end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @tsplus type fncts.IterableWeakMap
|
|
3
3
|
*/
|
|
4
|
-
export class IterableWeakMap<K extends object, V> implements Iterable<readonly [K, V]> {
|
|
4
|
+
export class IterableWeakMap<K extends object, V> implements Iterable<readonly [K, V]>, Map<K, V> {
|
|
5
5
|
private weakMap = new WeakMap<K, { value: V; ref: WeakRef<K> }>();
|
|
6
6
|
private refSet = new Set<WeakRef<K>>();
|
|
7
7
|
private finalizationGroup = new FinalizationRegistry<{ ref: WeakRef<K>; set: Set<WeakRef<K>> }>(
|
|
@@ -44,11 +44,48 @@ export class IterableWeakMap<K extends object, V> implements Iterable<readonly [
|
|
|
44
44
|
return true;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
has(this: this, key: K): boolean {
|
|
48
|
+
return this.weakMap.has(key);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
clear(): void {
|
|
52
|
+
for (const ref of this.refSet) {
|
|
53
|
+
const key = ref.deref();
|
|
54
|
+
if (!key) continue;
|
|
55
|
+
const entry = this.weakMap.get(key)!;
|
|
56
|
+
this.weakMap.delete(key);
|
|
57
|
+
this.refSet.delete(entry.ref);
|
|
58
|
+
this.finalizationGroup.unregister(entry.ref);
|
|
59
|
+
}
|
|
60
|
+
this.refSet.clear();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: IterableWeakMap<K, V>): void {
|
|
64
|
+
thisArg = thisArg ?? this;
|
|
65
|
+
for (const kv of this) {
|
|
66
|
+
callbackfn(kv[1], kv[0], thisArg);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get size(): number {
|
|
71
|
+
let n = 0;
|
|
72
|
+
for (const ref of this.refSet) {
|
|
73
|
+
const key = ref.deref();
|
|
74
|
+
if (!key) continue;
|
|
75
|
+
n++;
|
|
76
|
+
}
|
|
77
|
+
return n;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
[Symbol.iterator](this: this): IterableIterator<[K, V]> {
|
|
48
81
|
return this.entries();
|
|
49
82
|
}
|
|
50
83
|
|
|
51
|
-
|
|
84
|
+
get [Symbol.toStringTag](): string {
|
|
85
|
+
return this.weakMap[Symbol.toStringTag];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
*entries(this: this): IterableIterator<[K, V]> {
|
|
52
89
|
for (const ref of this.refSet) {
|
|
53
90
|
const key = ref.deref();
|
|
54
91
|
if (!key) continue;
|
|
@@ -57,7 +94,15 @@ export class IterableWeakMap<K extends object, V> implements Iterable<readonly [
|
|
|
57
94
|
}
|
|
58
95
|
}
|
|
59
96
|
|
|
60
|
-
|
|
61
|
-
|
|
97
|
+
*keys(this: this): IterableIterator<K> {
|
|
98
|
+
for (const [key] of this) {
|
|
99
|
+
yield key;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
*values(): IterableIterator<V> {
|
|
104
|
+
for (const [, value] of this) {
|
|
105
|
+
yield value;
|
|
106
|
+
}
|
|
62
107
|
}
|
|
63
108
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @tsplus type fncts.IterableWeakSet
|
|
3
3
|
*/
|
|
4
|
-
export class IterableWeakSet<A extends object> implements Iterable<A> {
|
|
4
|
+
export class IterableWeakSet<A extends object> implements Iterable<A>, Set<A> {
|
|
5
5
|
private weakMap = new WeakMap<A, { ref: WeakRef<A> }>();
|
|
6
6
|
private refSet = new Set<WeakRef<A>>();
|
|
7
7
|
private finalizationGroup = new FinalizationRegistry<{ ref: WeakRef<A>; set: Set<WeakRef<A>> }>(
|
|
@@ -12,9 +12,11 @@ export class IterableWeakSet<A extends object> implements Iterable<A> {
|
|
|
12
12
|
set.delete(ref);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
constructor(iterable
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
constructor(iterable?: Iterable<A>) {
|
|
16
|
+
if (iterable) {
|
|
17
|
+
for (const value of iterable) {
|
|
18
|
+
this.add(value);
|
|
19
|
+
}
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -35,14 +37,52 @@ export class IterableWeakSet<A extends object> implements Iterable<A> {
|
|
|
35
37
|
|
|
36
38
|
this.weakMap.delete(value);
|
|
37
39
|
this.refSet.delete(entry.ref);
|
|
40
|
+
this.finalizationGroup.unregister(entry.ref);
|
|
38
41
|
return true;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
return this.
|
|
44
|
+
has(this: this, value: A): boolean {
|
|
45
|
+
return this.weakMap.has(value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
keys(): IterableIterator<A> {
|
|
49
|
+
return this[Symbol.iterator]();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
values(): IterableIterator<A> {
|
|
53
|
+
return this[Symbol.iterator]();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
forEach(f: (value: A, value2: A, set: Set<A>) => void, thisArg?: Set<A>): void {
|
|
57
|
+
thisArg = thisArg ?? this;
|
|
58
|
+
for (const value of this) {
|
|
59
|
+
f(value, value, thisArg);
|
|
60
|
+
}
|
|
43
61
|
}
|
|
44
62
|
|
|
45
|
-
|
|
63
|
+
clear(): void {
|
|
64
|
+
for (const ref of this.refSet) {
|
|
65
|
+
const key = ref.deref();
|
|
66
|
+
if (!key) continue;
|
|
67
|
+
const entry = this.weakMap.get(key)!;
|
|
68
|
+
this.weakMap.delete(key);
|
|
69
|
+
this.refSet.delete(entry.ref);
|
|
70
|
+
this.finalizationGroup.unregister(entry.ref);
|
|
71
|
+
}
|
|
72
|
+
this.refSet.clear();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get size(): number {
|
|
76
|
+
let n = 0;
|
|
77
|
+
for (const ref of this.refSet) {
|
|
78
|
+
const value = ref.deref();
|
|
79
|
+
if (!value) continue;
|
|
80
|
+
n++;
|
|
81
|
+
}
|
|
82
|
+
return n;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
*[Symbol.iterator](this: this): IterableIterator<A> {
|
|
46
86
|
for (const ref of this.refSet) {
|
|
47
87
|
const key = ref.deref();
|
|
48
88
|
if (!key) continue;
|
|
@@ -50,7 +90,15 @@ export class IterableWeakSet<A extends object> implements Iterable<A> {
|
|
|
50
90
|
}
|
|
51
91
|
}
|
|
52
92
|
|
|
53
|
-
|
|
54
|
-
return this.
|
|
93
|
+
get [Symbol.toStringTag]() {
|
|
94
|
+
return this.refSet[Symbol.toStringTag];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
*entries(this: this): IterableIterator<[A, A]> {
|
|
98
|
+
for (const ref of this.refSet) {
|
|
99
|
+
const key = ref.deref();
|
|
100
|
+
if (!key) continue;
|
|
101
|
+
yield [key, key];
|
|
102
|
+
}
|
|
55
103
|
}
|
|
56
104
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// codegen:start { preset: type-barrel, include: ./collection/*.ts }
|
|
2
|
+
export type {} from "./collection/compat.js";
|
|
3
|
+
export type {} from "./collection/immutable.js";
|
|
4
|
+
export type {} from "./collection/Iterable.js";
|
|
5
|
+
export type {} from "./collection/mutable.js";
|
|
6
|
+
export type {} from "./collection/weak.js";
|
|
7
|
+
// codegen:end
|
package/_src/control/Eval/api.ts
CHANGED
|
@@ -38,8 +38,11 @@ export function zipWith_<A, B, C>(self: Eval<A>, fb: Eval<B>, f: (a: A, b: B) =>
|
|
|
38
38
|
return self.flatMap((a) => fb.map((b) => f(a, b)));
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @tsplus fluent fncts.control.Eval zip
|
|
43
|
+
*/
|
|
44
|
+
export function zip_<A, B>(self: Eval<A>, fb: Eval<B>): Eval<Zipped.Make<A, B>> {
|
|
45
|
+
return self.zipWith(fb, (a, b) => Zipped(a, b));
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
/**
|