@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
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
export const traverse = traverse_1;
|
|
2
1
|
import { identity } from "@fncts/base/data/function";
|
|
3
2
|
export const Traversable = {};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
function traverse_1(ta, f,
|
|
9
|
-
/** @tsplus auto */
|
|
10
|
-
F,
|
|
11
|
-
/** @tsplus auto */
|
|
12
|
-
G) {
|
|
13
|
-
return F.traverse(ta, f, G);
|
|
3
|
+
export function mkTraverse_() {
|
|
4
|
+
return i => i();
|
|
14
5
|
}
|
|
15
6
|
/**
|
|
16
|
-
* @tsplus
|
|
7
|
+
* @tsplus static fncts.TraversableOps sequence
|
|
17
8
|
*/
|
|
18
9
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
F,
|
|
23
|
-
/** @tsplus auto */
|
|
24
|
-
G) {
|
|
25
|
-
const G_1 =
|
|
26
|
-
/** @tsplus auto */
|
|
27
|
-
G;
|
|
28
|
-
const F_1 =
|
|
29
|
-
/** @tsplus auto */
|
|
30
|
-
F;
|
|
31
|
-
return traverse_1(ta, identity, F_1, G_1);
|
|
10
|
+
export function sequence(F) {
|
|
11
|
+
// @ts-expect-error
|
|
12
|
+
return ta => G => F.traverse(ta)(G)(identity);
|
|
32
13
|
}
|
|
33
14
|
//# sourceMappingURL=Traversable.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Traversable.mjs","mappings":"
|
|
1
|
+
{"version":3,"file":"Traversable.mjs","mappings":"AAIA,SAASA,QAAT,QAAyB,2BAAzB;AAoBA,OAAO,MAAMC,WAAW,GAAmB,EAApC;AAwBP,OAAM,SAAUC,WAAV,GAAqB;EACzB,OAAQC,CAAD,IAAYA,CAAC,EAApB;AACD;AAED;;;;AAGA,OAAM,SAAUC,QAAV,CACJC,CADI,EACiB;EAUrB;EACA,OAAQC,EAAD,IAASC,CAAD,IAAOF,CAAC,CAACG,QAAF,CAAWF,EAAX,EAAeC,CAAf,EAAkBP,QAAlB,CAAtB;AACD","names":["identity","Traversable","mkTraverse_","i","sequence","F","ta","G","traverse"],"sourceRoot":"","sources":["../../_src/typeclass/Traversable.ts"],"sourcesContent":[null]}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export const TraversableWithIndex = {};
|
|
2
|
-
export function
|
|
3
|
-
|
|
4
|
-
F,
|
|
5
|
-
/** @tsplus auto */
|
|
6
|
-
G) {
|
|
7
|
-
return F.traverseWithIndex(ta, f, G);
|
|
2
|
+
export function mkTraverseWithIndex_() {
|
|
3
|
+
return i => i();
|
|
8
4
|
}
|
|
9
5
|
//# sourceMappingURL=TraversableWithIndex.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraversableWithIndex.mjs","mappings":"
|
|
1
|
+
{"version":3,"file":"TraversableWithIndex.mjs","mappings":"AA0BA,OAAO,MAAMA,oBAAoB,GAA4B,EAAtD;AA0BP,OAAM,SAAUC,oBAAV,GAA8B;EAClC,OAAQC,CAAD,IAAYA,CAAC,EAApB;AACD","names":["TraversableWithIndex","mkTraverseWithIndex_","i"],"sourceRoot":"","sources":["../../_src/typeclass/TraversableWithIndex.ts"],"sourcesContent":[null]}
|
|
@@ -1,47 +1,10 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fncts/base/data/Maybe/constructors";
|
|
2
|
-
import * as tsplus_module_2 from "@fncts/base/typeclass/Functor";
|
|
3
|
-
export const wither = wither_1;
|
|
4
2
|
export const Witherable = {};
|
|
5
3
|
/**
|
|
6
|
-
* @tsplus
|
|
4
|
+
* @tsplus static fncts.WitherableOps filterA
|
|
7
5
|
*/
|
|
8
6
|
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
F,
|
|
12
|
-
/** @tsplus auto */
|
|
13
|
-
G) {
|
|
14
|
-
const G_1 =
|
|
15
|
-
/** @tsplus auto */
|
|
16
|
-
G;
|
|
17
|
-
return F.wither(wa, f, G_1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function wilt(wa, f,
|
|
21
|
-
/** @tsplus auto */
|
|
22
|
-
F,
|
|
23
|
-
/** @tsplus auto */
|
|
24
|
-
G) {
|
|
25
|
-
const G_2 =
|
|
26
|
-
/** @tsplus auto */
|
|
27
|
-
G;
|
|
28
|
-
return F.wilt(wa, f, G_2);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @tsplus fluent fncts.Kind filterA
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
export function filterA(fa, p,
|
|
35
|
-
/** @tsplus auto */
|
|
36
|
-
F,
|
|
37
|
-
/** @tsplus auto */
|
|
38
|
-
G) {
|
|
39
|
-
const G_3 =
|
|
40
|
-
/** @tsplus auto */
|
|
41
|
-
G;
|
|
42
|
-
const F_1 =
|
|
43
|
-
/** @tsplus auto */
|
|
44
|
-
F;
|
|
45
|
-
return wither_1(fa, a => tsplus_module_2.map(p(a), bb => bb ? tsplus_module_1.just(a) : tsplus_module_1.nothing(), G), F_1, G_3);
|
|
7
|
+
export function filterA(F) {
|
|
8
|
+
return fa => G => p => F.wither(fa)(G)(a => G.map(p(a), bb => bb ? tsplus_module_1.just(a) : tsplus_module_1.nothing()));
|
|
46
9
|
}
|
|
47
10
|
//# sourceMappingURL=Witherable.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witherable.mjs","mappings":"
|
|
1
|
+
{"version":3,"file":"Witherable.mjs","mappings":";AAyCA,OAAO,MAAMA,UAAU,GAAkB,EAAlC;AAEP;;;;AAGA,OAAM,SAAUC,OAAV,CACJC,CADI,EACgB;EAQpB,OAAQC,EAAD,IAASC,CAAD,IAAQC,CAAD,IAAOH,CAAC,CAACI,MAAF,CAASH,EAAT,EAAaC,CAAb,EAAiBG,CAAD,IAAOH,CAAC,CAACI,GAAF,CAAMH,CAAC,CAACE,CAAD,CAAP,EAAaE,EAAD,IAASA,EAAE,GAAGC,qBAAKH,CAAL,CAAH,GAAaG,yBAApC,CAAvB,CAA7B;AACD","names":["Witherable","filterA","F","fa","G","p","wither","a","map","bb","tsplus_module_1"],"sourceRoot":"","sources":["../../_src/typeclass/Witherable.ts"],"sourcesContent":[null]}
|
|
@@ -1,47 +1,12 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fncts/base/data/Maybe/constructors";
|
|
2
|
-
import * as tsplus_module_2 from "@fncts/base/typeclass/Functor";
|
|
3
|
-
export const witherWithIndex = witherWithIndex_1;
|
|
4
2
|
export const WitherableWithIndex = {};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
function witherWithIndex_1(wa, f,
|
|
10
|
-
/** @tsplus auto */
|
|
11
|
-
F,
|
|
12
|
-
/** @tsplus auto */
|
|
13
|
-
G) {
|
|
14
|
-
const G_1 =
|
|
15
|
-
/** @tsplus auto */
|
|
16
|
-
G;
|
|
17
|
-
return F.witherWithIndex(wa, f, G_1);
|
|
3
|
+
export function makeWitherWithIndex() {
|
|
4
|
+
return i => i();
|
|
18
5
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export function wiltWithIndex(wa, f,
|
|
25
|
-
/** @tsplus auto */
|
|
26
|
-
F,
|
|
27
|
-
/** @tsplus auto */
|
|
28
|
-
G) {
|
|
29
|
-
const G_2 =
|
|
30
|
-
/** @tsplus auto */
|
|
31
|
-
G;
|
|
32
|
-
return F.wiltWithIndex(wa, f, G_2);
|
|
6
|
+
export function makeWiltWithIndex() {
|
|
7
|
+
return i => i();
|
|
33
8
|
}
|
|
34
|
-
export function filterWithIndexA(
|
|
35
|
-
|
|
36
|
-
F,
|
|
37
|
-
/** @tsplus auto */
|
|
38
|
-
G) {
|
|
39
|
-
const G_3 =
|
|
40
|
-
/** @tsplus auto */
|
|
41
|
-
G;
|
|
42
|
-
const F_1 =
|
|
43
|
-
/** @tsplus auto */
|
|
44
|
-
F;
|
|
45
|
-
return witherWithIndex_1(fa, (i, a) => tsplus_module_2.map(p(i, a), bb => bb ? tsplus_module_1.just(a) : tsplus_module_1.nothing(), G), F_1, G_3);
|
|
9
|
+
export function filterWithIndexA(F) {
|
|
10
|
+
return fa => G => p => F.witherWithIndex(fa)(G)((i, a) => G.map(p(i, a), bb => bb ? tsplus_module_1.just(a) : tsplus_module_1.nothing()));
|
|
46
11
|
}
|
|
47
12
|
//# sourceMappingURL=WitherableWithIndex.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WitherableWithIndex.mjs","mappings":"
|
|
1
|
+
{"version":3,"file":"WitherableWithIndex.mjs","mappings":";AA6CA,OAAO,MAAMA,mBAAmB,GAA2B,EAApD;AA0BP,OAAM,SAAUC,mBAAV,GAA6B;EACjC,OAAQC,CAAD,IAAYA,CAAC,EAApB;AACD;AA8BD,OAAM,SAAUC,iBAAV,GAA2B;EAC/B,OAAQD,CAAD,IAAYA,CAAC,EAApB;AACD;AAED,OAAM,SAAUE,gBAAV,CACJC,CADI,EACyB;EAQ7B,OAAQC,EAAD,IAASC,CAAD,IAAQC,CAAD,IAAOH,CAAC,CAACI,eAAF,CAAkBH,EAAlB,EAAsBC,CAAtB,EAAyB,CAACL,CAAD,EAAIQ,CAAJ,KAAUH,CAAC,CAACI,GAAF,CAAMH,CAAC,CAACN,CAAD,EAAIQ,CAAJ,CAAP,EAAgBE,EAAD,IAASA,EAAE,GAAGC,qBAAKH,CAAL,CAAH,GAAaG,yBAAvC,CAAnC,CAA7B;AACD","names":["WitherableWithIndex","makeWitherWithIndex","i","makeWiltWithIndex","filterWithIndexA","F","fa","G","p","witherWithIndex","a","map","bb","tsplus_module_1"],"sourceRoot":"","sources":["../../_src/typeclass/WitherableWithIndex.ts"],"sourcesContent":[null]}
|
package/_mjs/util.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.mjs","mappings":"","names":[],"sourceRoot":"","sources":[],"sourcesContent":[]}
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
import type * as P from "@fncts/base/typeclass";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @tsplus
|
|
4
|
+
* @tsplus getter fncts.Iterable traverseToConcWithIndex
|
|
5
5
|
*/
|
|
6
|
-
export function traverseToConcWithIndex_<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
): HKT.Kind<G, K, Q, W, X, I, S, R, E, Conc<B>> {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
export function traverseToConcWithIndex_<A>(ta: Iterable<A>) {
|
|
7
|
+
return <G extends HKT, GC = HKT.None>(G: P.Applicative<G, GC>) =>
|
|
8
|
+
<K, Q, W, X, I, S, R, E, B>(
|
|
9
|
+
f: (i: number, a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, B>,
|
|
10
|
+
): HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, Conc<B>> => {
|
|
11
|
+
let output = G.pure<Conc<B>, K, Q, W, X, I, S, R, E>(Conc.empty<B>());
|
|
12
|
+
const iterator = ta[Symbol.iterator]();
|
|
13
|
+
let result: IteratorResult<A>;
|
|
14
|
+
let i = 0;
|
|
15
|
+
while (!(result = iterator.next()).done) {
|
|
16
|
+
output = G.zipWith(output, f(i, result.value), (bs, b) => bs.append(b)) as typeof output;
|
|
17
|
+
i++;
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
return output;
|
|
21
|
+
};
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
|
-
* @tsplus
|
|
25
|
+
* @tsplus getter fncts.Iterable traverseToConc
|
|
25
26
|
*/
|
|
26
|
-
export function traverseToConc_<
|
|
27
|
+
export function traverseToConc_<A>(
|
|
27
28
|
ta: Iterable<A>,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
31
|
-
|
|
29
|
+
): <G extends HKT, GC = HKT.None>(
|
|
30
|
+
G: P.Applicative<G, GC>,
|
|
31
|
+
) => <K, Q, W, X, I, S, R, E, B>(
|
|
32
|
+
f: (a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, B>,
|
|
33
|
+
) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, Conc<B>> {
|
|
34
|
+
return (G) => (f) => ta.traverseToConcWithIndex(G)((_, a) => f(a));
|
|
32
35
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Eq } from "@fncts/base/typeclass";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @tsplus getter fncts.
|
|
5
|
-
* @tsplus getter fncts.
|
|
4
|
+
* @tsplus getter fncts.Array elem
|
|
5
|
+
* @tsplus getter fncts.ReadonlyArray elem
|
|
6
6
|
*/
|
|
7
7
|
export function elem<A>(self: ReadonlyArray<A>) {
|
|
8
8
|
return (eq: Eq<A>) =>
|
|
@@ -17,32 +17,32 @@ export function elem<A>(self: ReadonlyArray<A>) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* @tsplus fluent fncts.
|
|
21
|
-
* @tsplus fluent fncts.
|
|
20
|
+
* @tsplus fluent fncts.Array isEmpty
|
|
21
|
+
* @tsplus fluent fncts.ReadonlyArray isEmpty
|
|
22
22
|
*/
|
|
23
23
|
export function isEmpty<A>(self: ReadonlyArray<A>): boolean {
|
|
24
24
|
return self.length === 0;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* @tsplus fluent fncts.
|
|
29
|
-
* @tsplus fluent fncts.
|
|
28
|
+
* @tsplus fluent fncts.Array isNonEmpty
|
|
29
|
+
* @tsplus fluent fncts.ReadonlyArray isNonEmpty
|
|
30
30
|
*/
|
|
31
31
|
export function isNonEmpty<A>(self: ReadonlyArray<A>): self is ReadonlyNonEmptyArray<A> {
|
|
32
32
|
return self.length > 0;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* @tsplus fluent fncts.
|
|
37
|
-
* @tsplus fluent fncts.
|
|
36
|
+
* @tsplus fluent fncts.Array foldLeft
|
|
37
|
+
* @tsplus fluent fncts.ReadonlyArray foldLeft
|
|
38
38
|
*/
|
|
39
39
|
export function foldLeft<A, B>(self: ReadonlyArray<A>, b: B, f: (b: B, a: A) => B): B {
|
|
40
40
|
return self.foldLeftWithIndex(b, (_, b, a) => f(b, a));
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* @tsplus fluent fncts.
|
|
45
|
-
* @tsplus fluent fncts.
|
|
44
|
+
* @tsplus fluent fncts.Array foldLeftWithIndex
|
|
45
|
+
* @tsplus fluent fncts.ReadonlyArray foldLeftWithIndex
|
|
46
46
|
*/
|
|
47
47
|
export function foldLeftWithIndex<A, B>(self: ReadonlyArray<A>, b: B, f: (i: number, b: B, a: A) => B): B {
|
|
48
48
|
let out = b;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
declare global {
|
|
2
2
|
/**
|
|
3
|
-
* @tsplus type fncts.
|
|
3
|
+
* @tsplus type fncts.ReadonlyArray
|
|
4
4
|
*/
|
|
5
5
|
export interface ReadonlyArray<T> {}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @tsplus type fncts.
|
|
8
|
+
* @tsplus type fncts.Array
|
|
9
9
|
*/
|
|
10
10
|
export interface Array<T> {}
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @tsplus type fncts.
|
|
13
|
+
* @tsplus type fncts.ArrayOps
|
|
14
14
|
*/
|
|
15
15
|
export interface ArrayConstructor {}
|
|
16
16
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { DecodeError } from "@fncts/base/data/DecodeError";
|
|
2
|
+
import type { Check } from "@fncts/typelevel/Check";
|
|
3
|
+
|
|
4
|
+
import { CompoundError, OptionalIndexError, PrimitiveError } from "@fncts/base/data/DecodeError";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @tsplus derive fncts.Guard[fncts.Array]<_> 10
|
|
8
|
+
*/
|
|
9
|
+
export function deriveGuard<A extends Array<any>>(
|
|
10
|
+
...[element]: [A] extends [Array<infer _A>]
|
|
11
|
+
? Check<Check.IsEqual<A, Array<_A>>> extends Check.True
|
|
12
|
+
? [element: Guard<_A>]
|
|
13
|
+
: never
|
|
14
|
+
: never
|
|
15
|
+
): Guard<A> {
|
|
16
|
+
return Guard((u): u is A => {
|
|
17
|
+
if (Array.isArray(u)) {
|
|
18
|
+
return u.every(element.is);
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @tsplus derive fncts.Guard[fncts.ReadonlyArray]<_> 10
|
|
26
|
+
*/
|
|
27
|
+
export const deriveReadonlyArrayGuard: <A extends ReadonlyArray<any>>(
|
|
28
|
+
...[element]: [A] extends [ReadonlyArray<infer _A>]
|
|
29
|
+
? Check<Check.IsEqual<A, ReadonlyArray<_A>>> extends Check.True
|
|
30
|
+
? [element: Guard<_A>]
|
|
31
|
+
: never
|
|
32
|
+
: never
|
|
33
|
+
) => Guard<A> = deriveGuard.unsafeCoerce();
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @tsplus derive fncts.Decoder[fncts.Array]<_> 10
|
|
37
|
+
*/
|
|
38
|
+
export function deriveDecoder<A extends Array<any>>(
|
|
39
|
+
...[element]: [A] extends [Array<infer _A>]
|
|
40
|
+
? Check<Check.IsEqual<A, Array<_A>>> extends Check.True
|
|
41
|
+
? [element: Decoder<_A>]
|
|
42
|
+
: never
|
|
43
|
+
: never
|
|
44
|
+
): Decoder<A> {
|
|
45
|
+
return Decoder((u) => {
|
|
46
|
+
if (Array.isArray(u)) {
|
|
47
|
+
const errors = Vector.emptyPushable<DecodeError>();
|
|
48
|
+
let failed = false;
|
|
49
|
+
const out = Array(u.length);
|
|
50
|
+
for (let i = 0; i < u.length; i++) {
|
|
51
|
+
const decoded = element.decode(u[i]!);
|
|
52
|
+
decoded.match2(
|
|
53
|
+
(err) => {
|
|
54
|
+
failed = true;
|
|
55
|
+
errors.push(new OptionalIndexError(i, err));
|
|
56
|
+
},
|
|
57
|
+
(warning, value) => {
|
|
58
|
+
out[i] = value;
|
|
59
|
+
if (warning.isJust()) {
|
|
60
|
+
errors.push(warning.value);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
if (failed) {
|
|
66
|
+
return These.left(new CompoundError("Array", errors));
|
|
67
|
+
}
|
|
68
|
+
return These.rightOrBoth(errors.length > 0 ? Just(new CompoundError("Array", errors)) : Nothing(), out as A);
|
|
69
|
+
}
|
|
70
|
+
return These.left(new PrimitiveError(u, "Array"));
|
|
71
|
+
}, `Array<${element.label}>`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @tsplus derive fncts.Decoder[fncts.ReadonlyArray]<_> 10
|
|
76
|
+
*/
|
|
77
|
+
export function deriveReadonlyArrayDecoder<A extends ReadonlyArray<any>>(
|
|
78
|
+
...[element]: [A] extends [ReadonlyArray<infer _A>]
|
|
79
|
+
? Check<Check.IsEqual<A, ReadonlyArray<_A>>> extends Check.True
|
|
80
|
+
? [element: Decoder<_A>]
|
|
81
|
+
: never
|
|
82
|
+
: never
|
|
83
|
+
): Decoder<A> {
|
|
84
|
+
return Decoder((u) => deriveDecoder(element).decode(u) as These<DecodeError, A>, `ReadonlyArray<${element.label}>`);
|
|
85
|
+
}
|
|
@@ -2,6 +2,49 @@ import type { Check } from "@fncts/typelevel/Check";
|
|
|
2
2
|
|
|
3
3
|
import { CompoundError, MissingKeyError, OptionalKeyError, RequiredKeyError } from "@fncts/base/data/DecodeError";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @tsplus derive fncts.Guard<_> 15
|
|
7
|
+
*/
|
|
8
|
+
export function deriveDictionaryGuard<A extends Record<string, any>>(
|
|
9
|
+
...[value]: Check<Check.IsDictionary<A>> extends Check.True ? [value: Guard<A[keyof A]>] : never
|
|
10
|
+
): Guard<A> {
|
|
11
|
+
return Guard((u): u is A => {
|
|
12
|
+
if (!Derive<Guard<{}>>().is(u)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
for (const k of Object.keys(u)) {
|
|
16
|
+
if (!value.is(u[k])) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @tsplus derive fncts.Guard<_> 15
|
|
26
|
+
*/
|
|
27
|
+
export function deriveGuard<A extends Record<string, any>>(
|
|
28
|
+
...[key, value, requiredKeys]: Check<Check.IsRecord<A>> extends Check.True
|
|
29
|
+
? [key: Guard<keyof A>, value: Guard<A[keyof A]>, requiredKeys: { [k in keyof A]: 0 }]
|
|
30
|
+
: never
|
|
31
|
+
): Guard<A> {
|
|
32
|
+
const requiredKeysSet = new Set(Object.keys(requiredKeys));
|
|
33
|
+
return Guard((record): record is A => {
|
|
34
|
+
const missing = new Set(requiredKeysSet);
|
|
35
|
+
if (!Derive<Guard<{}>>().is(record)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
for (const k of Object.keys(record)) {
|
|
39
|
+
if (requiredKeysSet.has(k) && !value.is(record[k])) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
missing.delete(k);
|
|
43
|
+
}
|
|
44
|
+
return missing.size === 0;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
5
48
|
/**
|
|
6
49
|
* @tsplus derive fncts.Decoder<_> 15
|
|
7
50
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
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";
|
|
4
3
|
|
|
5
4
|
import {
|
|
6
5
|
_Empty,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
import { EitherTag } from "@fncts/base/data/Either";
|
|
15
14
|
import { identity, tuple } from "@fncts/base/data/function";
|
|
16
15
|
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
|
|
@@ -978,20 +978,18 @@ export function takeWhile_<A>(self: Conc<A>, p: Predicate<A>): Conc<A> {
|
|
|
978
978
|
}
|
|
979
979
|
|
|
980
980
|
/**
|
|
981
|
-
* @tsplus
|
|
981
|
+
* @tsplus getter fncts.Conc traverse
|
|
982
982
|
*/
|
|
983
|
-
export const traverse: P.Traversable<ConcF>["traverse"] = (self
|
|
983
|
+
export const traverse: P.Traversable<ConcF>["traverse"] = (self) => (G) => (f) =>
|
|
984
|
+
self.traverseWithIndex(G)((_, a) => f(a));
|
|
984
985
|
|
|
985
986
|
/**
|
|
986
|
-
* @tsplus
|
|
987
|
+
* @tsplus getter fncts.Conc traverseWithIndex
|
|
987
988
|
*/
|
|
988
|
-
export
|
|
989
|
-
self
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
): HKT.Kind<G, KG, QG, WG, XG, IG, SG, RG, EG, Conc<B>> {
|
|
993
|
-
return self.foldLeftWithIndex(G.pure(Conc.empty()), (i, fbs, a) => fbs.zipWith(f(i, a), (bs, b) => bs.append(b), G));
|
|
994
|
-
}
|
|
989
|
+
export const traverseWithIndex = P.TraversableWithIndex.makeTraverseWithIndex<ConcF>()(
|
|
990
|
+
() => (self) => (G) => (f) =>
|
|
991
|
+
self.foldLeftWithIndex(G.pure(Conc.empty()), (i, fbs, a) => G.zipWith(fbs, f(i, a), (bs, b) => bs.append(b))),
|
|
992
|
+
);
|
|
995
993
|
|
|
996
994
|
/**
|
|
997
995
|
* @tsplus getter fncts.Conc toBuffer
|
|
@@ -19,17 +19,20 @@ export const enum ConcTag {
|
|
|
19
19
|
ByteChunk = "ByteChunk",
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export interface ConcF extends
|
|
22
|
+
export interface ConcF extends HKT {
|
|
23
|
+
type: Conc<this["A"]>;
|
|
24
|
+
variance: {
|
|
25
|
+
A: "+";
|
|
26
|
+
};
|
|
27
|
+
index: number;
|
|
28
|
+
}
|
|
23
29
|
|
|
24
30
|
/**
|
|
25
31
|
* @tsplus type fncts.Conc
|
|
26
32
|
* @tsplus companion fncts.ConcOps
|
|
27
33
|
*/
|
|
28
34
|
export abstract class Conc<A> implements Iterable<A>, Hashable, Equatable {
|
|
29
|
-
|
|
30
|
-
[HKT.A]?: () => A;
|
|
31
|
-
[HKT.T]?: Conc<HKT._A<this>>;
|
|
32
|
-
[HKT.Ix]?: number;
|
|
35
|
+
declare _A: () => A;
|
|
33
36
|
|
|
34
37
|
readonly _typeId: ConcTypeId = ConcTypeId;
|
|
35
38
|
abstract readonly length: number;
|
|
@@ -40,18 +43,19 @@ export abstract class Conc<A> implements Iterable<A>, Hashable, Equatable {
|
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
[Symbol.equals](that: unknown): boolean {
|
|
43
|
-
return Conc.
|
|
46
|
+
return Conc.is(that) && (this as Conc<A>).corresponds(that, Equatable.strictEquals);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
abstract class ConcImplementation<A> implements Iterable<A> {
|
|
48
51
|
readonly _typeId: ConcTypeId = ConcTypeId;
|
|
52
|
+
declare _A: () => A;
|
|
49
53
|
get [Symbol.hash](): number {
|
|
50
54
|
return Hashable.iterator(this[Symbol.iterator]());
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
[Symbol.equals](that: unknown): boolean {
|
|
54
|
-
return Conc.
|
|
58
|
+
return Conc.is(that) && (this as Conc<A>).corresponds(that, Equatable.strictEquals);
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
abstract readonly length: number;
|
|
@@ -104,8 +108,8 @@ abstract class ConcImplementation<A> implements Iterable<A> {
|
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
concat<B>(that: ConcImplementation<B>): ConcImplementation<A | B> {
|
|
107
|
-
concrete
|
|
108
|
-
concrete
|
|
111
|
+
concrete(this);
|
|
112
|
+
concrete(that);
|
|
109
113
|
if (this._tag === ConcTag.Empty) {
|
|
110
114
|
return that;
|
|
111
115
|
}
|
|
@@ -122,7 +126,7 @@ abstract class ConcImplementation<A> implements Iterable<A> {
|
|
|
122
126
|
}
|
|
123
127
|
const diff = that.depth - this.depth;
|
|
124
128
|
if (Math.abs(diff) <= 1) {
|
|
125
|
-
return new Concat(this, that);
|
|
129
|
+
return new Concat<A | B>(this, that);
|
|
126
130
|
} else if (diff < -1) {
|
|
127
131
|
if (this.left.depth >= this.right.depth) {
|
|
128
132
|
const nr = this.right.concat(that);
|
|
@@ -161,7 +165,7 @@ abstract class ConcImplementation<A> implements Iterable<A> {
|
|
|
161
165
|
} else if (n >= this.length) {
|
|
162
166
|
return this;
|
|
163
167
|
} else {
|
|
164
|
-
concrete
|
|
168
|
+
concrete(this);
|
|
165
169
|
switch (this._tag) {
|
|
166
170
|
case ConcTag.Empty:
|
|
167
171
|
return _Empty;
|
|
@@ -263,9 +267,10 @@ export class Empty<A> extends ConcImplementation<A> {
|
|
|
263
267
|
}
|
|
264
268
|
}
|
|
265
269
|
|
|
266
|
-
export const _Empty = new Empty<
|
|
270
|
+
export const _Empty = new Empty<never>();
|
|
267
271
|
|
|
268
272
|
export class Concat<A> extends ConcImplementation<A> {
|
|
273
|
+
declare _A: () => A;
|
|
269
274
|
readonly _tag = ConcTag.Concat;
|
|
270
275
|
|
|
271
276
|
length = this.left.length + this.right.length;
|
|
@@ -725,7 +730,7 @@ export function fromArray<A>(array: ArrayLike<A>): ConcImplementation<A> {
|
|
|
725
730
|
}
|
|
726
731
|
|
|
727
732
|
/**
|
|
728
|
-
* @tsplus static fncts.ConcOps
|
|
733
|
+
* @tsplus static fncts.ConcOps is
|
|
729
734
|
*/
|
|
730
735
|
export function isConc<A>(u: Iterable<A>): u is Conc<A>;
|
|
731
736
|
export function isConc(u: unknown): u is Conc<unknown>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Check } from "@fncts/typelevel/Check";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @tsplus derive fncts.Guard[fncts.Conc]<_> 10
|
|
5
|
+
*/
|
|
6
|
+
export function deriveGuard<A extends Conc<any>>(
|
|
7
|
+
...[elem]: [A] extends [Conc<infer _A>] ? [elem: Guard<_A>] : never
|
|
8
|
+
): Guard<A> {
|
|
9
|
+
return Guard((u): u is A => {
|
|
10
|
+
if (Conc.is(u)) {
|
|
11
|
+
return u.every(elem.is);
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @tsplus derive fncts.Decoder[fncts.Conc]<_> 10
|
|
19
|
+
*/
|
|
20
|
+
export function deriveDecoder<A extends Conc<any>>(
|
|
21
|
+
...[array, elem]: [A] extends [Conc<infer _A>]
|
|
22
|
+
? Check<Check.IsEqual<A, Conc<_A>>> extends Check.True
|
|
23
|
+
? [array: Decoder<Array<_A>>, elem: Decoder<_A>]
|
|
24
|
+
: never
|
|
25
|
+
: never
|
|
26
|
+
): Decoder<A> {
|
|
27
|
+
return Decoder((u) => array.decode(u).map((a) => Conc.from(a) as A), `Conc<${elem.label}>`);
|
|
28
|
+
}
|